lkml.org 
[lkml]   [2014]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V5 1/2] FS: Add generic data flush to fsync
On Mon, 12 May 2014 07:20:27 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> This patch issues a flush in generic_file_fsync.
> (Modern filesystems already do it)
>
> Behaviour can be reversed using /sys/devices/.../cache_type
> or by calling __generic_file_fsync

Well OK, but why? What effect does the patch have? Does it make the
kernel better and if so, how?

>
> +/**
> + * generic_file_fsync - generic fsync implementation for simple filesystems
> + * with flush
> + * @file: file to synchronize
> + * @start: start offset in bytes
> + * @end: end offset in bytes (inclusive)
> + * @datasync: only synchronize essential metadata if true
> + *
> + */
> +
> +int generic_file_fsync(struct file *file, loff_t start, loff_t end,
> + int datasync)
> +{
> + struct inode *inode = file->f_mapping->host;
> + int err;
> +
> + err = __generic_file_fsync(file, start, end, datasync);
> + if (err)
> + return err;
> +
> + return blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
> +
> +}

Documentation/SubmitChecklist, section 2b ;)


\
 
 \ /
  Last update: 2014-05-13 00:21    [W:0.054 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site