Whamcloud - gitweb
LU-2182 llapi: implementation of new llapi_layout API 02/5302/37
authorNed Bass <bass6@llnl.gov>
Mon, 7 Jul 2014 21:51:37 +0000 (17:51 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 25 Aug 2014 16:57:02 +0000 (16:57 +0000)
commit3d3a37c9c8daefb18fe7b9c2e83d8d2ef2cdf98b
tree465b6c14fa4635bac2867c30379f7979af99b767
parent3a83b4b93373db46a4ee60a7388775fa0be2eb9a
LU-2182 llapi: implementation of new llapi_layout API

Add a new set of llapi routines for interacting with file layouts that
hide the details of the wire-protocol data structures from the user.
Define an opaque struct llapi_layout to abstract the layout of a
lustre file and generic accessor functions to read and write it.  The
following documented functions are added the liblustreapi public
interface with accompanying man pages:

  llapi_layout_alloc - allocate a new layout
  llapi_layout_free - free memory allocated for a layout
  llapi_layout_file_create - create new file with given layout
  llapi_layout_file_open - open or create a file with given layout
  llapi_layout_get_by_path - get file layout given a path
  llapi_layout_get_by_fd - get file layout given a file descriptor
  llapi_layout_get_by_fid - get file layout given a Lustre FID
  llapi_layout_ost_index_get - get OST index associated with a stripe
  llapi_layout_ost_index_set - set OST index associated with a stripe
  llapi_layout_pattern_get - get RAID pattern of a layout
  llapi_layout_pattern_set - set RAID pattern of a layout
  llapi_layout_pool_name_get - get pool name of a layout
  llapi_layout_pool_name_set - set pool name of a layout
  llapi_layout_stripe_count_get - get stripe count of a layout
  llapi_layout_stripe_count_set - set stripe count of a layout
  llapi_layout_stripe_size_get - get stripe size of a layout
  llapi_layout_stripe_size_set - set stripe size of a layout

The layouts are read and written using fgetxattr() and fsetxattr()
instead of ioctl() to make it easier for architectures like Blue Gene
to function-ship the system calls.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I35fb51055b6438ef3090f43c28a4083a66eaa907
Reviewed-on: http://review.whamcloud.com/5302
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
33 files changed:
lustre/doc/Makefile.am
lustre/doc/llapi_layout.7 [new file with mode: 0644]
lustre/doc/llapi_layout_alloc.3 [new file with mode: 0644]
lustre/doc/llapi_layout_file_create.3 [new file with mode: 0644]
lustre/doc/llapi_layout_file_open.3 [new file with mode: 0644]
lustre/doc/llapi_layout_free.3 [new file with mode: 0644]
lustre/doc/llapi_layout_get_by_fd.3 [new file with mode: 0644]
lustre/doc/llapi_layout_get_by_fid.3 [new file with mode: 0644]
lustre/doc/llapi_layout_get_by_path.3 [new file with mode: 0644]
lustre/doc/llapi_layout_ost_index_get.3 [new file with mode: 0644]
lustre/doc/llapi_layout_ost_index_set.3 [new file with mode: 0644]
lustre/doc/llapi_layout_pattern_get.3 [new file with mode: 0644]
lustre/doc/llapi_layout_pattern_set.3 [new file with mode: 0644]
lustre/doc/llapi_layout_pool_name_get.3 [new file with mode: 0644]
lustre/doc/llapi_layout_pool_name_set.3 [new file with mode: 0644]
lustre/doc/llapi_layout_stripe_count_get.3 [new file with mode: 0644]
lustre/doc/llapi_layout_stripe_count_set.3 [new file with mode: 0644]
lustre/doc/llapi_layout_stripe_size_get.3 [new file with mode: 0644]
lustre/doc/llapi_layout_stripe_size_set.3 [new file with mode: 0644]
lustre/doc/llapi_path2fid.3 [new file with mode: 0644]
lustre/doc/lustreapi.7
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustreapi.h
lustre/tests/.gitignore
lustre/tests/Makefile.am
lustre/tests/llapi_layout_test.c [new file with mode: 0644]
lustre/tests/sanity.sh
lustre/tests/test-framework.sh
lustre/utils/LCOPYING
lustre/utils/Makefile.am
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_layout.c [new file with mode: 0644]
lustre/utils/lustreapi_internal.h