Whamcloud - gitweb
EX-2455 pcc: get PCC state for a file without opening itself
authorQian Yingjin <qian@ddn.com>
Thu, 25 Feb 2021 12:43:58 +0000 (20:43 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 26 Mar 2021 18:02:09 +0000 (18:02 +0000)
commit1276a8f6dac736a63244f7e943cbc6951e518b2d
tree45cec98aafa259492317c62ee7ccefab27788336
parentc88de7605764cb362e0706f6dbbc3ae21354538a
EX-2455 pcc: get PCC state for a file without opening itself

Originally to get PCC state for a given file, the user needs to
open the file and then get the current PCC state of the file via
the file handle. After that, close the file.

If the file is met the predefined condition of auto prefetching
into PCC at the open time, "lfs pcc state" command on the file
will attach the file into PCC cache. This may be not the intention
of the user.

In this patch, we rework the "lfs pcc state" command. It always
open the parent directory, and then do the lookup by name/FID
without open the file itself to get the PCC state.

Test-Parameters: clientcount=3 testlist=sanity-pcc,sanity-pcc,sanity-pcc
Signed-off-by: Qian Yingjin <qian@ddn.com>
Change-Id: I310a7e73dc6c0f4318dc27df2e02ecf6559ee5b4
Reviewed-on: https://review.whamcloud.com/41927
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/pcc.c
lustre/tests/sanity-pcc.sh
lustre/utils/liblustreapi.c
lustre/utils/liblustreapi_pcc.c
lustre/utils/lustreapi_internal.h