All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org, dhowells@redhat.com,
	dedekind@infradead.org
Subject: [PATCH 3/3] ubifs: remove manual O_SYNC handling
Date: Wed, 30 Sep 2009 22:17:16 +0200	[thread overview]
Message-ID: <20090930201716.GD18503@lst.de> (raw)
In-Reply-To: <20090930201608.GA18503@lst.de>

generic_file_aio_write already calls into ->fsync to handle O_SYNC/O_DSYNC.
Remove the duplicate call to ubifs_sync_wbufs_by_inode which is already
covered by ubifs_fsync.

Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/ubifs/file.c
===================================================================
--- linux-2.6.orig/fs/ubifs/file.c	2009-09-30 14:01:26.046278266 -0300
+++ linux-2.6/fs/ubifs/file.c	2009-09-30 14:02:16.850272504 -0300
@@ -1389,7 +1389,6 @@ static ssize_t ubifs_aio_write(struct ki
 			       unsigned long nr_segs, loff_t pos)
 {
 	int err;
-	ssize_t ret;
 	struct inode *inode = iocb->ki_filp->f_mapping->host;
 	struct ubifs_info *c = inode->i_sb->s_fs_info;
 
@@ -1397,17 +1396,7 @@ static ssize_t ubifs_aio_write(struct ki
 	if (err)
 		return err;
 
-	ret = generic_file_aio_write(iocb, iov, nr_segs, pos);
-	if (ret < 0)
-		return ret;
-
-	if (ret > 0 && (IS_SYNC(inode) || iocb->ki_filp->f_flags & O_DSYNC)) {
-		err = ubifs_sync_wbufs_by_inode(c, inode);
-		if (err)
-			return err;
-	}
-
-	return ret;
+	return generic_file_aio_write(iocb, iov, nr_segs, pos);
 }
 
 static int ubifs_set_page_dirty(struct page *page)

  parent reply	other threads:[~2009-09-30 20:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 20:16 sort out lose ends after the O_SYNC series Christoph Hellwig
2009-09-30 20:16 ` [PATCH 1/3] kill wait_on_page_writeback_range Christoph Hellwig
2009-10-01 11:20   ` Jan Kara
2009-09-30 20:16 ` [PATCH 2/3]: afs: remove manual O_SYNC handling Christoph Hellwig
2009-10-01 10:42   ` David Howells
2009-09-30 20:17 ` Christoph Hellwig [this message]
2009-10-01  7:39   ` [PATCH 3/3] ubifs: " Artem Bityutskiy
2009-10-01  7:42     ` Artem Bityutskiy
2009-10-01 11:14       ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090930201716.GD18503@lst.de \
    --to=hch@lst.de \
    --cc=dedekind@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.