diff options
author | David Howells <dhowells@redhat.com> | 2006-08-29 14:06:11 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:52:27 -0400 |
commit | b71e8a4ce03b3098c7801ee5e6e08d1a39a226c2 (patch) | |
tree | 69e287c96181862f911b19dfd37abb968d26bdaf /fs | |
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')
-rw-r--r-- | fs/block_dev.c | 21 | ||||
-rw-r--r-- | fs/inode.c | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 335c38bb86eb..0c361ea7e5a6 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1315,3 +1315,24 @@ void close_bdev_excl(struct block_device *bdev) | |||
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | EXPORT_SYMBOL(close_bdev_excl); | 1317 | EXPORT_SYMBOL(close_bdev_excl); |
1318 | |||
1319 | int __invalidate_device(struct block_device *bdev) | ||
1320 | { | ||
1321 | struct super_block *sb = get_super(bdev); | ||
1322 | int res = 0; | ||
1323 | |||
1324 | if (sb) { | ||
1325 | /* | ||
1326 | * no need to lock the super, get_super holds the | ||
1327 | * read mutex so the filesystem cannot go away | ||
1328 | * under us (->put_super runs with the write lock | ||
1329 | * hold). | ||
1330 | */ | ||
1331 | shrink_dcache_sb(sb); | ||
1332 | res = invalidate_inodes(sb); | ||
1333 | drop_super(sb); | ||
1334 | } | ||
1335 | invalidate_bdev(bdev, 0); | ||
1336 | return res; | ||
1337 | } | ||
1338 | EXPORT_SYMBOL(__invalidate_device); | ||
diff --git a/fs/inode.c b/fs/inode.c index abf77471e6c4..ada7643104e1 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -362,27 +362,6 @@ int invalidate_inodes(struct super_block * sb) | |||
362 | } | 362 | } |
363 | 363 | ||
364 | EXPORT_SYMBOL(invalidate_inodes); | 364 | EXPORT_SYMBOL(invalidate_inodes); |
365 | |||
366 | int __invalidate_device(struct block_device *bdev) | ||
367 | { | ||
368 | struct super_block *sb = get_super(bdev); | ||
369 | int res = 0; | ||
370 | |||
371 | if (sb) { | ||
372 | /* | ||
373 | * no need to lock the super, get_super holds the | ||
374 | * read mutex so the filesystem cannot go away | ||
375 | * under us (->put_super runs with the write lock | ||
376 | * hold). | ||
377 | */ | ||
378 | shrink_dcache_sb(sb); | ||
379 | res = invalidate_inodes(sb); | ||
380 | drop_super(sb); | ||
381 | } | ||
382 | invalidate_bdev(bdev, 0); | ||
383 | return res; | ||
384 | } | ||
385 | EXPORT_SYMBOL(__invalidate_device); | ||
386 | 365 | ||
387 | static int can_unuse(struct inode *inode) | 366 | static int can_unuse(struct inode *inode) |
388 | { | 367 | { |