From: Dan Williams <dan.j.williams@intel.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, axboe@kernel.dk, riel@redhat.com,
linux-nvdimm@lists.01.org, david@fromorbit.com, hch@lst.de,
j.glisse@gmail.com, mgorman@suse.de,
linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org,
mingo@kernel.org
Subject: [PATCH v3 09/11] block: convert kmap helpers to kmap_atomic_pfn_t()
Date: Tue, 12 May 2015 00:30:17 -0400 [thread overview]
Message-ID: <20150512043017.11521.98110.stgit@dwillia2-desk3.amr.corp.intel.com> (raw)
In-Reply-To: <20150512042629.11521.70356.stgit@dwillia2-desk3.amr.corp.intel.com>
Convert the generic helpers to the __pfn_t version of kmap_atomic() in
support of generically enabling "page-less" block i/o.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
include/linux/bio.h | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/include/linux/bio.h b/include/linux/bio.h
index a569e6ea1cd2..6537d78e78b3 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -161,7 +161,7 @@ static inline void *bio_data(struct bio *bio)
* I/O completely on that queue (see ide-dma for example)
*/
#define __bio_kmap_atomic(bio, iter) \
- (kmap_atomic(bvec_page(bio_iter_iovec((bio), (iter)))) + \
+ (kmap_atomic_pfn_t(bio_iter_iovec((bio), (iter)).pfn) + \
bio_iter_iovec((bio), (iter)).bv_offset)
#define __bio_kunmap_atomic(addr) kunmap_atomic(addr)
@@ -491,7 +491,7 @@ static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
* balancing is a lot nicer this way
*/
local_irq_save(*flags);
- addr = (unsigned long) kmap_atomic(bvec_page(bvec));
+ addr = (unsigned long) kmap_atomic_pfn_t(bvec.pfn);
BUG_ON(addr & ~PAGE_MASK);
@@ -502,18 +502,21 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
{
unsigned long ptr = (unsigned long) buffer & PAGE_MASK;
- kunmap_atomic((void *) ptr);
+ kunmap_atomic_pfn_t((void *) ptr);
local_irq_restore(*flags);
}
#else
static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags)
{
- return page_address(bvec_page(bvec)) + bvec->bv_offset;
+ return kmap_atomic_pfn_t(bvec->bv_pfn) + bvec->bv_offset;
}
static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
{
+ unsigned long ptr = (unsigned long) buffer & PAGE_MASK;
+
+ kunmap_atomic_pfn_t((void *) ptr);
*flags = 0;
}
#endif
next prev parent reply other threads:[~2015-05-12 4:33 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 4:29 [PATCH v3 00/11] evacuate struct page from the block layer, introduce __pfn_t Dan Williams
2015-05-12 4:29 ` Dan Williams
2015-05-12 4:29 ` [PATCH v3 01/11] arch: introduce __pfn_t for persistenti/device memory Dan Williams
2015-05-12 4:29 ` Dan Williams
2015-05-12 4:29 ` [PATCH v3 02/11] block: add helpers for accessing a bio_vec page Dan Williams
2015-05-12 4:29 ` [PATCH v3 03/11] block: convert .bv_page to .bv_pfn bio_vec Dan Williams
2015-05-12 4:29 ` [PATCH v3 04/11] dma-mapping: allow archs to optionally specify a ->map_pfn() operation Dan Williams
2015-05-12 4:29 ` Dan Williams
2015-05-12 4:29 ` [PATCH v3 05/11] scatterlist: use sg_phys() Dan Williams
2015-05-12 4:29 ` Dan Williams
2015-05-12 5:24 ` Julia Lawall
2015-05-12 5:24 ` Julia Lawall
2015-05-12 5:44 ` Dan Williams
2015-05-12 5:44 ` Dan Williams
2015-05-12 4:30 ` [PATCH v3 06/11] scatterlist: support "page-less" (__pfn_t only) entries Dan Williams
2015-05-12 4:30 ` Dan Williams
2015-05-13 18:35 ` Williams, Dan J
2015-05-13 18:35 ` Williams, Dan J
2015-05-19 4:10 ` Vinod Koul
2015-05-20 16:03 ` Dan Williams
2015-05-23 14:12 ` hch
2015-05-23 16:41 ` Dan Williams
2015-05-23 16:41 ` Dan Williams
2015-05-12 4:30 ` [PATCH v3 07/11] x86: support dma_map_pfn() Dan Williams
2015-05-12 4:30 ` Dan Williams
2015-05-12 4:30 ` [PATCH v3 08/11] x86: support kmap_atomic_pfn_t() for persistent memory Dan Williams
2015-05-12 4:30 ` Dan Williams
2015-05-12 4:30 ` Dan Williams [this message]
2015-05-12 4:30 ` [PATCH v3 10/11] dax: convert to __pfn_t Dan Williams
2015-05-12 4:30 ` Dan Williams
2015-05-12 4:30 ` [PATCH v3 11/11] block: base support for pfn i/o Dan Williams
2015-05-12 4:30 ` Dan Williams
2015-05-23 14:32 ` [PATCH v3 00/11] evacuate struct page from the block layer, introduce __pfn_t Christoph Hellwig
2015-05-23 14:32 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150512043017.11521.98110.stgit@dwillia2-desk3.amr.corp.intel.com \
--to=dan.j.williams@intel.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=david@fromorbit.com \
--cc=hch@lst.de \
--cc=j.glisse@gmail.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=riel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).