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)
commit93339415b8d74c0a2c74ee053aed23540b89bccb
tree989d6c5ab9d9a22929d841bfca988eea3e7a7c89
parentd8506f4b3a03b5605fc927409ce16f55ad5bffd5
LU-64 Make "lfs getstripe" directory output consistent.

"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>
lustre/doc/lfs.1
lustre/include/lustre/liblustreapi.h
lustre/tests/sanity.sh
lustre/utils/lfs.c
lustre/utils/liblustreapi.c