diff options
author | Jan Kara <jack@suse.cz> | 2009-04-27 10:43:53 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:04 -0400 |
commit | 60b0680fa236ac4e17ce31a50048c9d75f9ec831 (patch) | |
tree | c8ca34340a173326694247eab779e713c57202c2 | |
parent | c15c54f5f056ee4819da9fde59a5f2cd45445f23 (diff) |
vfs: Rename fsync_super() to sync_filesystem() (version 4)
Rename the function so that it better describe what it really does. Also
remove the unnecessary include of buffer_head.h.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/block_dev.c | 4 | ||||
-rw-r--r-- | fs/cachefiles/interface.c | 2 | ||||
-rw-r--r-- | fs/super.c | 5 | ||||
-rw-r--r-- | fs/sync.c | 12 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
5 files changed, 12 insertions, 13 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index 4b6a3b9d01ef..3a6d4fb2a329 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -204,7 +204,7 @@ int fsync_bdev(struct block_device *bdev) | |||
204 | { | 204 | { |
205 | struct super_block *sb = get_super(bdev); | 205 | struct super_block *sb = get_super(bdev); |
206 | if (sb) { | 206 | if (sb) { |
207 | int res = fsync_super(sb); | 207 | int res = sync_filesystem(sb); |
208 | drop_super(sb); | 208 | drop_super(sb); |
209 | return res; | 209 | return res; |
210 | } | 210 | } |
@@ -246,7 +246,7 @@ struct super_block *freeze_bdev(struct block_device *bdev) | |||
246 | sb->s_frozen = SB_FREEZE_WRITE; | 246 | sb->s_frozen = SB_FREEZE_WRITE; |
247 | smp_wmb(); | 247 | smp_wmb(); |
248 | 248 | ||
249 | fsync_super(sb); | 249 | sync_filesystem(sb); |
250 | 250 | ||
251 | sb->s_frozen = SB_FREEZE_TRANS; | 251 | sb->s_frozen = SB_FREEZE_TRANS; |
252 | smp_wmb(); | 252 | smp_wmb(); |
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c index 1e962348d111..dafd484d7bda 100644 --- a/fs/cachefiles/interface.c +++ b/fs/cachefiles/interface.c | |||
@@ -354,7 +354,7 @@ static void cachefiles_sync_cache(struct fscache_cache *_cache) | |||
354 | /* make sure all pages pinned by operations on behalf of the netfs are | 354 | /* make sure all pages pinned by operations on behalf of the netfs are |
355 | * written to disc */ | 355 | * written to disc */ |
356 | cachefiles_begin_secure(cache, &saved_cred); | 356 | cachefiles_begin_secure(cache, &saved_cred); |
357 | ret = fsync_super(cache->mnt->mnt_sb); | 357 | ret = sync_filesystem(cache->mnt->mnt_sb); |
358 | cachefiles_end_secure(cache, saved_cred); | 358 | cachefiles_end_secure(cache, saved_cred); |
359 | 359 | ||
360 | if (ret == -EIO) | 360 | if (ret == -EIO) |
diff --git a/fs/super.c b/fs/super.c index f822c74f25be..721236e6177a 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/blkdev.h> | 28 | #include <linux/blkdev.h> |
29 | #include <linux/quotaops.h> | 29 | #include <linux/quotaops.h> |
30 | #include <linux/namei.h> | 30 | #include <linux/namei.h> |
31 | #include <linux/buffer_head.h> /* for fsync_super() */ | ||
32 | #include <linux/mount.h> | 31 | #include <linux/mount.h> |
33 | #include <linux/security.h> | 32 | #include <linux/security.h> |
34 | #include <linux/syscalls.h> | 33 | #include <linux/syscalls.h> |
@@ -304,7 +303,7 @@ void generic_shutdown_super(struct super_block *sb) | |||
304 | 303 | ||
305 | if (sb->s_root) { | 304 | if (sb->s_root) { |
306 | shrink_dcache_for_umount(sb); | 305 | shrink_dcache_for_umount(sb); |
307 | fsync_super(sb); | 306 | sync_filesystem(sb); |
308 | lock_super(sb); | 307 | lock_super(sb); |
309 | sb->s_flags &= ~MS_ACTIVE; | 308 | sb->s_flags &= ~MS_ACTIVE; |
310 | 309 | ||
@@ -543,7 +542,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | |||
543 | if (flags & MS_RDONLY) | 542 | if (flags & MS_RDONLY) |
544 | acct_auto_close(sb); | 543 | acct_auto_close(sb); |
545 | shrink_dcache_sb(sb); | 544 | shrink_dcache_sb(sb); |
546 | fsync_super(sb); | 545 | sync_filesystem(sb); |
547 | 546 | ||
548 | /* If we are remounting RDONLY and current sb is read/write, | 547 | /* If we are remounting RDONLY and current sb is read/write, |
549 | make sure there are no rw files opened */ | 548 | make sure there are no rw files opened */ |
@@ -25,7 +25,7 @@ | |||
25 | * case write_inode() functions do sync_dirty_buffer() and thus effectively | 25 | * case write_inode() functions do sync_dirty_buffer() and thus effectively |
26 | * write one block at a time. | 26 | * write one block at a time. |
27 | */ | 27 | */ |
28 | static int __fsync_super(struct super_block *sb, int wait) | 28 | static int __sync_filesystem(struct super_block *sb, int wait) |
29 | { | 29 | { |
30 | vfs_dq_sync(sb); | 30 | vfs_dq_sync(sb); |
31 | sync_inodes_sb(sb, wait); | 31 | sync_inodes_sb(sb, wait); |
@@ -43,16 +43,16 @@ static int __fsync_super(struct super_block *sb, int wait) | |||
43 | * superblock. Filesystem data as well as the underlying block | 43 | * superblock. Filesystem data as well as the underlying block |
44 | * device. Takes the superblock lock. | 44 | * device. Takes the superblock lock. |
45 | */ | 45 | */ |
46 | int fsync_super(struct super_block *sb) | 46 | int sync_filesystem(struct super_block *sb) |
47 | { | 47 | { |
48 | int ret; | 48 | int ret; |
49 | 49 | ||
50 | ret = __fsync_super(sb, 0); | 50 | ret = __sync_filesystem(sb, 0); |
51 | if (ret < 0) | 51 | if (ret < 0) |
52 | return ret; | 52 | return ret; |
53 | return __fsync_super(sb, 1); | 53 | return __sync_filesystem(sb, 1); |
54 | } | 54 | } |
55 | EXPORT_SYMBOL_GPL(fsync_super); | 55 | EXPORT_SYMBOL_GPL(sync_filesystem); |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Sync all the data for all the filesystems (called by sys_sync() and | 58 | * Sync all the data for all the filesystems (called by sys_sync() and |
@@ -92,7 +92,7 @@ restart: | |||
92 | spin_unlock(&sb_lock); | 92 | spin_unlock(&sb_lock); |
93 | down_read(&sb->s_umount); | 93 | down_read(&sb->s_umount); |
94 | if (sb->s_root) | 94 | if (sb->s_root) |
95 | __fsync_super(sb, wait); | 95 | __sync_filesystem(sb, wait); |
96 | up_read(&sb->s_umount); | 96 | up_read(&sb->s_umount); |
97 | /* restart only when sb is no longer on the list */ | 97 | /* restart only when sb is no longer on the list */ |
98 | spin_lock(&sb_lock); | 98 | spin_lock(&sb_lock); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index d3f7159993cf..fb1822bed7c8 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1958,7 +1958,7 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
1958 | return 0; | 1958 | return 0; |
1959 | } | 1959 | } |
1960 | #endif | 1960 | #endif |
1961 | extern int fsync_super(struct super_block *); | 1961 | extern int sync_filesystem(struct super_block *); |
1962 | extern const struct file_operations def_blk_fops; | 1962 | extern const struct file_operations def_blk_fops; |
1963 | extern const struct file_operations def_chr_fops; | 1963 | extern const struct file_operations def_chr_fops; |
1964 | extern const struct file_operations bad_sock_fops; | 1964 | extern const struct file_operations bad_sock_fops; |