diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-07-26 17:38:49 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-07-27 13:36:17 +0200 |
commit | 087498eea02acae08627e310d58ec837a54752d7 (patch) | |
tree | 257ba8e7a78d04d9cf6283b271520724bfa19e1f /fs/ocfs2/file.c | |
parent | 7715da0b24745db15637f9d380f65386e3d9478b (diff) | |
download | lwn-087498eea02acae08627e310d58ec837a54752d7.tar.gz lwn-087498eea02acae08627e310d58ec837a54752d7.zip |
fs: Convert i_alloc_sem to rw_anon_semaphore
i_alloc_sem is used as a completion in direct-io which does not follow
owner rules. preempt-rt needs to keep it as such. So convert it to
rw_anon_semaphore and annotate the semantics hereby.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 62442e413a00..96034230adb6 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1799,7 +1799,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, relock: /* to match setattr's i_mutex -> i_alloc_sem -> rw_lock ordering */ if (direct_io) { - down_read(&inode->i_alloc_sem); + anon_down_read(&inode->i_alloc_sem); have_alloc_sem = 1; } @@ -1826,7 +1826,7 @@ relock: */ if (direct_io && !can_do_direct) { ocfs2_rw_unlock(inode, rw_level); - up_read(&inode->i_alloc_sem); + anon_up_read(&inode->i_alloc_sem); have_alloc_sem = 0; rw_level = -1; @@ -1914,7 +1914,7 @@ out: out_sems: if (have_alloc_sem) - up_read(&inode->i_alloc_sem); + anon_up_read(&inode->i_alloc_sem); mutex_unlock(&inode->i_mutex); @@ -2076,7 +2076,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, * need locks to protect pending reads from racing with truncate. */ if (filp->f_flags & O_DIRECT) { - down_read(&inode->i_alloc_sem); + anon_down_read(&inode->i_alloc_sem); have_alloc_sem = 1; ret = ocfs2_rw_lock(inode, 0); @@ -2120,7 +2120,7 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, bail: if (have_alloc_sem) - up_read(&inode->i_alloc_sem); + anon_up_read(&inode->i_alloc_sem); if (rw_level != -1) ocfs2_rw_unlock(inode, rw_level); mlog_exit(ret); |