]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Make RGW_MAX_PUT_SIZE configurable 5183/head
authorYuan Zhou <yuan.zhou@intel.com>
Thu, 9 Jul 2015 08:56:07 +0000 (16:56 +0800)
committerYuan Zhou <yuan.zhou@intel.com>
Sat, 11 Jul 2015 05:38:15 +0000 (13:38 +0800)
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.

Fixes: #6999
Signed-off-by: Yuan Zhou <yuan.zhou@intel.com>
src/common/config_opts.h
src/rgw/rgw_common.h
src/rgw/rgw_rest.cc

index 1ea85a649662acb8d6c446d1a018ce141d99788d..7280310a7ce41f1c427ea51fc7fbc5472b6dd347 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 bef7fa89c9932b30c7e2a16b9d9a95983a577689..a32d363797c36c55374e127591195d27115e23f3 100644 (file)
@@ -83,7 +83,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 903f44140d9b42611bed9267e1ba5a9f11eb970c..a03e31fabf2ec243a600d7222b1ec04b8f6503e3 100644 (file)
@@ -816,7 +816,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;
     }
   }
@@ -855,7 +855,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;
   }
 
@@ -874,7 +874,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;
   }