Skip to content

Commit 60b0680

Browse files
jankaraAl Viro
authored andcommitted
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>
1 parent c15c54f commit 60b0680

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎fs/block_dev.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int fsync_bdev(struct block_device *bdev)
204204
{
205205
struct super_block *sb = get_super(bdev);
206206
if (sb) {
207-
int res = fsync_super(sb);
207+
int res = sync_filesystem(sb);
208208
drop_super(sb);
209209
return res;
210210
}
@@ -246,7 +246,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
246246
sb->s_frozen = SB_FREEZE_WRITE;
247247
smp_wmb();
248248

249-
fsync_super(sb);
249+
sync_filesystem(sb);
250250

251251
sb->s_frozen = SB_FREEZE_TRANS;
252252
smp_wmb();

‎fs/cachefiles/interface.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void cachefiles_sync_cache(struct fscache_cache *_cache)
354354
/* make sure all pages pinned by operations on behalf of the netfs are
355355
* written to disc */
356356
cachefiles_begin_secure(cache, &saved_cred);
357-
ret = fsync_super(cache->mnt->mnt_sb);
357+
ret = sync_filesystem(cache->mnt->mnt_sb);
358358
cachefiles_end_secure(cache, saved_cred);
359359

360360
if (ret == -EIO)

‎fs/super.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <linux/blkdev.h>
2929
#include <linux/quotaops.h>
3030
#include <linux/namei.h>
31-
#include <linux/buffer_head.h> /* for fsync_super() */
3231
#include <linux/mount.h>
3332
#include <linux/security.h>
3433
#include <linux/syscalls.h>
@@ -304,7 +303,7 @@ void generic_shutdown_super(struct super_block *sb)
304303

305304
if (sb->s_root) {
306305
shrink_dcache_for_umount(sb);
307-
fsync_super(sb);
306+
sync_filesystem(sb);
308307
lock_super(sb);
309308
sb->s_flags &= ~MS_ACTIVE;
310309

@@ -543,7 +542,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
543542
if (flags & MS_RDONLY)
544543
acct_auto_close(sb);
545544
shrink_dcache_sb(sb);
546-
fsync_super(sb);
545+
sync_filesystem(sb);
547546

548547
/* If we are remounting RDONLY and current sb is read/write,
549548
make sure there are no rw files opened */

‎fs/sync.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* case write_inode() functions do sync_dirty_buffer() and thus effectively
2626
* write one block at a time.
2727
*/
28-
static int __fsync_super(struct super_block *sb, int wait)
28+
static int __sync_filesystem(struct super_block *sb, int wait)
2929
{
3030
vfs_dq_sync(sb);
3131
sync_inodes_sb(sb, wait);
@@ -43,16 +43,16 @@ static int __fsync_super(struct super_block *sb, int wait)
4343
* superblock. Filesystem data as well as the underlying block
4444
* device. Takes the superblock lock.
4545
*/
46-
int fsync_super(struct super_block *sb)
46+
int sync_filesystem(struct super_block *sb)
4747
{
4848
int ret;
4949

50-
ret = __fsync_super(sb, 0);
50+
ret = __sync_filesystem(sb, 0);
5151
if (ret < 0)
5252
return ret;
53-
return __fsync_super(sb, 1);
53+
return __sync_filesystem(sb, 1);
5454
}
55-
EXPORT_SYMBOL_GPL(fsync_super);
55+
EXPORT_SYMBOL_GPL(sync_filesystem);
5656

5757
/*
5858
* Sync all the data for all the filesystems (called by sys_sync() and
@@ -92,7 +92,7 @@ static void sync_filesystems(int wait)
9292
spin_unlock(&sb_lock);
9393
down_read(&sb->s_umount);
9494
if (sb->s_root)
95-
__fsync_super(sb, wait);
95+
__sync_filesystem(sb, wait);
9696
up_read(&sb->s_umount);
9797
/* restart only when sb is no longer on the list */
9898
spin_lock(&sb_lock);

‎include/linux/fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
19581958
return 0;
19591959
}
19601960
#endif
1961-
extern int fsync_super(struct super_block *);
1961+
extern int sync_filesystem(struct super_block *);
19621962
extern const struct file_operations def_blk_fops;
19631963
extern const struct file_operations def_chr_fops;
19641964
extern const struct file_operations bad_sock_fops;

0 commit comments

Comments
 (0)