diff options
author | David Howells <dhowells@redhat.com> | 2006-08-29 19:06:11 +0100 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 20:52:27 +0200 |
commit | b71e8a4ce03b3098c7801ee5e6e08d1a39a226c2 (patch) | |
tree | 69e287c96181862f911b19dfd37abb968d26bdaf /fs/block_dev.c | |
parent | 811d736f9e8013966e1a5a930c0db09508bdbb15 (diff) |
[PATCH] BLOCK: Move __invalidate_device() to block_dev.c [try #6]
Move __invalidate_device() from fs/inode.c to fs/block_dev.c so that it can
more easily be disabled when the block layer is disabled.
Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r-- | fs/block_dev.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 335c38bb86e..0c361ea7e5a 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -1315,3 +1315,24 @@ void close_bdev_excl(struct block_device *bdev) } EXPORT_SYMBOL(close_bdev_excl); + +int __invalidate_device(struct block_device *bdev) +{ + struct super_block *sb = get_super(bdev); + int res = 0; + + if (sb) { + /* + * no need to lock the super, get_super holds the + * read mutex so the filesystem cannot go away + * under us (->put_super runs with the write lock + * hold). + */ + shrink_dcache_sb(sb); + res = invalidate_inodes(sb); + drop_super(sb); + } + invalidate_bdev(bdev, 0); + return res; +} +EXPORT_SYMBOL(__invalidate_device); |