Whamcloud - gitweb
LU-10357 hsm: open file to be archived before starting 56/30456/2
authorJohn L. Hammond <john.hammond@intel.com>
Fri, 8 Dec 2017 19:59:43 +0000 (13:59 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Jan 2018 02:49:24 +0000 (02:49 +0000)
commit77cd1a21e312ca00b37b33689091734a12eec048
tree82dc3069811dd743f77b145da18b2e3018d9d4e5
parentc73736545fafac4373569187e064aab9cd435320
LU-10357 hsm: open file to be archived before starting

In the archive case of llapi_hsm_action_begin(), open the file to be
archived before calling the LL_IOC_HSM_COPY_START ioctl. Store the
open FD in struct hsm_copyaction_private, return a dup of it
llapi_hsm_action_get_fd(), and close it in
llapi_hsm_action_end(). Calling open() first avoids 3 extra RPCs
(MDS_GETATTR, LDLM_ENQUEUE for layout to get data version,
LDLM_ENQUEUE for fstat()) when archiving.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Idea0a7f4cb63bd9d712ff2ce9fcb59a3b278d0f2
Reviewed-on: https://review.whamcloud.com/30456
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Quentin Bouget <quentin.bouget@cea.fr>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/liblustreapi_hsm.c