diff options
author | Christoph Hellwig <hch@lst.de> | 2010-09-16 14:51:46 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-16 14:52:58 -0400 |
commit | dd3932eddf428571762596e17b65f5dc92ca361b (patch) | |
tree | 57cec5ae2f862037f78b7e993323d77955bb6463 /fs | |
parent | 8786fb70ccb36c7cff64680bb80c46d3a09d44db (diff) |
block: remove BLKDEV_IFL_WAIT
All the blkdev_issue_* helpers can only sanely be used for synchronous
caller. To issue cache flushes or barriers asynchronously the caller needs
to set up a bio by itself with a completion callback to move the asynchronous
state machine ahead. So drop the BLKDEV_IFL_WAIT flag that is always
specified when calling blkdev_issue_* and also remove the now unused flags
argument to blkdev_issue_flush and blkdev_issue_zeroout. For
blkdev_issue_discard we need to keep it for the secure discard flag, which
gains a more descriptive name and loses the bitops vs flag confusion.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 | ||||
-rw-r--r-- | fs/ext3/fsync.c | 3 | ||||
-rw-r--r-- | fs/ext4/fsync.c | 5 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 3 | ||||
-rw-r--r-- | fs/fat/fatent.c | 3 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 5 | ||||
-rw-r--r-- | fs/jbd2/checkpoint.c | 3 | ||||
-rw-r--r-- | fs/jbd2/commit.c | 6 | ||||
-rw-r--r-- | fs/nilfs2/the_nilfs.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/file.c | 3 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 3 |
12 files changed, 16 insertions, 27 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 50e8c8582faa..b737451e2e9d 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -370,7 +370,7 @@ int blkdev_fsync(struct file *filp, int datasync) | |||
370 | */ | 370 | */ |
371 | mutex_unlock(&bd_inode->i_mutex); | 371 | mutex_unlock(&bd_inode->i_mutex); |
372 | 372 | ||
373 | error = blkdev_issue_flush(bdev, GFP_KERNEL, NULL, BLKDEV_IFL_WAIT); | 373 | error = blkdev_issue_flush(bdev, GFP_KERNEL, NULL); |
374 | if (error == -EOPNOTSUPP) | 374 | if (error == -EOPNOTSUPP) |
375 | error = 0; | 375 | error = 0; |
376 | 376 | ||
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 43dc9ea9aef6..0b81ecdb101c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1695,8 +1695,7 @@ static int remove_extent_backref(struct btrfs_trans_handle *trans, | |||
1695 | static void btrfs_issue_discard(struct block_device *bdev, | 1695 | static void btrfs_issue_discard(struct block_device *bdev, |
1696 | u64 start, u64 len) | 1696 | u64 start, u64 len) |
1697 | { | 1697 | { |
1698 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, | 1698 | blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_KERNEL, 0); |
1699 | BLKDEV_IFL_WAIT); | ||
1700 | } | 1699 | } |
1701 | 1700 | ||
1702 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, | 1701 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, |
diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index d7e9f74dc3a6..09b13bb34c94 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c | |||
@@ -90,7 +90,6 @@ int ext3_sync_file(struct file *file, int datasync) | |||
90 | * storage | 90 | * storage |
91 | */ | 91 | */ |
92 | if (needs_barrier) | 92 | if (needs_barrier) |
93 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL, | 93 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
94 | BLKDEV_IFL_WAIT); | ||
95 | return ret; | 94 | return ret; |
96 | } | 95 | } |
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index 592adf2e546e..3f3ff5ee8f9d 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c | |||
@@ -128,10 +128,9 @@ int ext4_sync_file(struct file *file, int datasync) | |||
128 | (journal->j_fs_dev != journal->j_dev) && | 128 | (journal->j_fs_dev != journal->j_dev) && |
129 | (journal->j_flags & JBD2_BARRIER)) | 129 | (journal->j_flags & JBD2_BARRIER)) |
130 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, | 130 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, |
131 | NULL, BLKDEV_IFL_WAIT); | 131 | NULL); |
132 | ret = jbd2_log_wait_commit(journal, commit_tid); | 132 | ret = jbd2_log_wait_commit(journal, commit_tid); |
133 | } else if (journal->j_flags & JBD2_BARRIER) | 133 | } else if (journal->j_flags & JBD2_BARRIER) |
134 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL, | 134 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
135 | BLKDEV_IFL_WAIT); | ||
136 | return ret; | 135 | return ret; |
137 | } | 136 | } |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index a22bfef3da95..19aa0d44d822 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -2566,8 +2566,7 @@ static inline void ext4_issue_discard(struct super_block *sb, | |||
2566 | discard_block = block + ext4_group_first_block_no(sb, block_group); | 2566 | discard_block = block + ext4_group_first_block_no(sb, block_group); |
2567 | trace_ext4_discard_blocks(sb, | 2567 | trace_ext4_discard_blocks(sb, |
2568 | (unsigned long long) discard_block, count); | 2568 | (unsigned long long) discard_block, count); |
2569 | ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, | 2569 | ret = sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0); |
2570 | BLKDEV_IFL_WAIT); | ||
2571 | if (ret == EOPNOTSUPP) { | 2570 | if (ret == EOPNOTSUPP) { |
2572 | ext4_warning(sb, "discard not supported, disabling"); | 2571 | ext4_warning(sb, "discard not supported, disabling"); |
2573 | clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); | 2572 | clear_opt(EXT4_SB(sb)->s_mount_opt, DISCARD); |
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index f9a0b7ae8648..b47d2c9f4fa1 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -578,8 +578,7 @@ int fat_free_clusters(struct inode *inode, int cluster) | |||
578 | sb_issue_discard(sb, | 578 | sb_issue_discard(sb, |
579 | fat_clus_to_blknr(sbi, first_cl), | 579 | fat_clus_to_blknr(sbi, first_cl), |
580 | nr_clus * sbi->sec_per_clus, | 580 | nr_clus * sbi->sec_per_clus, |
581 | GFP_NOFS, | 581 | GFP_NOFS, 0); |
582 | BLKDEV_IFL_WAIT); | ||
583 | 582 | ||
584 | first_cl = cluster; | 583 | first_cl = cluster; |
585 | } | 584 | } |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 379316472918..38b3ea1abacc 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -854,7 +854,7 @@ static void gfs2_rgrp_send_discards(struct gfs2_sbd *sdp, u64 offset, | |||
854 | if ((start + nr_sects) != blk) { | 854 | if ((start + nr_sects) != blk) { |
855 | rv = blkdev_issue_discard(bdev, start, | 855 | rv = blkdev_issue_discard(bdev, start, |
856 | nr_sects, GFP_NOFS, | 856 | nr_sects, GFP_NOFS, |
857 | BLKDEV_IFL_WAIT); | 857 | 0); |
858 | if (rv) | 858 | if (rv) |
859 | goto fail; | 859 | goto fail; |
860 | nr_sects = 0; | 860 | nr_sects = 0; |
@@ -868,8 +868,7 @@ start_new_extent: | |||
868 | } | 868 | } |
869 | } | 869 | } |
870 | if (nr_sects) { | 870 | if (nr_sects) { |
871 | rv = blkdev_issue_discard(bdev, start, nr_sects, GFP_NOFS, | 871 | rv = blkdev_issue_discard(bdev, start, nr_sects, GFP_NOFS, 0); |
872 | BLKDEV_IFL_WAIT); | ||
873 | if (rv) | 872 | if (rv) |
874 | goto fail; | 873 | goto fail; |
875 | } | 874 | } |
diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c index 5247e7ffdcb4..6571a056e55d 100644 --- a/fs/jbd2/checkpoint.c +++ b/fs/jbd2/checkpoint.c | |||
@@ -532,8 +532,7 @@ int jbd2_cleanup_journal_tail(journal_t *journal) | |||
532 | */ | 532 | */ |
533 | if ((journal->j_fs_dev != journal->j_dev) && | 533 | if ((journal->j_fs_dev != journal->j_dev) && |
534 | (journal->j_flags & JBD2_BARRIER)) | 534 | (journal->j_flags & JBD2_BARRIER)) |
535 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL, | 535 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); |
536 | BLKDEV_IFL_WAIT); | ||
537 | if (!(journal->j_flags & JBD2_ABORT)) | 536 | if (!(journal->j_flags & JBD2_ABORT)) |
538 | jbd2_journal_update_superblock(journal, 1); | 537 | jbd2_journal_update_superblock(journal, 1); |
539 | return 0; | 538 | return 0; |
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index f204e27f44d1..cb43c605cfaa 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c | |||
@@ -684,8 +684,7 @@ start_journal_io: | |||
684 | if (commit_transaction->t_flushed_data_blocks && | 684 | if (commit_transaction->t_flushed_data_blocks && |
685 | (journal->j_fs_dev != journal->j_dev) && | 685 | (journal->j_fs_dev != journal->j_dev) && |
686 | (journal->j_flags & JBD2_BARRIER)) | 686 | (journal->j_flags & JBD2_BARRIER)) |
687 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL, | 687 | blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL); |
688 | BLKDEV_IFL_WAIT); | ||
689 | 688 | ||
690 | /* Done it all: now write the commit record asynchronously. */ | 689 | /* Done it all: now write the commit record asynchronously. */ |
691 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, | 690 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
@@ -810,8 +809,7 @@ wait_for_iobuf: | |||
810 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, | 809 | if (JBD2_HAS_INCOMPAT_FEATURE(journal, |
811 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) && | 810 | JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) && |
812 | journal->j_flags & JBD2_BARRIER) { | 811 | journal->j_flags & JBD2_BARRIER) { |
813 | blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL, | 812 | blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL); |
814 | BLKDEV_IFL_WAIT); | ||
815 | } | 813 | } |
816 | 814 | ||
817 | if (err) | 815 | if (err) |
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 400b2caef4d8..d97310f07bef 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c | |||
@@ -774,7 +774,7 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump, | |||
774 | ret = blkdev_issue_discard(nilfs->ns_bdev, | 774 | ret = blkdev_issue_discard(nilfs->ns_bdev, |
775 | start * sects_per_block, | 775 | start * sects_per_block, |
776 | nblocks * sects_per_block, | 776 | nblocks * sects_per_block, |
777 | GFP_NOFS, BLKDEV_IFL_WAIT); | 777 | GFP_NOFS, 0); |
778 | if (ret < 0) | 778 | if (ret < 0) |
779 | return ret; | 779 | return ret; |
780 | nblocks = 0; | 780 | nblocks = 0; |
@@ -784,7 +784,7 @@ int nilfs_discard_segments(struct the_nilfs *nilfs, __u64 *segnump, | |||
784 | ret = blkdev_issue_discard(nilfs->ns_bdev, | 784 | ret = blkdev_issue_discard(nilfs->ns_bdev, |
785 | start * sects_per_block, | 785 | start * sects_per_block, |
786 | nblocks * sects_per_block, | 786 | nblocks * sects_per_block, |
787 | GFP_NOFS, BLKDEV_IFL_WAIT); | 787 | GFP_NOFS, 0); |
788 | return ret; | 788 | return ret; |
789 | } | 789 | } |
790 | 790 | ||
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index 6846371498b6..91f080cc76c8 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -152,8 +152,7 @@ static int reiserfs_sync_file(struct file *filp, int datasync) | |||
152 | barrier_done = reiserfs_commit_for_inode(inode); | 152 | barrier_done = reiserfs_commit_for_inode(inode); |
153 | reiserfs_write_unlock(inode->i_sb); | 153 | reiserfs_write_unlock(inode->i_sb); |
154 | if (barrier_done != 1 && reiserfs_barrier_flush(inode->i_sb)) | 154 | if (barrier_done != 1 && reiserfs_barrier_flush(inode->i_sb)) |
155 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL, | 155 | blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); |
156 | BLKDEV_IFL_WAIT); | ||
157 | if (barrier_done < 0) | 156 | if (barrier_done < 0) |
158 | return barrier_done; | 157 | return barrier_done; |
159 | return (err < 0) ? -EIO : 0; | 158 | return (err < 0) ? -EIO : 0; |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 15c35b62ff14..5fa7a30cc3f0 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -693,8 +693,7 @@ void | |||
693 | xfs_blkdev_issue_flush( | 693 | xfs_blkdev_issue_flush( |
694 | xfs_buftarg_t *buftarg) | 694 | xfs_buftarg_t *buftarg) |
695 | { | 695 | { |
696 | blkdev_issue_flush(buftarg->bt_bdev, GFP_KERNEL, NULL, | 696 | blkdev_issue_flush(buftarg->bt_bdev, GFP_KERNEL, NULL); |
697 | BLKDEV_IFL_WAIT); | ||
698 | } | 697 | } |
699 | 698 | ||
700 | STATIC void | 699 | STATIC void |