From: deshmukh Date: Thu, 27 Nov 2008 06:33:27 +0000 (+0000) Subject: Added quota support code in index insert of iop mode X-Git-Tag: v1_9_120~57 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=433f1155146c4a8da67d7a477bff50440366d62c Added quota support code in index insert of iop mode b=17818 i=fanyong i=pravin --- diff --git a/lustre/osd/osd_handler.c b/lustre/osd/osd_handler.c index 2652d7e..bd5bb5b 100644 --- a/lustre/osd/osd_handler.c +++ b/lustre/osd/osd_handler.c @@ -2757,7 +2757,9 @@ static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt, const struct lu_fid_pack *pack = (const struct lu_fid_pack *)rec; const char *name = (const char *)key; struct osd_object *child; - +#ifdef HAVE_QUOTA_SUPPORT + cfs_cap_t save = current->cap_effective; +#endif int rc; ENTRY; @@ -2774,7 +2776,17 @@ static int osd_index_ea_insert(const struct lu_env *env, struct dt_object *dt, RETURN(rc); child = osd_object_find(env, dt, fid); if (!IS_ERR(child)) { +#ifdef HAVE_QUOTA_SUPPORT + if (ignore_quota) + current->cap_effective |= CFS_CAP_SYS_RESOURCE_MASK; + else + current->cap_effective &= ~CFS_CAP_SYS_RESOURCE_MASK; +#endif rc = osd_ea_add_rec(env, obj, child, name, th); + +#ifdef HAVE_QUOTA_SUPPORT + current->cap_effective = save; +#endif osd_object_put(env, child); } else { rc = PTR_ERR(child);