Commit efd647f7 authored by Tao Ma's avatar Tao Ma Committed by Joel Becker

ocfs2_dlmfs: User DLM_* when decoding file open flags.

In commit 0016eedc, we have
changed dlmfs to use stackglue. So when use DLM* when we
decode dlm flags from open level.
Signed-off-by: default avatarTao Ma <tao.ma@oracle.com>
Signed-off-by: default avatarJoel Becker <joel.becker@oracle.com>
parent 9623e5a2
...@@ -112,20 +112,20 @@ MODULE_PARM_DESC(capabilities, DLMFS_CAPABILITIES); ...@@ -112,20 +112,20 @@ MODULE_PARM_DESC(capabilities, DLMFS_CAPABILITIES);
* O_RDONLY -> PRMODE level * O_RDONLY -> PRMODE level
* O_WRONLY -> EXMODE level * O_WRONLY -> EXMODE level
* *
* O_NONBLOCK -> LKM_NOQUEUE * O_NONBLOCK -> NOQUEUE
*/ */
static int dlmfs_decode_open_flags(int open_flags, static int dlmfs_decode_open_flags(int open_flags,
int *level, int *level,
int *flags) int *flags)
{ {
if (open_flags & (O_WRONLY|O_RDWR)) if (open_flags & (O_WRONLY|O_RDWR))
*level = LKM_EXMODE; *level = DLM_LOCK_EX;
else else
*level = LKM_PRMODE; *level = DLM_LOCK_PR;
*flags = 0; *flags = 0;
if (open_flags & O_NONBLOCK) if (open_flags & O_NONBLOCK)
*flags |= LKM_NOQUEUE; *flags |= DLM_LKF_NOQUEUE;
return 0; return 0;
} }
...@@ -166,7 +166,7 @@ static int dlmfs_file_open(struct inode *inode, ...@@ -166,7 +166,7 @@ static int dlmfs_file_open(struct inode *inode,
* to be able userspace to be able to distinguish a * to be able userspace to be able to distinguish a
* valid lock request from one that simply couldn't be * valid lock request from one that simply couldn't be
* granted. */ * granted. */
if (flags & LKM_NOQUEUE && status == -EAGAIN) if (flags & DLM_LKF_NOQUEUE && status == -EAGAIN)
status = -ETXTBSY; status = -ETXTBSY;
kfree(fp); kfree(fp);
goto bail; goto bail;
...@@ -193,7 +193,7 @@ static int dlmfs_file_release(struct inode *inode, ...@@ -193,7 +193,7 @@ static int dlmfs_file_release(struct inode *inode,
status = 0; status = 0;
if (fp) { if (fp) {
level = fp->fp_lock_level; level = fp->fp_lock_level;
if (level != LKM_IVMODE) if (level != DLM_LOCK_IV)
user_dlm_cluster_unlock(&ip->ip_lockres, level); user_dlm_cluster_unlock(&ip->ip_lockres, level);
kfree(fp); kfree(fp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment