Whamcloud - gitweb
LU-1842 quota: helper routines to manage FID_SEQ_QUOTA_GLB
authorJohann Lombardi <johann@whamcloud.com>
Tue, 11 Sep 2012 11:19:04 +0000 (13:19 +0200)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Sep 2012 12:58:41 +0000 (08:58 -0400)
commit1673c7bdf58234db8963cd292b0a8e02d016ac9e
tree0a76bcdac8f211a0457c038d255e0ff3a83c470f
parent05456d7f5ee091a75766238d2a6489fa66b406a9
LU-1842 quota: helper routines to manage FID_SEQ_QUOTA_GLB

The FID_SEQ_QUOTA_GLB sequence is used to produce FID for global
quota indexes. The 32-bit object ID is thus divided into 3 fields
containing:
- 16-bit pool identifier (aka pool_id)
- 8-bit quota type (aka LQUOTA_TYPE_{USR,GRP})
- 8-bit resource type (LQUOTA_RES_{MD,DT} for resp. inodes & blocks)

This static FID scheme allows slaves to enqueue global quota lock
directly on the right FID without requiring a first readdir or to
change the resource ID on the fly when the lock is granted.

This patch adds the helper routines to manipulate global index FIDs.

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Change-Id: I145c1468db7fe0d2a0f198ac323b00913a815c3c
Reviewed-on: http://review.whamcloud.com/3937
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/lustre/lustre_idl.h
lustre/ptlrpc/wiretest.c
lustre/quota/lquota_internal.h
lustre/quota/lquota_lib.c
lustre/utils/wirecheck.c
lustre/utils/wiretest.c