Whamcloud - gitweb
LU-1264 quota: reserve FID sequences for quota
authorJohann Lombardi <johann@whamcloud.com>
Wed, 28 Mar 2012 09:41:41 +0000 (11:41 +0200)
committerOleg Drokin <green@whamcloud.com>
Mon, 7 May 2012 19:39:29 +0000 (15:39 -0400)
commit6c8adea75d36f0999f3d54cca51d43aed47cabb5
tree70f196bba32fe6f0ca3d339fa0dc114cae473a41
parent33a16800adc286866c37e260f61c19342b350315
LU-1264 quota: reserve FID sequences for quota

This patch reserves 2 FID sequences for quota.

Slave indexes will be allocated an unique FID from the FID_SEQ_QUOTA
sequence.

As for FID_SEQ_QUOTA_GLB, it will be used to uniquely identify the
global quota indexes. For the global index, the sequence will thus be
set to FID_SEQ_QUOTA_GLB and the 32-bit object ID divided into 3
fields:
- 16-bit pool identifier
- 8-bit quota type (user or group quota)
- 8-bit target type (data or metadata)

Thanks to this static FID scheme, slave can 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.
As for the slave index FID, it is allocated dynamically from
FID_SEQ_QUOTA and is returned to the slave in the quota LVB when the
global quota lock is granted.

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