Whamcloud - gitweb
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>