From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.kernel.org ([198.145.29.99]:37928 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751197AbeERR4P (ORCPT ); Fri, 18 May 2018 13:56:15 -0400 Message-ID: <750c0197e6891caf348c4766396fb569db4f3e1f.camel@kernel.org> Subject: Re: [RFC PATCH 01/11] vfs: push __sync_blockdev calls down into sync_fs routines From: Jeff Layton To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@ZenIV.linux.org.uk, willy@infradead.org, andres@anarazel.de Date: Fri, 18 May 2018 13:56:07 -0400 In-Reply-To: <20180518155636.GB16931@infradead.org> References: <20180518123415.28181-1-jlayton@kernel.org> <20180518123415.28181-2-jlayton@kernel.org> <20180518155636.GB16931@infradead.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, 2018-05-18 at 08:56 -0700, Christoph Hellwig wrote: > > --- a/fs/xfs/xfs_super.c > > +++ b/fs/xfs/xfs_super.c > > @@ -1097,7 +1097,7 @@ xfs_fs_sync_fs( > > * Doing anything during the async pass would be counterproductive. > > */ > > if (!wait) > > - return 0; > > + goto out; > > > > xfs_log_force(mp, XFS_LOG_SYNC); > > if (laptop_mode) { > > @@ -1108,8 +1108,8 @@ xfs_fs_sync_fs( > > */ > > flush_delayed_work(&mp->m_log->l_work); > > } > > - > > - return 0; > > +out: > > + return __sync_blockdev(sb->s_bdev, wait); > > XFS never uses the block device mapping for anything, so this is > not needed. > Thanks, I wasn't sure about xfs. I'll drop this hunk. FWIW, I think pushing this call down into the sync_fs routines is still probably the right thing to do, regardless of the state of the later patches. > > +/* > > + * Many legacy filesystems don't have a sync_fs op. For them, we just flush > > + * the block device (if there is one). > > + */ > > +static inline int call_sync_fs(struct super_block *sb, int wait) > > +{ > > + if (sb->s_op->sync_fs) > > + return sb->s_op->sync_fs(sb, wait); > > + return __sync_blockdev(sb->s_bdev, wait); > > +} > > The proper name for this would be vfs_sync_fs. And I don't think it > warrants an inline. I patterned the name after the call_mmap (and now-defunct call_fsync) helpers. I'll rename it and change it to be non-inlined. Thanks, -- Jeff Layton