rgw: do not pre-fetch data for HEAD requests

Backport: hammer

Signed-off-by: Guang Yang <yguang@yahoo-inc.com>
This commit is contained in:
Guang Yang 2015-03-03 09:46:52 +00:00
parent b8699a3bce
commit e32da3e7c8
2 changed files with 3 additions and 2 deletions

View File

@ -448,7 +448,8 @@ int RGWGetObj::verify_permission()
{
obj = rgw_obj(s->bucket, s->object);
store->set_atomic(s->obj_ctx, obj);
store->set_prefetch_data(s->obj_ctx, obj);
if (get_data)
store->set_prefetch_data(s->obj_ctx, obj);
if (!verify_object_permission(s, RGW_PERM_READ))
return -EACCES;

View File

@ -157,7 +157,7 @@ public:
ret = 0;
}
virtual bool prefetch_data() { return true; }
virtual bool prefetch_data() { return get_data; }
void set_get_data(bool get_data) {
this->get_data = get_data;