Re: [PATCH 4/6] vfs: Reorder operations during sys_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good except for some minor comments below:


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

> diff --git a/fs/sync.c b/fs/sync.c
> index 3367d04..5fbeee6 100644
> --- a/fs/sync.c
> +++ b/fs/sync.c
> @@ -68,18 +68,26 @@ int sync_filesystem(struct super_block *sb)
>  }
>  EXPORT_SYMBOL_GPL(sync_filesystem);
>  
> -static void sync_one_sb(struct super_block *sb, void *arg)
> +static void sync_inodes_one_sb(struct super_block *sb, void *arg)
>  {
> -	if (!(sb->s_flags & MS_RDONLY))
> -		__sync_filesystem(sb, *(int *)arg);
> +	if (!(sb->s_flags & MS_RDONLY)) {
> +		if (!*(int *)arg)
> +			writeback_inodes_sb(sb);
> +		else
> +			sync_inodes_sb(sb);
> +	}

This would be a lot cleaner if you split it into two functions for
the writeback_inodes_sb and sync_inodes_sb cases.

>  }
> -/*
> - * Sync all the data for all the filesystems (called by sys_sync() and
> - * emergency sync)
> - */
> -static void sync_filesystems(int wait)
> +
> +static void sync_fs_one_sb(struct super_block *sb, void *arg)
>  {
> -	iterate_supers(sync_one_sb, &wait);
> +	if (!(sb->s_flags & MS_RDONLY) && sb->s_op->sync_fs)
> +		sb->s_op->sync_fs(sb, *(int *)arg);
> +}
> +
> +static void sync_blkdev_one_sb(struct super_block *sb, void *arg)
> +{
> +	if (!(sb->s_flags & MS_RDONLY))
> +		__sync_blockdev(sb->s_bdev, *(int *)arg);
>  }

Same here, not having these odd wait/nowait arguments whos address
is taken in the caller would make the thing a lot more readable.

It would also allow to kill of that nasty __sync_blockdev interface
eventually.

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux