diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/write.c | 2 | ||||
-rw-r--r-- | fs/buffer.c | 4 | ||||
-rw-r--r-- | fs/cifs/file.c | 2 | ||||
-rw-r--r-- | fs/jbd/commit.c | 6 | ||||
-rw-r--r-- | fs/jbd2/commit.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfsroot.c | 2 | ||||
-rw-r--r-- | fs/ntfs/aops.c | 2 | ||||
-rw-r--r-- | fs/ntfs/compress.c | 2 | ||||
-rw-r--r-- | fs/ntfs/mft.c | 4 | ||||
-rw-r--r-- | fs/omfs/inode.c | 3 | ||||
-rw-r--r-- | fs/proc/base.c | 11 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/journal.c | 6 | ||||
-rw-r--r-- | fs/splice.c | 2 | ||||
-rw-r--r-- | fs/ufs/super.c | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 6 |
16 files changed, 31 insertions, 27 deletions
diff --git a/fs/afs/write.c b/fs/afs/write.c index 9a849ad3c48..065b4e10681 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c | |||
@@ -404,7 +404,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb, | |||
404 | page = pages[loop]; | 404 | page = pages[loop]; |
405 | if (page->index > wb->last) | 405 | if (page->index > wb->last) |
406 | break; | 406 | break; |
407 | if (TestSetPageLocked(page)) | 407 | if (!trylock_page(page)) |
408 | break; | 408 | break; |
409 | if (!PageDirty(page) || | 409 | if (!PageDirty(page) || |
410 | page_private(page) != (unsigned long) wb) { | 410 | page_private(page) != (unsigned long) wb) { |
diff --git a/fs/buffer.c b/fs/buffer.c index 4dbe52948e8..38653e36e22 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -1720,7 +1720,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page, | |||
1720 | */ | 1720 | */ |
1721 | if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { | 1721 | if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { |
1722 | lock_buffer(bh); | 1722 | lock_buffer(bh); |
1723 | } else if (test_set_buffer_locked(bh)) { | 1723 | } else if (!trylock_buffer(bh)) { |
1724 | redirty_page_for_writepage(wbc, page); | 1724 | redirty_page_for_writepage(wbc, page); |
1725 | continue; | 1725 | continue; |
1726 | } | 1726 | } |
@@ -3000,7 +3000,7 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[]) | |||
3000 | 3000 | ||
3001 | if (rw == SWRITE || rw == SWRITE_SYNC) | 3001 | if (rw == SWRITE || rw == SWRITE_SYNC) |
3002 | lock_buffer(bh); | 3002 | lock_buffer(bh); |
3003 | else if (test_set_buffer_locked(bh)) | 3003 | else if (!trylock_buffer(bh)) |
3004 | continue; | 3004 | continue; |
3005 | 3005 | ||
3006 | if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC) { | 3006 | if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC) { |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 0aac824371a..e692c42f24b 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -1280,7 +1280,7 @@ retry: | |||
1280 | 1280 | ||
1281 | if (first < 0) | 1281 | if (first < 0) |
1282 | lock_page(page); | 1282 | lock_page(page); |
1283 | else if (TestSetPageLocked(page)) | 1283 | else if (!trylock_page(page)) |
1284 | break; | 1284 | break; |
1285 | 1285 | ||
1286 | if (unlikely(page->mapping != mapping)) { | 1286 | if (unlikely(page->mapping != mapping)) { |
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c index 2eccbfaa1d4..ae08c057e75 100644 --- a/fs/jbd/commit.c +++ b/fs/jbd/commit.c | |||
@@ -63,7 +63,7 @@ static void release_buffer_page(struct buffer_head *bh) | |||
63 | goto nope; | 63 | goto nope; |
64 | 64 | ||
65 | /* OK, it's a truncated page */ | 65 | /* OK, it's a truncated page */ |
66 | if (TestSetPageLocked(page)) | 66 | if (!trylock_page(page)) |
67 | goto nope; | 67 | goto nope; |
68 | 68 | ||
69 | page_cache_get(page); | 69 | page_cache_get(page); |
@@ -221,7 +221,7 @@ write_out_data: | |||
221 | * blocking lock_buffer(). | 221 | * blocking lock_buffer(). |
222 | */ | 222 | */ |
223 | if (buffer_dirty(bh)) { | 223 | if (buffer_dirty(bh)) { |
224 | if (test_set_buffer_locked(bh)) { | 224 | if (!trylock_buffer(bh)) { |
225 | BUFFER_TRACE(bh, "needs blocking lock"); | 225 | BUFFER_TRACE(bh, "needs blocking lock"); |
226 | spin_unlock(&journal->j_list_lock); | 226 | spin_unlock(&journal->j_list_lock); |
227 | /* Write out all data to prevent deadlocks */ | 227 | /* Write out all data to prevent deadlocks */ |
@@ -446,7 +446,7 @@ void journal_commit_transaction(journal_t *journal) | |||
446 | spin_lock(&journal->j_list_lock); | 446 | spin_lock(&journal->j_list_lock); |
447 | } | 447 | } |
448 | if (unlikely(!buffer_uptodate(bh))) { | 448 | if (unlikely(!buffer_uptodate(bh))) { |
449 | if (TestSetPageLocked(bh->b_page)) { | 449 | if (!trylock_page(bh->b_page)) { |
450 | spin_unlock(&journal->j_list_lock); | 450 | spin_unlock(&journal->j_list_lock); |
451 | lock_page(bh->b_page); | 451 | lock_page(bh->b_page); |
452 | spin_lock(&journal->j_list_lock); | 452 | spin_lock(&journal->j_list_lock); |
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index adf0395f318..f2ad061e95e 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -67,7 +67,7 @@ static void release_buffer_page(struct buffer_head *bh) | |||
67 | goto nope; | 67 | goto nope; |
68 | 68 | ||
69 | /* OK, it's a truncated page */ | 69 | /* OK, it's a truncated page */ |
70 | if (TestSetPageLocked(page)) | 70 | if (!trylock_page(page)) |
71 | goto nope; | 71 | goto nope; |
72 | 72 | ||
73 | page_cache_get(page); | 73 | page_cache_get(page); |
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index 8478fc25dae..46763d1cd39 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c | |||
@@ -127,7 +127,7 @@ enum { | |||
127 | Opt_err | 127 | Opt_err |
128 | }; | 128 | }; |
129 | 129 | ||
130 | static match_table_t __initconst tokens = { | 130 | static match_table_t __initdata tokens = { |
131 | {Opt_port, "port=%u"}, | 131 | {Opt_port, "port=%u"}, |
132 | {Opt_rsize, "rsize=%u"}, | 132 | {Opt_rsize, "rsize=%u"}, |
133 | {Opt_wsize, "wsize=%u"}, | 133 | {Opt_wsize, "wsize=%u"}, |
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 00e9ccde8e4..b38f944f066 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -1194,7 +1194,7 @@ lock_retry_remap: | |||
1194 | tbh = bhs[i]; | 1194 | tbh = bhs[i]; |
1195 | if (!tbh) | 1195 | if (!tbh) |
1196 | continue; | 1196 | continue; |
1197 | if (unlikely(test_set_buffer_locked(tbh))) | 1197 | if (!trylock_buffer(tbh)) |
1198 | BUG(); | 1198 | BUG(); |
1199 | /* The buffer dirty state is now irrelevant, just clean it. */ | 1199 | /* The buffer dirty state is now irrelevant, just clean it. */ |
1200 | clear_buffer_dirty(tbh); | 1200 | clear_buffer_dirty(tbh); |
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index 33ff314cc50..9669541d011 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c | |||
@@ -665,7 +665,7 @@ lock_retry_remap: | |||
665 | for (i = 0; i < nr_bhs; i++) { | 665 | for (i = 0; i < nr_bhs; i++) { |
666 | struct buffer_head *tbh = bhs[i]; | 666 | struct buffer_head *tbh = bhs[i]; |
667 | 667 | ||
668 | if (unlikely(test_set_buffer_locked(tbh))) | 668 | if (!trylock_buffer(tbh)) |
669 | continue; | 669 | continue; |
670 | if (unlikely(buffer_uptodate(tbh))) { | 670 | if (unlikely(buffer_uptodate(tbh))) { |
671 | unlock_buffer(tbh); | 671 | unlock_buffer(tbh); |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 790defb847e..17d32ca6bc3 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
@@ -586,7 +586,7 @@ int ntfs_sync_mft_mirror(ntfs_volume *vol, const unsigned long mft_no, | |||
586 | for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { | 586 | for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { |
587 | struct buffer_head *tbh = bhs[i_bhs]; | 587 | struct buffer_head *tbh = bhs[i_bhs]; |
588 | 588 | ||
589 | if (unlikely(test_set_buffer_locked(tbh))) | 589 | if (!trylock_buffer(tbh)) |
590 | BUG(); | 590 | BUG(); |
591 | BUG_ON(!buffer_uptodate(tbh)); | 591 | BUG_ON(!buffer_uptodate(tbh)); |
592 | clear_buffer_dirty(tbh); | 592 | clear_buffer_dirty(tbh); |
@@ -779,7 +779,7 @@ int write_mft_record_nolock(ntfs_inode *ni, MFT_RECORD *m, int sync) | |||
779 | for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { | 779 | for (i_bhs = 0; i_bhs < nr_bhs; i_bhs++) { |
780 | struct buffer_head *tbh = bhs[i_bhs]; | 780 | struct buffer_head *tbh = bhs[i_bhs]; |
781 | 781 | ||
782 | if (unlikely(test_set_buffer_locked(tbh))) | 782 | if (!trylock_buffer(tbh)) |
783 | BUG(); | 783 | BUG(); |
784 | BUG_ON(!buffer_uptodate(tbh)); | 784 | BUG_ON(!buffer_uptodate(tbh)); |
785 | clear_buffer_dirty(tbh); | 785 | clear_buffer_dirty(tbh); |
diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index d865f553543..a95fe5984f4 100644 --- a/fs/omfs/inode.c +++ b/fs/omfs/inode.c | |||
@@ -492,7 +492,8 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent) | |||
492 | if (sbi->s_num_blocks != be64_to_cpu(omfs_rb->r_num_blocks)) { | 492 | if (sbi->s_num_blocks != be64_to_cpu(omfs_rb->r_num_blocks)) { |
493 | printk(KERN_ERR "omfs: block count discrepancy between " | 493 | printk(KERN_ERR "omfs: block count discrepancy between " |
494 | "super and root blocks (%llx, %llx)\n", | 494 | "super and root blocks (%llx, %llx)\n", |
495 | sbi->s_num_blocks, be64_to_cpu(omfs_rb->r_num_blocks)); | 495 | (unsigned long long)sbi->s_num_blocks, |
496 | (unsigned long long)be64_to_cpu(omfs_rb->r_num_blocks)); | ||
496 | goto out_brelse_bh2; | 497 | goto out_brelse_bh2; |
497 | } | 498 | } |
498 | 499 | ||
diff --git a/fs/proc/base.c b/fs/proc/base.c index 01ed610f9b8..a28840b11b8 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2423,10 +2423,13 @@ static int do_io_accounting(struct task_struct *task, char *buffer, int whole) | |||
2423 | "read_bytes: %llu\n" | 2423 | "read_bytes: %llu\n" |
2424 | "write_bytes: %llu\n" | 2424 | "write_bytes: %llu\n" |
2425 | "cancelled_write_bytes: %llu\n", | 2425 | "cancelled_write_bytes: %llu\n", |
2426 | acct.rchar, acct.wchar, | 2426 | (unsigned long long)acct.rchar, |
2427 | acct.syscr, acct.syscw, | 2427 | (unsigned long long)acct.wchar, |
2428 | acct.read_bytes, acct.write_bytes, | 2428 | (unsigned long long)acct.syscr, |
2429 | acct.cancelled_write_bytes); | 2429 | (unsigned long long)acct.syscw, |
2430 | (unsigned long long)acct.read_bytes, | ||
2431 | (unsigned long long)acct.write_bytes, | ||
2432 | (unsigned long long)acct.cancelled_write_bytes); | ||
2430 | } | 2433 | } |
2431 | 2434 | ||
2432 | static int proc_tid_io_accounting(struct task_struct *task, char *buffer) | 2435 | static int proc_tid_io_accounting(struct task_struct *task, char *buffer) |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 192269698a8..5699171212a 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -2435,7 +2435,7 @@ static int reiserfs_write_full_page(struct page *page, | |||
2435 | if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { | 2435 | if (wbc->sync_mode != WB_SYNC_NONE || !wbc->nonblocking) { |
2436 | lock_buffer(bh); | 2436 | lock_buffer(bh); |
2437 | } else { | 2437 | } else { |
2438 | if (test_set_buffer_locked(bh)) { | 2438 | if (!trylock_buffer(bh)) { |
2439 | redirty_page_for_writepage(wbc, page); | 2439 | redirty_page_for_writepage(wbc, page); |
2440 | continue; | 2440 | continue; |
2441 | } | 2441 | } |
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index c8f60ee183b..c21df71943a 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -627,7 +627,7 @@ static int journal_list_still_alive(struct super_block *s, | |||
627 | static void release_buffer_page(struct buffer_head *bh) | 627 | static void release_buffer_page(struct buffer_head *bh) |
628 | { | 628 | { |
629 | struct page *page = bh->b_page; | 629 | struct page *page = bh->b_page; |
630 | if (!page->mapping && !TestSetPageLocked(page)) { | 630 | if (!page->mapping && trylock_page(page)) { |
631 | page_cache_get(page); | 631 | page_cache_get(page); |
632 | put_bh(bh); | 632 | put_bh(bh); |
633 | if (!page->mapping) | 633 | if (!page->mapping) |
@@ -855,7 +855,7 @@ static int write_ordered_buffers(spinlock_t * lock, | |||
855 | jh = JH_ENTRY(list->next); | 855 | jh = JH_ENTRY(list->next); |
856 | bh = jh->bh; | 856 | bh = jh->bh; |
857 | get_bh(bh); | 857 | get_bh(bh); |
858 | if (test_set_buffer_locked(bh)) { | 858 | if (!trylock_buffer(bh)) { |
859 | if (!buffer_dirty(bh)) { | 859 | if (!buffer_dirty(bh)) { |
860 | list_move(&jh->list, &tmp); | 860 | list_move(&jh->list, &tmp); |
861 | goto loop_next; | 861 | goto loop_next; |
@@ -3871,7 +3871,7 @@ int reiserfs_prepare_for_journal(struct super_block *p_s_sb, | |||
3871 | { | 3871 | { |
3872 | PROC_INFO_INC(p_s_sb, journal.prepare); | 3872 | PROC_INFO_INC(p_s_sb, journal.prepare); |
3873 | 3873 | ||
3874 | if (test_set_buffer_locked(bh)) { | 3874 | if (!trylock_buffer(bh)) { |
3875 | if (!wait) | 3875 | if (!wait) |
3876 | return 0; | 3876 | return 0; |
3877 | lock_buffer(bh); | 3877 | lock_buffer(bh); |
diff --git a/fs/splice.c b/fs/splice.c index b30311ba8af..1bbc6f4bb09 100644 --- a/fs/splice.c +++ b/fs/splice.c | |||
@@ -371,7 +371,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos, | |||
371 | * for an in-flight io page | 371 | * for an in-flight io page |
372 | */ | 372 | */ |
373 | if (flags & SPLICE_F_NONBLOCK) { | 373 | if (flags & SPLICE_F_NONBLOCK) { |
374 | if (TestSetPageLocked(page)) { | 374 | if (!trylock_page(page)) { |
375 | error = -EAGAIN; | 375 | error = -EAGAIN; |
376 | break; | 376 | break; |
377 | } | 377 | } |
diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 3e30e40aa24..3141969b456 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c | |||
@@ -1233,7 +1233,7 @@ static int ufs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
1233 | { | 1233 | { |
1234 | struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb); | 1234 | struct ufs_sb_info *sbi = UFS_SB(vfs->mnt_sb); |
1235 | unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE; | 1235 | unsigned mval = sbi->s_mount_opt & UFS_MOUNT_UFSTYPE; |
1236 | const struct match_token *tp = tokens; | 1236 | struct match_token *tp = tokens; |
1237 | 1237 | ||
1238 | while (tp->token != Opt_onerror_panic && tp->token != mval) | 1238 | while (tp->token != Opt_onerror_panic && tp->token != mval) |
1239 | ++tp; | 1239 | ++tp; |
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 0b211cba190..fa47e43b8b4 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -675,7 +675,7 @@ xfs_probe_cluster( | |||
675 | } else | 675 | } else |
676 | pg_offset = PAGE_CACHE_SIZE; | 676 | pg_offset = PAGE_CACHE_SIZE; |
677 | 677 | ||
678 | if (page->index == tindex && !TestSetPageLocked(page)) { | 678 | if (page->index == tindex && trylock_page(page)) { |
679 | pg_len = xfs_probe_page(page, pg_offset, mapped); | 679 | pg_len = xfs_probe_page(page, pg_offset, mapped); |
680 | unlock_page(page); | 680 | unlock_page(page); |
681 | } | 681 | } |
@@ -759,7 +759,7 @@ xfs_convert_page( | |||
759 | 759 | ||
760 | if (page->index != tindex) | 760 | if (page->index != tindex) |
761 | goto fail; | 761 | goto fail; |
762 | if (TestSetPageLocked(page)) | 762 | if (!trylock_page(page)) |
763 | goto fail; | 763 | goto fail; |
764 | if (PageWriteback(page)) | 764 | if (PageWriteback(page)) |
765 | goto fail_unlock_page; | 765 | goto fail_unlock_page; |
@@ -1104,7 +1104,7 @@ xfs_page_state_convert( | |||
1104 | * that we are writing into for the first time. | 1104 | * that we are writing into for the first time. |
1105 | */ | 1105 | */ |
1106 | type = IOMAP_NEW; | 1106 | type = IOMAP_NEW; |
1107 | if (!test_and_set_bit(BH_Lock, &bh->b_state)) { | 1107 | if (trylock_buffer(bh)) { |
1108 | ASSERT(buffer_mapped(bh)); | 1108 | ASSERT(buffer_mapped(bh)); |
1109 | if (iomap_valid) | 1109 | if (iomap_valid) |
1110 | all_bh = 1; | 1110 | all_bh = 1; |