Re: [dm-devel] [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument

2020-02-20 Thread Matthew Wilcox
On Wed, Feb 12, 2020 at 12:07:28PM -0500, Vivek Goyal wrote: > +int dax_pgoff(sector_t dax_offset, sector_t sector, size_t size, pgoff_t > *pgoff) > +{ > + phys_addr_t phys_off = (dax_offset + sector) * 512; > + > + if (pgoff) > + *pgoff = PHYS_PFN(phys_off); > + if

Re: [dm-devel] [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument

2020-02-17 Thread Christoph Hellwig
On Wed, Feb 12, 2020 at 12:07:28PM -0500, Vivek Goyal wrote: > Create a new helper dax_pgoff() which will replace bdev_dax_pgoff(). > Difference > between two is that dax_pgoff() takes in "sector_t dax_offset" as an argument > instead of "struct block_device". > > dax_offset specifies any offset

[dm-devel] [PATCH 1/6] dax: Define a helper dax_pgoff() which takes in dax_offset as argument

2020-02-12 Thread Vivek Goyal
Create a new helper dax_pgoff() which will replace bdev_dax_pgoff(). Difference between two is that dax_pgoff() takes in "sector_t dax_offset" as an argument instead of "struct block_device". dax_offset specifies any offset into dax device which should be added to sector while calculating pgoff.