diff options
author | Jiri Kosina <jkosina@suse.cz> | 2014-02-20 08:54:28 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-02-20 08:54:28 -0500 |
commit | d4263348f796f29546f90802177865dd4379dd0a (patch) | |
tree | adcbdaebae584eee2f32fab95e826e8e49eef385 /fs/buffer.c | |
parent | be873ac782f5ff5ee6675f83929f4fe6737eead2 (diff) | |
parent | 6d0abeca3242a88cab8232e4acd7e2bf088f3bc2 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index a20f2eb107ed..8c53a2b15ecb 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -654,14 +654,16 @@ EXPORT_SYMBOL(mark_buffer_dirty_inode); | |||
654 | static void __set_page_dirty(struct page *page, | 654 | static void __set_page_dirty(struct page *page, |
655 | struct address_space *mapping, int warn) | 655 | struct address_space *mapping, int warn) |
656 | { | 656 | { |
657 | spin_lock_irq(&mapping->tree_lock); | 657 | unsigned long flags; |
658 | |||
659 | spin_lock_irqsave(&mapping->tree_lock, flags); | ||
658 | if (page->mapping) { /* Race with truncate? */ | 660 | if (page->mapping) { /* Race with truncate? */ |
659 | WARN_ON_ONCE(warn && !PageUptodate(page)); | 661 | WARN_ON_ONCE(warn && !PageUptodate(page)); |
660 | account_page_dirtied(page, mapping); | 662 | account_page_dirtied(page, mapping); |
661 | radix_tree_tag_set(&mapping->page_tree, | 663 | radix_tree_tag_set(&mapping->page_tree, |
662 | page_index(page), PAGECACHE_TAG_DIRTY); | 664 | page_index(page), PAGECACHE_TAG_DIRTY); |
663 | } | 665 | } |
664 | spin_unlock_irq(&mapping->tree_lock); | 666 | spin_unlock_irqrestore(&mapping->tree_lock, flags); |
665 | __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); | 667 | __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); |
666 | } | 668 | } |
667 | 669 | ||
@@ -1312,7 +1314,7 @@ static void bh_lru_install(struct buffer_head *bh) | |||
1312 | } | 1314 | } |
1313 | while (out < BH_LRU_SIZE) | 1315 | while (out < BH_LRU_SIZE) |
1314 | bhs[out++] = NULL; | 1316 | bhs[out++] = NULL; |
1315 | memcpy(__this_cpu_ptr(&bh_lrus.bhs), bhs, sizeof(bhs)); | 1317 | memcpy(this_cpu_ptr(&bh_lrus.bhs), bhs, sizeof(bhs)); |
1316 | } | 1318 | } |
1317 | bh_lru_unlock(); | 1319 | bh_lru_unlock(); |
1318 | 1320 | ||
@@ -2982,11 +2984,11 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh) | |||
2982 | * let it through, and the IO layer will turn it into | 2984 | * let it through, and the IO layer will turn it into |
2983 | * an EIO. | 2985 | * an EIO. |
2984 | */ | 2986 | */ |
2985 | if (unlikely(bio->bi_sector >= maxsector)) | 2987 | if (unlikely(bio->bi_iter.bi_sector >= maxsector)) |
2986 | return; | 2988 | return; |
2987 | 2989 | ||
2988 | maxsector -= bio->bi_sector; | 2990 | maxsector -= bio->bi_iter.bi_sector; |
2989 | bytes = bio->bi_size; | 2991 | bytes = bio->bi_iter.bi_size; |
2990 | if (likely((bytes >> 9) <= maxsector)) | 2992 | if (likely((bytes >> 9) <= maxsector)) |
2991 | return; | 2993 | return; |
2992 | 2994 | ||
@@ -2994,7 +2996,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh) | |||
2994 | bytes = maxsector << 9; | 2996 | bytes = maxsector << 9; |
2995 | 2997 | ||
2996 | /* Truncate the bio.. */ | 2998 | /* Truncate the bio.. */ |
2997 | bio->bi_size = bytes; | 2999 | bio->bi_iter.bi_size = bytes; |
2998 | bio->bi_io_vec[0].bv_len = bytes; | 3000 | bio->bi_io_vec[0].bv_len = bytes; |
2999 | 3001 | ||
3000 | /* ..and clear the end of the buffer for reads */ | 3002 | /* ..and clear the end of the buffer for reads */ |
@@ -3029,14 +3031,14 @@ int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags) | |||
3029 | */ | 3031 | */ |
3030 | bio = bio_alloc(GFP_NOIO, 1); | 3032 | bio = bio_alloc(GFP_NOIO, 1); |
3031 | 3033 | ||
3032 | bio->bi_sector = bh->b_blocknr * (bh->b_size >> 9); | 3034 | bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9); |
3033 | bio->bi_bdev = bh->b_bdev; | 3035 | bio->bi_bdev = bh->b_bdev; |
3034 | bio->bi_io_vec[0].bv_page = bh->b_page; | 3036 | bio->bi_io_vec[0].bv_page = bh->b_page; |
3035 | bio->bi_io_vec[0].bv_len = bh->b_size; | 3037 | bio->bi_io_vec[0].bv_len = bh->b_size; |
3036 | bio->bi_io_vec[0].bv_offset = bh_offset(bh); | 3038 | bio->bi_io_vec[0].bv_offset = bh_offset(bh); |
3037 | 3039 | ||
3038 | bio->bi_vcnt = 1; | 3040 | bio->bi_vcnt = 1; |
3039 | bio->bi_size = bh->b_size; | 3041 | bio->bi_iter.bi_size = bh->b_size; |
3040 | 3042 | ||
3041 | bio->bi_end_io = end_bio_bh_io_sync; | 3043 | bio->bi_end_io = end_bio_bh_io_sync; |
3042 | bio->bi_private = bh; | 3044 | bio->bi_private = bh; |