mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-11-05 04:17:52 +00:00
Fixed issue 240 and some bugs.
1) Cannot Mount Path in Bucket(Issue 240) Changes man page for this issue("bucket[:path]" -> "bucket[:/path]"). And so s3fs did not work with mount path, fixed it. 2) Fixes other bug about renaming directory Fixes a bug caused by r420, which fails to rename directory. git-svn-id: http://s3fs.googlecode.com/svn/trunk@421 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
6b78bfdf4b
commit
c862ee40ea
@ -4,7 +4,7 @@ S3FS \- FUSE-based file system backed by Amazon S3
|
||||
.SH SYNOPSIS
|
||||
.SS mounting
|
||||
.TP
|
||||
\fBs3fs bucket[:path] mountpoint \fP [options]
|
||||
\fBs3fs bucket[:/path] mountpoint \fP [options]
|
||||
.SS unmounting
|
||||
.TP
|
||||
\fBumount mountpoint
|
||||
|
12
src/s3fs.cpp
12
src/s3fs.cpp
@ -1986,6 +1986,7 @@ static int rename_object(const char *from, const char *to) {
|
||||
return result;
|
||||
}
|
||||
result = s3fs_unlink(from);
|
||||
StatCache::getStatCacheData()->DelStat(to);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -2104,8 +2105,10 @@ static int rename_large_object(const char *from, const char *to) {
|
||||
}
|
||||
|
||||
result = complete_multipart_upload(to, upload_id, parts);
|
||||
if(result != 0)
|
||||
StatCache::getStatCacheData()->DelStat(to);
|
||||
if(result != 0){
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return s3fs_unlink(from);
|
||||
}
|
||||
@ -2132,6 +2135,7 @@ static int clone_directory_object(const char *from, const char *to)
|
||||
uid = get_uid(meta["x-amz-meta-uid"].c_str());
|
||||
gid = get_gid(meta["x-amz-meta-gid"].c_str());
|
||||
result = create_directory_object(to, mode, time, uid, gid);
|
||||
StatCache::getStatCacheData()->DelStat(to);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -3378,7 +3382,7 @@ static int remote_mountpath_exists(const char *path) {
|
||||
FGPRINT("remote_mountpath_exists [path=%s]\n", path);
|
||||
|
||||
// getattr will prefix the path with the remote mountpoint
|
||||
if(0 != get_object_attribute("", &stbuf, NULL)){
|
||||
if(0 != get_object_attribute("/", &stbuf, NULL)){
|
||||
return -1;
|
||||
}
|
||||
if(!S_ISDIR(stbuf.st_mode)){
|
||||
@ -4038,6 +4042,10 @@ static int my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_ar
|
||||
bucket = strtok(bucket_name, ":");
|
||||
char* pmount_prefix = strtok(NULL, ":");
|
||||
if(pmount_prefix){
|
||||
if(0 == strlen(pmount_prefix) || '/' != pmount_prefix[0]){
|
||||
fprintf(stderr, "%s: path(%s) must be prefix \"/\".\n", program_name.c_str(), pmount_prefix);
|
||||
return -1;
|
||||
}
|
||||
mount_prefix = pmount_prefix;
|
||||
// remove trailing slash
|
||||
if(mount_prefix.at(mount_prefix.size() - 1) == '/'){
|
||||
|
Loading…
Reference in New Issue
Block a user