Whamcloud - gitweb
LU-2919 hsm: Implementation of exclusive open 30/6730/18
authorJinshan Xiong <jinshan.xiong@intel.com>
Fri, 12 Jul 2013 20:07:11 +0000 (13:07 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 22 Jul 2013 22:26:03 +0000 (22:26 +0000)
commit06e652ce88cf485135df249b29ca8d0afdc9af64
treee15bd77a7227a45e190dcfb4c3288f4f632e09a6
parent18dd47a03fe565914320f19a3bd3a9299bf9f917
LU-2919 hsm: Implementation of exclusive open

In this patch, a framework of lease is implemented. However,
only exclusive lease is supported right now.

To apply a lease, MDS_OPEN_LEASE must be set to open the file, EX
mode open lock is returned to the client side to hold a lease. From
that time on, if this file is opened again by other processes, the
open lock will be revoked so the client who holds the lease will
know the lease is already broken by checking that open lock.

To release a lease, normal close is used. The client will revoke the
open lock before sending CLOSE request.

Lease can be applied in two ways. ll_lease_open()/close() can be
called directly if the lease holder is in kernel space; or if the
lease holder lives in user space, it has to open the file first and
then use ioctl() with command LL_IOC_SET_LEASE to apply a lease. The
lease holder has to poll the lease status itself.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I181edbb0b31fcf60858656170528d2ffda9c9bb6
Reviewed-on: http://review.whamcloud.com/6730
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
19 files changed:
contrib/bit-masks/lustre_dlm_flags.def
lustre/include/liblustre.h
lustre/include/linux/lustre_intent.h
lustre/include/lustre/lustre_idl.h
lustre/include/lustre/lustre_user.h
lustre/include/lustre_dlm_flags.h
lustre/include/lustre_lib.h
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_request.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_lib.c
lustre/mdc/mdc_locks.c
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_open.c
lustre/tests/multiop.c
lustre/tests/sanity.sh