From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 2DBB97CA2 for ; Sun, 7 Feb 2016 19:46:12 -0600 (CST) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay1.corp.sgi.com (Postfix) with ESMTP id EB2768F8049 for ; Sun, 7 Feb 2016 17:46:11 -0800 (PST) Received: from mga04.intel.com ([192.55.52.120]) by cuda.sgi.com with ESMTP id iuL2AcHzymiUKyMp for ; Sun, 07 Feb 2016 17:46:11 -0800 (PST) Date: Sun, 7 Feb 2016 18:46:01 -0700 From: Ross Zwisler Subject: Re: [PATCH 1/2] dax: pass bdev argument to dax_clear_blocks() Message-ID: <20160208014601.GB2343@linux.intel.com> References: <1454829553-29499-1-git-send-email-ross.zwisler@linux.intel.com> <1454829553-29499-2-git-send-email-ross.zwisler@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: Dan Williams Cc: Theodore Ts'o , "linux-nvdimm@lists.01.org" , "linux-kernel@vger.kernel.org" , XFS Developers , Linux MM , Andreas Dilger , Alexander Viro , Jan Kara , linux-fsdevel , Matthew Wilcox , Ross Zwisler , linux-ext4 , Andrew Morton On Sun, Feb 07, 2016 at 10:19:29AM -0800, Dan Williams wrote: > On Sat, Feb 6, 2016 at 11:19 PM, 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. > > > > Signed-off-by: Ross Zwisler > > --- > > fs/dax.c | 4 ++-- > > fs/ext2/inode.c | 5 +++-- > > fs/xfs/xfs_aops.c | 2 +- > > fs/xfs/xfs_aops.h | 1 + > > fs/xfs/xfs_bmap_util.c | 4 +++- > > include/linux/dax.h | 3 ++- > > 6 files changed, 12 insertions(+), 7 deletions(-) > > > > diff --git a/fs/dax.c b/fs/dax.c > > index 227974a..4592241 100644 > > --- a/fs/dax.c > > +++ b/fs/dax.c > > @@ -83,9 +83,9 @@ struct page *read_dax_sector(struct block_device *bdev, sector_t n) > > * and hence this means the stack from this point must follow GFP_NOFS > > * semantics for all operations. > > */ > > -int dax_clear_blocks(struct inode *inode, sector_t block, long _size) > > +int dax_clear_blocks(struct inode *inode, struct block_device *bdev, > > + sector_t block, long _size) > > Since this is a bdev relative routine we should also resolve the > sector, i.e. the signature should drop the inode: > > int dax_clear_sectors(struct block_device *bdev, sector_t sector, long _size) The inode is still needed because dax_clear_blocks() needs inode->i_blkbits. Unless there is some easy way to get this from the bdev that I'm not seeing? _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs