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 <niu@whamcloud.com>
Change-Id: I77a13173eea8007b5300155e0d726bd82ace8ede
Reviewed-on: http://review.whamcloud.com/3242
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
const struct lu_buf *buf, const char *name,
int fl, struct thandle *handle)
{
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];