Whamcloud - gitweb
LU-64 Make "lfs getstripe" directory output consistent.
authorPrakash Surya <surya1@llnl.gov>
Mon, 4 Apr 2011 20:45:34 +0000 (13:45 -0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 7 Jun 2011 03:03:26 +0000 (20:03 -0700)
"lfs getstripe" should report the global default for any fields with
a value that means "use the default". This patch introduces the
following functionality:

1. If "lfs getstripe" is called on a directory and finds that striping
   EA is not set, the filesystem's defaults are looked up and printed.
2. If the striping EA is set, but the striping count and/or striping
   size has a value that means "use the default" (count = 0 and/or
   size = 0), the filesystem's default for that specific striping
   attribute is looked up and printed.
3. A new option to "lfs getstripe" is introduced; the "--raw" or
   "-R" option. If this option is specified, the previous two checks
   are skipped. In other words, if the striping EA is not set, 0, 0,
   -1, will be printed for the striping count, size, and offset
   respectively. Also, if the striping EA is set, the values will be
   printed without first converting them into their respective
   defaults.

This patch relies on the /proc filesystem to determine each
filesystem's default striping attributes, and a cache is maintained
which holds the default values for the last filesystem queried.

See Also:
Bugzilla #23802, https://bugzilla.lustre.org/show_bug.cgi?id=23802

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Change-Id: I9bf033f91411d2a6a55c3d4becb971ba20bb3c4b
Reviewed-on: http://review.whamcloud.com/577
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

No differences found