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.3.51~159 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=e9bcde336651284ced67c1f2de8c51c3023d64c2 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 d0a162a..54e631e 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; } /*