diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-08-10 14:26:52 -0400 |
commit | 5f248c9c251c60af3403902b26e08de43964ea0b (patch) | |
tree | 6d3328e72a7e4015a64017eb30be18095c6a3c64 /fs/block_dev.c | |
parent | f6cec0ae58c17522a7bc4e2f39dae19f199ab534 (diff) | |
parent | dca332528bc69e05f67161e1ed59929633d5e63d (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (96 commits)
no need for list_for_each_entry_safe()/resetting with superblock list
Fix sget() race with failing mount
vfs: don't hold s_umount over close_bdev_exclusive() call
sysv: do not mark superblock dirty on remount
sysv: do not mark superblock dirty on mount
btrfs: remove junk sb_dirt change
BFS: clean up the superblock usage
AFFS: wait for sb synchronization when needed
AFFS: clean up dirty flag usage
cifs: truncate fallout
mbcache: fix shrinker function return value
mbcache: Remove unused features
add f_flags to struct statfs(64)
pass a struct path to vfs_statfs
update VFS documentation for method changes.
All filesystems that need invalidate_inode_buffers() are doing that explicitly
convert remaining ->clear_inode() to ->evict_inode()
Make ->drop_inode() just return whether inode needs to be dropped
fs/inode.c:clear_inode() is gone
fs/inode.c:evict() doesn't care about delete vs. non-delete paths now
...
Fix up trivial conflicts in fs/nilfs2/super.c
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index b3171fb0dc9a..451afbd543b5 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -172,9 +172,8 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
172 | struct file *file = iocb->ki_filp; | 172 | struct file *file = iocb->ki_filp; |
173 | struct inode *inode = file->f_mapping->host; | 173 | struct inode *inode = file->f_mapping->host; |
174 | 174 | ||
175 | return blockdev_direct_IO_no_locking_newtrunc(rw, iocb, inode, | 175 | return __blockdev_direct_IO(rw, iocb, inode, I_BDEV(inode), iov, offset, |
176 | I_BDEV(inode), iov, offset, nr_segs, | 176 | nr_segs, blkdev_get_blocks, NULL, NULL, 0); |
177 | blkdev_get_blocks, NULL); | ||
178 | } | 177 | } |
179 | 178 | ||
180 | int __sync_blockdev(struct block_device *bdev, int wait) | 179 | int __sync_blockdev(struct block_device *bdev, int wait) |
@@ -309,9 +308,8 @@ static int blkdev_write_begin(struct file *file, struct address_space *mapping, | |||
309 | loff_t pos, unsigned len, unsigned flags, | 308 | loff_t pos, unsigned len, unsigned flags, |
310 | struct page **pagep, void **fsdata) | 309 | struct page **pagep, void **fsdata) |
311 | { | 310 | { |
312 | *pagep = NULL; | 311 | return block_write_begin(mapping, pos, len, flags, pagep, |
313 | return block_write_begin_newtrunc(file, mapping, pos, len, flags, | 312 | blkdev_get_block); |
314 | pagep, fsdata, blkdev_get_block); | ||
315 | } | 313 | } |
316 | 314 | ||
317 | static int blkdev_write_end(struct file *file, struct address_space *mapping, | 315 | static int blkdev_write_end(struct file *file, struct address_space *mapping, |
@@ -428,10 +426,13 @@ static inline void __bd_forget(struct inode *inode) | |||
428 | inode->i_mapping = &inode->i_data; | 426 | inode->i_mapping = &inode->i_data; |
429 | } | 427 | } |
430 | 428 | ||
431 | static void bdev_clear_inode(struct inode *inode) | 429 | static void bdev_evict_inode(struct inode *inode) |
432 | { | 430 | { |
433 | struct block_device *bdev = &BDEV_I(inode)->bdev; | 431 | struct block_device *bdev = &BDEV_I(inode)->bdev; |
434 | struct list_head *p; | 432 | struct list_head *p; |
433 | truncate_inode_pages(&inode->i_data, 0); | ||
434 | invalidate_inode_buffers(inode); /* is it needed here? */ | ||
435 | end_writeback(inode); | ||
435 | spin_lock(&bdev_lock); | 436 | spin_lock(&bdev_lock); |
436 | while ( (p = bdev->bd_inodes.next) != &bdev->bd_inodes ) { | 437 | while ( (p = bdev->bd_inodes.next) != &bdev->bd_inodes ) { |
437 | __bd_forget(list_entry(p, struct inode, i_devices)); | 438 | __bd_forget(list_entry(p, struct inode, i_devices)); |
@@ -445,7 +446,7 @@ static const struct super_operations bdev_sops = { | |||
445 | .alloc_inode = bdev_alloc_inode, | 446 | .alloc_inode = bdev_alloc_inode, |
446 | .destroy_inode = bdev_destroy_inode, | 447 | .destroy_inode = bdev_destroy_inode, |
447 | .drop_inode = generic_delete_inode, | 448 | .drop_inode = generic_delete_inode, |
448 | .clear_inode = bdev_clear_inode, | 449 | .evict_inode = bdev_evict_inode, |
449 | }; | 450 | }; |
450 | 451 | ||
451 | static int bd_get_sb(struct file_system_type *fs_type, | 452 | static int bd_get_sb(struct file_system_type *fs_type, |