summaryrefslogtreecommitdiffstats
path: root/fs/ceph/super.h
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2014-03-09 23:16:40 +0800
committerSage Weil <sage@inktank.com>2014-04-04 21:07:11 -0700
commiteb13e832f823f6c110ea53e3067bafe22b87de63 (patch)
treee7e06eaf5ded86bb0d64b363b1c98c5909cf4847 /fs/ceph/super.h
parenteb70c0ce4e877c6854c682c0fc009d7875994942 (diff)
downloadop-kernel-dev-eb13e832f823f6c110ea53e3067bafe22b87de63.zip
op-kernel-dev-eb13e832f823f6c110ea53e3067bafe22b87de63.tar.gz
ceph: use fl->fl_file as owner identifier of flock and posix lock
flock and posix lock should use fl->fl_file instead of process ID as owner identifier. (posix lock uses fl->fl_owner. fl->fl_owner is usually equal to fl->fl_file, but it also can be a customized value). The process ID of who holds the lock is just for F_GETLK fcntl(2). The fix is rename the 'pid' fields of struct ceph_mds_request_args and struct ceph_filelock to 'owner', rename 'pid_namespace' fields to 'pid'. Assign fl->fl_file to the 'owner' field of lock messages. We also set the most significant bit of the 'owner' field. MDS can use that bit to distinguish between old and new clients. The MDS counterpart of this patch modifies the flock code to not take the 'pid_namespace' into consideration when checking conflict locks. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r--fs/ceph/super.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 70bb183..7866cd0 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -871,6 +871,7 @@ extern long ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
extern const struct export_operations ceph_export_ops;
/* locks.c */
+extern __init void ceph_flock_init(void);
extern int ceph_lock(struct file *file, int cmd, struct file_lock *fl);
extern int ceph_flock(struct file *file, int cmd, struct file_lock *fl);
extern void ceph_count_locks(struct inode *inode, int *p_num, int *f_num);
OpenPOWER on IntegriCloud