fs: move code out of buffer.c
Move invalidate_bdev, block_sync_page into fs/block_dev.c. Export kill_bdev as well, so brd doesn't have to open code it. Reduce buffer_head.h requirement accordingly. Removed a rather large comment from invalidate_bdev, as it looked a bit obsolete to bother moving. The small comment replacing it says enough. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/amifdreg.h>
|
||||
#include <linux/amifd.h>
|
||||
#include <linux/buffer_head.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/blkdev.h>
|
||||
#include <linux/elevator.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/radix-tree.h>
|
||||
#include <linux/buffer_head.h> /* invalidate_bh_lrus() */
|
||||
#include <linux/fs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
@@ -402,14 +402,13 @@ static int brd_ioctl(struct block_device *bdev, fmode_t mode,
|
||||
error = -EBUSY;
|
||||
if (bdev->bd_openers <= 1) {
|
||||
/*
|
||||
* Invalidate the cache first, so it isn't written
|
||||
* back to the device.
|
||||
* Kill the cache first, so it isn't written back to the
|
||||
* device.
|
||||
*
|
||||
* Another thread might instantiate more buffercache here,
|
||||
* but there is not much we can do to close that race.
|
||||
*/
|
||||
invalidate_bh_lrus();
|
||||
truncate_inode_pages(bdev->bd_inode->i_mapping, 0);
|
||||
kill_bdev(bdev);
|
||||
brd_free_pages(brd);
|
||||
error = 0;
|
||||
}
|
||||
|
||||
@@ -188,7 +188,6 @@ static int print_unex = 1;
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/buffer_head.h> /* for invalidate_buffers() */
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/buffer_head.h> /* for invalidate_bdev() */
|
||||
#include <linux/completion.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/kthread.h>
|
||||
|
||||
Reference in New Issue
Block a user