Whamcloud - gitweb
LU-10934 llite: integrate statx() API with Lustre
System call statx() interface can specify a bitmask to fetch
specific attributes from a file (e.g. st_uid, st_gid, st_mode, and
st_btime = file creation time), rather than fetching all of the
normal stat() attributes (such as st_size and st_blocks). It also
has a AT_STATX_DONT_SYNC mode which allows the kernel to return
cached attributes without flushing all of the client data and
fetching an accurate result from the server.
The conditions for adding statx() API for Lustre are mature:
1. statx() is added to Linux 4.11+;
2. glibc supports statx() (glibc 2.28+ -> RHEL 8, Ubuntun 18.10+)
3. The support for stat(1) and ls(1) to use statx(3) to fetch
only the required attributes has landed to the upstream GNU
coreutils package.
This patch integrates statx() API with Lustre so that we can take
advantage of the efficiencies available:
- Only fetch MDS attributes if STATX_SIZE, STATX_BLOCKS and
STATX_MTIME are not requested, and avoid OSS glimpse RPCs
completely;
- Hook this into statahead to avoid async glimpse locks (AGL) if
OST information not needed;
- Enhance the MDS RPC interface to return the file creation time
stored in both ldiskfs and ZFS already, and enable STATX_BTIME;
- Better support with AT_STATX_DONT_SYNC mode. Return the "lazy"
attributes or cached attributes (even stale) on a client if
available without any RPCs to servers (MDS and OSS).
- statx (lustre/test/statx): port coreutils ls/stat by using
statx(3) system call if OS supported it.
- Test scripts. Using statx() to verify btime attribute and the
advantage described above.
Test-Parameters: clientdistro=el8
Test-Parameters: clientdistro=ubuntu1804
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I8432c9029bad9dea3e1ebc13a0d6978131d9b929
Reviewed-on: https://review.whamcloud.com/36674
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
21 files changed: