aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 3b12cf947ab..5f525b3c6d9 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -218,7 +218,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
218 sb = get_super(bdev); 218 sb = get_super(bdev);
219 if (sb && !(sb->s_flags & MS_RDONLY)) { 219 if (sb && !(sb->s_flags & MS_RDONLY)) {
220 sb->s_frozen = SB_FREEZE_WRITE; 220 sb->s_frozen = SB_FREEZE_WRITE;
221 wmb(); 221 smp_wmb();
222 222
223 sync_inodes_sb(sb, 0); 223 sync_inodes_sb(sb, 0);
224 DQUOT_SYNC(sb); 224 DQUOT_SYNC(sb);
@@ -235,7 +235,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
235 sync_inodes_sb(sb, 1); 235 sync_inodes_sb(sb, 1);
236 236
237 sb->s_frozen = SB_FREEZE_TRANS; 237 sb->s_frozen = SB_FREEZE_TRANS;
238 wmb(); 238 smp_wmb();
239 239
240 sync_blockdev(sb->s_bdev); 240 sync_blockdev(sb->s_bdev);
241 241
@@ -263,7 +263,7 @@ void thaw_bdev(struct block_device *bdev, struct super_block *sb)
263 if (sb->s_op->unlockfs) 263 if (sb->s_op->unlockfs)
264 sb->s_op->unlockfs(sb); 264 sb->s_op->unlockfs(sb);
265 sb->s_frozen = SB_UNFROZEN; 265 sb->s_frozen = SB_UNFROZEN;
266 wmb(); 266 smp_wmb();
267 wake_up(&sb->s_wait_unfrozen); 267 wake_up(&sb->s_wait_unfrozen);
268 drop_super(sb); 268 drop_super(sb);
269 } 269 }
@@ -774,15 +774,14 @@ repeat:
774/** 774/**
775 * sync_mapping_buffers - write out and wait upon a mapping's "associated" 775 * sync_mapping_buffers - write out and wait upon a mapping's "associated"
776 * buffers 776 * buffers
777 * @buffer_mapping - the mapping which backs the buffers' data 777 * @mapping: the mapping which wants those buffers written
778 * @mapping - the mapping which wants those buffers written
779 * 778 *
780 * Starts I/O against the buffers at mapping->private_list, and waits upon 779 * Starts I/O against the buffers at mapping->private_list, and waits upon
781 * that I/O. 780 * that I/O.
782 * 781 *
783 * Basically, this is a convenience function for fsync(). @buffer_mapping is 782 * Basically, this is a convenience function for fsync().
784 * the blockdev which "owns" the buffers and @mapping is a file or directory 783 * @mapping is a file or directory which needs those buffers to be written for
785 * which needs those buffers to be written for a successful fsync(). 784 * a successful fsync().
786 */ 785 */
787int sync_mapping_buffers(struct address_space *mapping) 786int sync_mapping_buffers(struct address_space *mapping)
788{ 787{
@@ -1263,6 +1262,7 @@ __getblk_slow(struct block_device *bdev, sector_t block, int size)
1263 1262
1264/** 1263/**
1265 * mark_buffer_dirty - mark a buffer_head as needing writeout 1264 * mark_buffer_dirty - mark a buffer_head as needing writeout
1265 * @bh: the buffer_head to mark dirty
1266 * 1266 *
1267 * mark_buffer_dirty() will set the dirty bit against the buffer, then set its 1267 * mark_buffer_dirty() will set the dirty bit against the buffer, then set its
1268 * backing page dirty, then tag the page as dirty in its address_space's radix 1268 * backing page dirty, then tag the page as dirty in its address_space's radix
@@ -1501,6 +1501,7 @@ EXPORT_SYMBOL(__breadahead);
1501 1501
1502/** 1502/**
1503 * __bread() - reads a specified block and returns the bh 1503 * __bread() - reads a specified block and returns the bh
1504 * @bdev: the block_device to read from
1504 * @block: number of block 1505 * @block: number of block
1505 * @size: size (in bytes) to read 1506 * @size: size (in bytes) to read
1506 * 1507 *
@@ -2078,8 +2079,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
2078 int nr, i; 2079 int nr, i;
2079 int fully_mapped = 1; 2080 int fully_mapped = 1;
2080 2081
2081 if (!PageLocked(page)) 2082 BUG_ON(!PageLocked(page));
2082 PAGE_BUG(page);
2083 blocksize = 1 << inode->i_blkbits; 2083 blocksize = 1 << inode->i_blkbits;
2084 if (!page_has_buffers(page)) 2084 if (!page_has_buffers(page))
2085 create_empty_buffers(page, blocksize, 0); 2085 create_empty_buffers(page, blocksize, 0);
@@ -2917,7 +2917,7 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free)
2917 2917
2918 bh = head; 2918 bh = head;
2919 do { 2919 do {
2920 if (buffer_write_io_error(bh)) 2920 if (buffer_write_io_error(bh) && page->mapping)
2921 set_bit(AS_EIO, &page->mapping->flags); 2921 set_bit(AS_EIO, &page->mapping->flags);
2922 if (buffer_busy(bh)) 2922 if (buffer_busy(bh))
2923 goto failed; 2923 goto failed;