Whamcloud - gitweb
LU-1051 osd: improve quota credits calculation
authorNiu Yawei <niu@whamcloud.com>
Thu, 2 Feb 2012 14:32:02 +0000 (06:32 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 14 Feb 2012 02:48:07 +0000 (21:48 -0500)
commit83eeeb72c1081ec85b2b38440730143323e9209e
treea5cbeae097009967f6c317cdeddb2c90d9dab911
parentb18cecc6a17e9b30064ed9b24927d1905729d89b
LU-1051 osd: improve quota credits calculation

Instead of reserving constant LDISKFS_QUOTA_INIT_BLOCKS for all kinds
of transactions, this patch tracks how many/which uid/gids are
affected in each declare function, then calculates the total quota
credits according to the affected uid/gids in osd_trans_start().

This patch also includes following credits improvement:
- For object creation, reserve less credits for the '.' and '..'
  insertion, and don't reserve for file creation;
- Only reserve the credits for oi insertion for normal fids;
- Limit the credits to j_max_transaction_buffers in the
  osd_trans_start();

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ifbcc26b670c4965f22cc96ae7db16154927f32a4
Reviewed-on: http://review.whamcloud.com/2082
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c