mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-09 07:59:52 +00:00
Ability to disable multipart uploads
- Added 'nomultipart' option to disable multipart uploads - see issue #181 git-svn-id: http://s3fs.googlecode.com/svn/trunk@347 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
parent
6db8dafca4
commit
1a6885359c
@ -79,6 +79,8 @@ maximum number of entries in the stat cache
|
|||||||
.TP
|
.TP
|
||||||
\fB\-o\fR url (default="http://s3.amazonaws.com")
|
\fB\-o\fR url (default="http://s3.amazonaws.com")
|
||||||
sets the url to use to access Amazon S3. If you want to use HTTPS, then you can set url=https://s3.amazonaws.com
|
sets the url to use to access Amazon S3. If you want to use HTTPS, then you can set url=https://s3.amazonaws.com
|
||||||
|
.TP
|
||||||
|
\fB\-o\fR nomultipart - disable multipart uploads
|
||||||
.SH FUSE/MOUNT OPTIONS
|
.SH FUSE/MOUNT OPTIONS
|
||||||
.TP
|
.TP
|
||||||
Most of the generic mount options described in 'man mount' are supported (ro, rw, suid, nosuid, dev, nodev, exec, noexec, atime, noatime, sync async, dirsync). Filesystems are mounted with '-onodev,nosuid' by default, which can only be overridden by a privileged user.
|
Most of the generic mount options described in 'man mount' are supported (ro, rw, suid, nosuid, dev, nodev, exec, noexec, atime, noatime, sync async, dirsync). Filesystems are mounted with '-onodev,nosuid' by default, which can only be overridden by a privileged user.
|
||||||
|
23
src/s3fs.cpp
23
src/s3fs.cpp
@ -856,13 +856,12 @@ static int put_local_fd(const char* path, headers_t meta, int fd) {
|
|||||||
*
|
*
|
||||||
* If file is > 20MB, then multipart will kick in
|
* If file is > 20MB, then multipart will kick in
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(st.st_size > 68719476735LL ) { // 64GB - 1
|
if(st.st_size > 68719476735LL ) { // 64GB - 1
|
||||||
// close f ?
|
// close f ?
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(st.st_size >= 20971520) { // 20MB
|
if(st.st_size >= 20971520 && !nomultipart) { // 20MB
|
||||||
// Additional time is needed for large files
|
// Additional time is needed for large files
|
||||||
if(readwrite_timeout < 120)
|
if(readwrite_timeout < 120)
|
||||||
readwrite_timeout = 120;
|
readwrite_timeout = 120;
|
||||||
@ -1540,9 +1539,8 @@ 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
|
||||||
|
|
||||||
@ -2147,7 +2145,7 @@ static int s3fs_chmod(const char *path, mode_t mode) {
|
|||||||
headers_t meta;
|
headers_t meta;
|
||||||
|
|
||||||
if(foreground)
|
if(foreground)
|
||||||
cout << "chmod[path=" << path << "][mode=" << mode << "]" << endl;
|
printf("s3fs_chmod [path=%s] [mode=%d]\n", path, mode);
|
||||||
|
|
||||||
result = get_headers(path, meta);
|
result = get_headers(path, meta);
|
||||||
if(result != 0)
|
if(result != 0)
|
||||||
@ -2167,8 +2165,9 @@ static int s3fs_chmod(const char *path, mode_t mode) {
|
|||||||
static int s3fs_chown(const char *path, uid_t uid, gid_t gid) {
|
static int s3fs_chown(const char *path, uid_t uid, gid_t gid) {
|
||||||
int result;
|
int result;
|
||||||
char *s3_realpath;
|
char *s3_realpath;
|
||||||
|
|
||||||
if(foreground)
|
if(foreground)
|
||||||
cout << "chown[path=" << path << "]" << endl;
|
printf("s3fs_chown [path=%s] [uid=%d] [gid=%d]\n", path, uid, gid);
|
||||||
|
|
||||||
headers_t meta;
|
headers_t meta;
|
||||||
result = get_headers(path, meta);
|
result = get_headers(path, meta);
|
||||||
@ -2209,7 +2208,7 @@ static int s3fs_truncate(const char *path, off_t size) {
|
|||||||
|
|
||||||
fd = fileno(tmpfile());
|
fd = fileno(tmpfile());
|
||||||
if(fd == -1) {
|
if(fd == -1) {
|
||||||
syslog(LOG_ERR, "%d###result=%d", __LINE__, -errno);
|
syslog(LOG_ERR, "error: line %d: %d", __LINE__, -errno);
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3720,7 +3719,7 @@ static void show_help (void) {
|
|||||||
"\n"
|
"\n"
|
||||||
"s3fs Options:\n"
|
"s3fs Options:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" All s3fs options must given in the form where \"opt\" is:\n"
|
" Most s3fs options are given in the form where \"opt\" is:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" <option_name>=<option_value>\n"
|
" <option_name>=<option_value>\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -3756,6 +3755,8 @@ static void show_help (void) {
|
|||||||
" url (default=\"http://s3.amazonaws.com\")\n"
|
" url (default=\"http://s3.amazonaws.com\")\n"
|
||||||
" - sets the url to use to access amazon s3\n"
|
" - sets the url to use to access amazon s3\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" nomultipart - disable multipart uploads\n"
|
||||||
|
"\n"
|
||||||
"FUSE/mount Options:\n"
|
"FUSE/mount Options:\n"
|
||||||
"\n"
|
"\n"
|
||||||
" Most of the generic mount options described in 'man mount' are\n"
|
" Most of the generic mount options described in 'man mount' are\n"
|
||||||
@ -3879,6 +3880,12 @@ static int my_fuse_opt_proc(void *data, const char *arg, int key, struct fuse_ar
|
|||||||
use_cache = strchr(arg, '=') + 1;
|
use_cache = strchr(arg, '=') + 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(strstr(arg, "nomultipart") != 0) {
|
||||||
|
nomultipart = true;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (strstr(arg, "use_rrs=") != 0) {
|
if (strstr(arg, "use_rrs=") != 0) {
|
||||||
use_rrs = strchr(arg, '=') + 1;
|
use_rrs = strchr(arg, '=') + 1;
|
||||||
if (strcmp(use_rrs.c_str(), "1") == 0 ||
|
if (strcmp(use_rrs.c_str(), "1") == 0 ||
|
||||||
|
@ -31,6 +31,7 @@ int retries = 2;
|
|||||||
|
|
||||||
bool debug = 0;
|
bool debug = 0;
|
||||||
bool foreground = 0;
|
bool foreground = 0;
|
||||||
|
bool nomultipart = false;
|
||||||
bool service_validated = false;
|
bool service_validated = false;
|
||||||
static std::string host = "http://s3.amazonaws.com";
|
static std::string host = "http://s3.amazonaws.com";
|
||||||
static std::string service_path = "/";
|
static std::string service_path = "/";
|
||||||
|
Loading…
Reference in New Issue
Block a user