Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1328767
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Dave Chinner <david@fromorbit.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() |
| Date | Mon, 08 Feb 2016 06:20:02 +0100 |
| Message-ID | <qZMoW-vo-3@gated-at.bofh.it> (permalink) |
| References | <qZrNv-2K8-9@gated-at.bofh.it> <qZrXc-2O5-3@gated-at.bofh.it> <qZFGO-4aL-17@gated-at.bofh.it> <qZJ7I-6rS-9@gated-at.bofh.it> |
| X-Ironport-Anti-Spam-Filtered | true |
| X-Ironport-Anti-Spam-Result | A2AICgBLJLhWPBATLHldDhoBAoMPgT+GY4F4nUMDBotmhUSEB4YHBAICgSNNAQEBAQEBBwEBAQFBP4RCAQEEJxMcMwgDGAklDwUlAwcaARKIGrwqDB4YhTKEf4hsAQSWdY1HgWSHaYUvRIoog1KCZRmBDU8oLohTAQEB |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 53 |
| Organization | linux.* mail to news gateway |
| X-Original-Date | Mon, 8 Feb 2016 16:17:25 +1100 |
| X-Original-Message-ID | <20160208051725.GM31407@dastard> |
| X-Original-References | <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> <20160207220329.GK31407@dastard> <20160208014409.GA2343@linux.intel.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1328767 |
Show key headers only | View raw
On Sun, Feb 07, 2016 at 06:44:09PM -0700, Ross Zwisler wrote: > On Mon, Feb 08, 2016 at 09:03:29AM +1100, Dave Chinner wrote: > > On Sun, Feb 07, 2016 at 12:19:12AM -0700, Ross Zwisler wrote: > > > dax_clear_blocks() needs a valid struct block_device and previously it was > > > using inode->i_sb->s_bdev in all cases. This is correct for normal inodes > > > on mounted ext2, ext4 and XFS filesystems, but is incorrect for DAX raw > > > block devices and for XFS real-time devices. > > > > > > Instead, have the caller pass in a struct block_device pointer which it > > > knows to be correct. > > .... > > > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c > > > index 07ef29b..f722ba2 100644 > > > --- a/fs/xfs/xfs_bmap_util.c > > > +++ b/fs/xfs/xfs_bmap_util.c > > > @@ -73,9 +73,11 @@ xfs_zero_extent( > > > xfs_daddr_t sector = xfs_fsb_to_db(ip, start_fsb); > > > sector_t block = XFS_BB_TO_FSBT(mp, sector); > > > ssize_t size = XFS_FSB_TO_B(mp, count_fsb); > > > + struct inode *inode = VFS_I(ip); > > > > > > if (IS_DAX(VFS_I(ip))) > > > - return dax_clear_blocks(VFS_I(ip), block, size); > > > + return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), > > > + block, size); > > > > Get rid of the local inode variable and use VFS_I(ip) like the code > > originally did. Do not change code that is unrelated to the > > modifcation being made, especially when it results in making > > the code an inconsistent mess of mixed pointer constructs.... > > The local 'inode' variable was added to avoid multiple calls for VFS_I() for > the same 'ip'. My point is you didn't achieve that. The end result of your patch is: struct inode *inode = VFS_I(ip); if (IS_DAX(VFS_I(ip))) return dax_clear_blocks(inode, xfs_find_bdev_for_inode(inode), block, size); So now we have a local variable, but we still have 2 calls to VFS_I(ip). i.e. this makes the code harder to read and understand than before for no benefit. Cheers, Dave. -- Dave Chinner david@fromorbit.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] DAX bdev fixes - move flushing calls to FS Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-07 08:20 +0100
[PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-07 08:30 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dan Williams <dan.j.williams@intel.com> - 2016-02-07 19:20 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 02:50 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <zwisler@gmail.com> - 2016-02-08 05:40 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dave Chinner <david@fromorbit.com> - 2016-02-07 23:10 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 02:50 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Dave Chinner <david@fromorbit.com> - 2016-02-08 06:20 +0100
Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Ross Zwisler <ross.zwisler@linux.intel.com> - 2016-02-08 16:40 +0100
csiph-web