]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
[backport] rgw: Make RGW_MAX_PUT_SIZE configurable 7441/head
authorYuan Zhou <yuan.zhou@intel.com>
Thu, 9 Jul 2015 08:56:07 +0000 (16:56 +0800)
committerVladislav Odintsov <odivlad@gmail.com>
Thu, 4 Feb 2016 21:33:36 +0000 (00:33 +0300)
The 5GB limit of a single operation uploading was part of S3 spec.
However some private setups may have some special requirements
on this limit. It's more convinent to have a configurable value.

Closes: http://tracker.ceph.com/issues/14569
(cherry picked from commit df97f28)

Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
Signed-off-by: Vladislav Odintsov <odivlad@gmail.com>
Tested-by: Vladislav Odintsov <odivlad@gmail.com>
src/common/config_opts.h
src/rgw/rgw_common.h
src/rgw/rgw_rest.cc

index 155ab84b9deb26977f4037a77fd77648ad7e96fc..fd53899abbb277b2c166102a1c6ef0df284c427d 100644 (file)
@@ -932,6 +932,7 @@ OPTION(nss_db_path, OPT_STR, "") // path to nss db
 
 
 OPTION(rgw_max_chunk_size, OPT_INT, 512 * 1024)
+OPTION(rgw_max_put_size, OPT_U64, 5ULL*1024*1024*1024)
 
 /**
  * override max bucket index shards in zone configuration (if not zero)
index 5b4e39b0113c60d41c5d9d447e1b426e1898c169..d05e3167adb15011c7a54697a355f03380d567f4 100644 (file)
@@ -80,7 +80,6 @@ using ceph::crypto::MD5;
 #define RGW_BUCKETS_OBJ_SUFFIX ".buckets"
 
 #define RGW_MAX_PENDING_CHUNKS  16
-#define RGW_MAX_PUT_SIZE        (5ULL*1024*1024*1024)
 #define RGW_MIN_MULTIPART_SIZE (5ULL*1024*1024)
 
 #define RGW_FORMAT_PLAIN        0
index a444f3f91e814faa60e990e803079ee7c3736ce0..859e34a770b6e09ea4cdb9fce236e669c34daeb2 100644 (file)
@@ -817,7 +817,7 @@ int RGWPutObj_ObjStore::verify_params()
 {
   if (s->length) {
     off_t len = atoll(s->length);
-    if (len > (off_t)RGW_MAX_PUT_SIZE) {
+    if (len > (off_t)(s->cct->_conf->rgw_max_put_size)) {
       return -ERR_TOO_LARGE;
     }
   }
@@ -856,7 +856,7 @@ int RGWPutObj_ObjStore::get_data(bufferlist& bl)
     bl.append(bp, 0, len);
   }
 
-  if ((uint64_t)ofs + len > RGW_MAX_PUT_SIZE) {
+  if ((uint64_t)ofs + len > s->cct->_conf->rgw_max_put_size) {
     return -ERR_TOO_LARGE;
   }
 
@@ -875,7 +875,7 @@ int RGWPostObj_ObjStore::verify_params()
     return -ERR_LENGTH_REQUIRED;
   }
   off_t len = atoll(s->length);
-  if (len > (off_t)RGW_MAX_PUT_SIZE) {
+  if (len > (off_t)(s->cct->_conf->rgw_max_put_size)) {
     return -ERR_TOO_LARGE;
   }