mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-02-03 11:08:26 +00:00
Fixes issue #172
git-svn-id: http://s3fs.googlecode.com/svn/trunk@352 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
a16617a5d5
commit
f484ea00ae
@ -1,7 +1,7 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_PREREQ(2.59)
|
AC_PREREQ(2.59)
|
||||||
AC_INIT(s3fs, 1.56)
|
AC_INIT(s3fs, 1.57)
|
||||||
|
|
||||||
|
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
|
15
src/s3fs.cpp
15
src/s3fs.cpp
@ -931,6 +931,7 @@ static int put_local_fd(const char* path, headers_t meta, int fd) {
|
|||||||
} else {
|
} else {
|
||||||
result = put_local_fd_small_file(path, meta, fd);
|
result = put_local_fd_small_file(path, meta, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1609,7 +1610,7 @@ static int s3fs_create(const char *path, mode_t mode, struct fuse_file_info *fi)
|
|||||||
result = create_file_object(path, mode);
|
result = create_file_object(path, mode);
|
||||||
|
|
||||||
if(result != 0)
|
if(result != 0)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
// Object is now made, now open it
|
// Object is now made, now open it
|
||||||
|
|
||||||
@ -2367,7 +2368,6 @@ static int s3fs_flush(const char *path, struct fuse_file_info *fi) {
|
|||||||
int flags;
|
int flags;
|
||||||
int result;
|
int result;
|
||||||
int fd = fi->fh;
|
int fd = fi->fh;
|
||||||
time_t mtime;
|
|
||||||
|
|
||||||
if(foreground)
|
if(foreground)
|
||||||
cout << "s3fs_flush[path=" << path << "][fd=" << fd << "]" << endl;
|
cout << "s3fs_flush[path=" << path << "][fd=" << fd << "]" << endl;
|
||||||
@ -2394,9 +2394,6 @@ static int s3fs_flush(const char *path, struct fuse_file_info *fi) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mtime = time(NULL);
|
|
||||||
meta["x-amz-meta-mtime"] = str(mtime);
|
|
||||||
|
|
||||||
// force the cached copy to have the same mtime as the remote copy
|
// force the cached copy to have the same mtime as the remote copy
|
||||||
if(use_cache.size() > 0) {
|
if(use_cache.size() > 0) {
|
||||||
struct stat st;
|
struct stat st;
|
||||||
@ -2404,7 +2401,7 @@ static int s3fs_flush(const char *path, struct fuse_file_info *fi) {
|
|||||||
string cache_path(use_cache + "/" + bucket + path);
|
string cache_path(use_cache + "/" + bucket + path);
|
||||||
|
|
||||||
if((stat(cache_path.c_str(), &st)) == 0) {
|
if((stat(cache_path.c_str(), &st)) == 0) {
|
||||||
n_mtime.modtime = mtime;
|
n_mtime.modtime = strtoul(meta["x-amz-meta-mtime"].c_str(), (char **) NULL, 10);
|
||||||
if((utime(cache_path.c_str(), &n_mtime)) == -1) {
|
if((utime(cache_path.c_str(), &n_mtime)) == -1) {
|
||||||
YIKES(-errno);
|
YIKES(-errno);
|
||||||
}
|
}
|
||||||
@ -2418,12 +2415,10 @@ static int s3fs_flush(const char *path, struct fuse_file_info *fi) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int s3fs_release(const char *path, struct fuse_file_info *fi) {
|
static int s3fs_release(const char *path, struct fuse_file_info *fi) {
|
||||||
int fd = fi->fh;
|
|
||||||
|
|
||||||
if(foreground)
|
if(foreground)
|
||||||
cout << "s3fs_release[path=" << path << "][fd=" << fd << "]" << endl;
|
cout << "s3fs_release[path=" << path << "][fd=" << fi->fh << "]" << endl;
|
||||||
|
|
||||||
if(close(fd) == -1)
|
if(close(fi->fh) == -1)
|
||||||
YIKES(-errno);
|
YIKES(-errno);
|
||||||
|
|
||||||
if((fi->flags & O_RDWR) || (fi->flags & O_WRONLY))
|
if((fi->flags & O_RDWR) || (fi->flags & O_WRONLY))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user