From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751601AbZH0Rfr (ORCPT ); Thu, 27 Aug 2009 13:35:47 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751361AbZH0Rfn (ORCPT ); Thu, 27 Aug 2009 13:35:43 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:55198 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751185AbZH0Rfm (ORCPT ); Thu, 27 Aug 2009 13:35:42 -0400 Date: Thu, 27 Aug 2009 13:35:40 -0400 From: Christoph Hellwig To: Jan Kara Cc: LKML , hch@lst.de, linux-fsdevel@vger.kernel.org, Evgeniy Polyakov , ocfs2-devel@oss.oracle.com, Joel Becker , Felix Blyakher , xfs@oss.sgi.com, Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net, OGAWA Hirofumi , linux-ext4@vger.kernel.org, tytso@mit.edu Subject: Re: [PATCH 07/17] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode Message-ID: <20090827173540.GA19115@infradead.org> References: <1250875447-15622-1-git-send-email-jack@suse.cz> <1250875447-15622-8-git-send-email-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1250875447-15622-8-git-send-email-jack@suse.cz> User-Agent: Mutt/1.5.19 (2009-01-05) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +int generic_write_sync(struct file *file, loff_t pos, loff_t count) > +{ > + if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) > + return 0; > + return generic_sync_file(file, file->f_path.dentry, pos, > + pos + count - 1, > + SYNC_SUBMIT_DATA | SYNC_WAIT_DATA); > +} > +EXPORT_SYMBOL(generic_write_sync); > > +/* Flags for generic_sync_file */ > +#define SYNC_INODE 1 > +#define SYNC_SUBMIT_DATA 2 > +#define SYNC_WAIT_DATA 4 When I think about this more I really hate the latter two flags. There's really no reason to just do only either the submit or wait. I'd say kill the flags for now and just implement generic_write_sync as: int generic_write_sync(struct file *file, loff_t pos, loff_t count) { if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) return 0; return vfs_fsync_range(file, file->f_path.dentry, pos, pos + count - 1, 1); } and we can look into replacing the datasync flag with something more meaningfull later through the whole fsync stack. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id n7RHZGuC101594 for ; Thu, 27 Aug 2009 12:35:34 -0500 Date: Thu, 27 Aug 2009 13:35:40 -0400 From: Christoph Hellwig Subject: Re: [PATCH 07/17] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode Message-ID: <20090827173540.GA19115@infradead.org> References: <1250875447-15622-1-git-send-email-jack@suse.cz> <1250875447-15622-8-git-send-email-jack@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1250875447-15622-8-git-send-email-jack@suse.cz> List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: xfs-bounces@oss.sgi.com Errors-To: xfs-bounces@oss.sgi.com To: Jan Kara Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, linux-ntfs-dev@lists.sourceforge.net, Joel Becker , LKML , Anton Altaparmakov , OGAWA Hirofumi , linux-fsdevel@vger.kernel.org, Evgeniy Polyakov , xfs@oss.sgi.com, hch@lst.de, ocfs2-devel@oss.oracle.com > +int generic_write_sync(struct file *file, loff_t pos, loff_t count) > +{ > + if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) > + return 0; > + return generic_sync_file(file, file->f_path.dentry, pos, > + pos + count - 1, > + SYNC_SUBMIT_DATA | SYNC_WAIT_DATA); > +} > +EXPORT_SYMBOL(generic_write_sync); > > +/* Flags for generic_sync_file */ > +#define SYNC_INODE 1 > +#define SYNC_SUBMIT_DATA 2 > +#define SYNC_WAIT_DATA 4 When I think about this more I really hate the latter two flags. There's really no reason to just do only either the submit or wait. I'd say kill the flags for now and just implement generic_write_sync as: int generic_write_sync(struct file *file, loff_t pos, loff_t count) { if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) return 0; return vfs_fsync_range(file, file->f_path.dentry, pos, pos + count - 1, 1); } and we can look into replacing the datasync flag with something more meaningfull later through the whole fsync stack. _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Thu, 27 Aug 2009 17:35:52 -0000 Subject: [Ocfs2-devel] [PATCH 07/17] vfs: Introduce new helpers for syncing after writing to O_SYNC file or IS_SYNC inode In-Reply-To: <1250875447-15622-8-git-send-email-jack@suse.cz> References: <1250875447-15622-1-git-send-email-jack@suse.cz> <1250875447-15622-8-git-send-email-jack@suse.cz> Message-ID: <20090827173540.GA19115@infradead.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jan Kara Cc: LKML , hch@lst.de, linux-fsdevel@vger.kernel.org, Evgeniy Polyakov , ocfs2-devel@oss.oracle.com, Joel Becker , Felix Blyakher , xfs@oss.sgi.com, Anton Altaparmakov , linux-ntfs-dev@lists.sourceforge.net, OGAWA Hirofumi , linux-ext4@vger.kernel.org, tytso@mit.edu > +int generic_write_sync(struct file *file, loff_t pos, loff_t count) > +{ > + if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) > + return 0; > + return generic_sync_file(file, file->f_path.dentry, pos, > + pos + count - 1, > + SYNC_SUBMIT_DATA | SYNC_WAIT_DATA); > +} > +EXPORT_SYMBOL(generic_write_sync); > > +/* Flags for generic_sync_file */ > +#define SYNC_INODE 1 > +#define SYNC_SUBMIT_DATA 2 > +#define SYNC_WAIT_DATA 4 When I think about this more I really hate the latter two flags. There's really no reason to just do only either the submit or wait. I'd say kill the flags for now and just implement generic_write_sync as: int generic_write_sync(struct file *file, loff_t pos, loff_t count) { if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host)) return 0; return vfs_fsync_range(file, file->f_path.dentry, pos, pos + count - 1, 1); } and we can look into replacing the datasync flag with something more meaningfull later through the whole fsync stack.