diff options
author | Mark Fasheh <mark.fasheh@oracle.com> | 2007-04-17 02:28:51 +0200 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-04-27 00:07:45 +0200 |
commit | 7cdfc3a1c3971c9125c317cb8c2525745851798e (patch) | |
tree | ac0103cba9eaf0bc07b2e63893fa4e9637e6934e /fs/ocfs2/aops.c | |
parent | ocfs2: Fix up i_blocks calculation to know about holes (diff) | |
download | linux-7cdfc3a1c3971c9125c317cb8c2525745851798e.tar.xz linux-7cdfc3a1c3971c9125c317cb8c2525745851798e.zip |
ocfs2: Remember rw lock level during direct io
Cluster locking might have been redone because a direct write won't
complete, so this needs to be reflected in the iocb.
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index b74971e19d54..56963e6c46c0 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -522,12 +522,17 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, void *private) { struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; + int level; /* this io's submitter should not have unlocked this before we could */ BUG_ON(!ocfs2_iocb_is_rw_locked(iocb)); + ocfs2_iocb_clear_rw_locked(iocb); - up_read(&inode->i_alloc_sem); - ocfs2_rw_unlock(inode, 0); + + level = ocfs2_iocb_rw_locked_level(iocb); + if (!level) + up_read(&inode->i_alloc_sem); + ocfs2_rw_unlock(inode, level); } /* |