Skip to content

Commit

Permalink
ocfs2_dlmfs: User DLM_* when decoding file open flags.
Browse files Browse the repository at this point in the history
In commit 0016eed, we have
changed dlmfs to use stackglue. So when use DLM* when we
decode dlm flags from open level.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Tao Ma authored and Joel Becker committed Mar 30, 2010
1 parent 9623e5a commit efd647f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fs/ocfs2/dlmfs/dlmfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,20 @@ MODULE_PARM_DESC(capabilities, DLMFS_CAPABILITIES);
* O_RDONLY -> PRMODE level
* O_WRONLY -> EXMODE level
*
* O_NONBLOCK -> LKM_NOQUEUE
* O_NONBLOCK -> NOQUEUE
*/
static int dlmfs_decode_open_flags(int open_flags,
int *level,
int *flags)
{
if (open_flags & (O_WRONLY|O_RDWR))
*level = LKM_EXMODE;
*level = DLM_LOCK_EX;
else
*level = LKM_PRMODE;
*level = DLM_LOCK_PR;

*flags = 0;
if (open_flags & O_NONBLOCK)
*flags |= LKM_NOQUEUE;
*flags |= DLM_LKF_NOQUEUE;

return 0;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ static int dlmfs_file_open(struct inode *inode,
* to be able userspace to be able to distinguish a
* valid lock request from one that simply couldn't be
* granted. */
if (flags & LKM_NOQUEUE && status == -EAGAIN)
if (flags & DLM_LKF_NOQUEUE && status == -EAGAIN)
status = -ETXTBSY;
kfree(fp);
goto bail;
Expand All @@ -193,7 +193,7 @@ static int dlmfs_file_release(struct inode *inode,
status = 0;
if (fp) {
level = fp->fp_lock_level;
if (level != LKM_IVMODE)
if (level != DLM_LOCK_IV)
user_dlm_cluster_unlock(&ip->ip_lockres, level);

kfree(fp);
Expand Down

0 comments on commit efd647f

Please sign in to comment.