From: Niu Yawei Date: Fri, 29 Jun 2012 07:08:02 +0000 (-0400) Subject: LU-1579 osd: reserve credits for set version X-Git-Tag: 2.2.94~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3ea308aac71435e6a4f5e72bb31be91a2e5ad0a5;p=fs%2Flustre-release.git LU-1579 osd: reserve credits for set version In current osd_declare_xattr_set(), we assume that version change is always accompanied with inode changes, so we don't reserve extra credits for the setting verison. However, in the new quota design, we may issue a sole version change without any other updates. I think osd_declare_xattr_set() should not make assumption on the caller's behavior and reserve at least 1 block for version change. Signed-off-by: Niu Yawei Change-Id: I77a13173eea8007b5300155e0d726bd82ace8ede Reviewed-on: http://review.whamcloud.com/3242 Tested-by: Hudson Reviewed-by: Johann Lombardi Reviewed-by: Alex Zhuravlev Tested-by: Maloo Reviewed-by: Mike Pershin --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 3cc6ec3..92ed45a 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2397,22 +2397,20 @@ static int osd_declare_xattr_set(const struct lu_env *env, const struct lu_buf *buf, const char *name, int fl, struct thandle *handle) { - struct osd_thandle *oh; + struct osd_thandle *oh; - LASSERT(handle != NULL); + LASSERT(handle != NULL); - if (strcmp(name, XATTR_NAME_VERSION) == 0) { - /* no credits for version */ - return 0; - } + oh = container_of0(handle, struct osd_thandle, ot_super); + LASSERT(oh->ot_handle == NULL); - oh = container_of0(handle, struct osd_thandle, ot_super); - LASSERT(oh->ot_handle == NULL); - - OSD_DECLARE_OP(oh, xattr_set); - oh->ot_credits += osd_dto_credits_noquota[DTO_XATTR_SET]; + OSD_DECLARE_OP(oh, xattr_set); + if (strcmp(name, XATTR_NAME_VERSION) == 0) + oh->ot_credits += osd_dto_credits_noquota[DTO_ATTR_SET_BASE]; + else + oh->ot_credits += osd_dto_credits_noquota[DTO_XATTR_SET]; - return 0; + return 0; } /*