Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1256150 > unrolled thread

[PATCH] blk-integrity: empty imlpementation when disabled

Started byKeith Busch <keith.busch@intel.com>
First post2015-10-26 17:40 +0100
Last post2015-10-26 18:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] blk-integrity: empty imlpementation when disabled Keith Busch <keith.busch@intel.com> - 2015-10-26 17:40 +0100
    Re: [PATCH] blk-integrity: empty imlpementation when disabled kbuild test robot <lkp@intel.com> - 2015-10-26 18:00 +0100

#1256150 — [PATCH] blk-integrity: empty imlpementation when disabled

FromKeith Busch <keith.busch@intel.com>
Date2015-10-26 17:40 +0100
Subject[PATCH] blk-integrity: empty imlpementation when disabled
Message-ID<qnSYr-26p-19@gated-at.bofh.it>
This patch moves the blk_integrity_payload definition outside the
CONFIG_BLK_DEV_INTERITY dependency and provides empty function
implementations when the kernel configuration disables integrity
extensions. This simplifies drivers that make use of these to map user
data so they don't need to repeat the same configuration checks.

Signed-off-by: Keith Busch <keith.busch@intel.com>
---
 include/linux/bio.h |   32 ++++++++++++++++++++++----------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/include/linux/bio.h b/include/linux/bio.h
index b9b6e04..f0c46d0 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -318,16 +318,6 @@ enum bip_flags {
 	BIP_IP_CHECKSUM		= 1 << 4, /* IP checksum */
 };
 
-#if defined(CONFIG_BLK_DEV_INTEGRITY)
-
-static inline struct bio_integrity_payload *bio_integrity(struct bio *bio)
-{
-	if (bio->bi_rw & REQ_INTEGRITY)
-		return bio->bi_integrity;
-
-	return NULL;
-}
-
 /*
  * bio integrity payload
  */
@@ -349,6 +339,16 @@ struct bio_integrity_payload {
 	struct bio_vec		bip_inline_vecs[0];/* embedded bvec array */
 };
 
+#if defined(CONFIG_BLK_DEV_INTEGRITY)
+
+static inline struct bio_integrity_payload *bio_integrity(struct bio *bio)
+{
+	if (bio->bi_rw & REQ_INTEGRITY)
+		return bio->bi_integrity;
+
+	return NULL;
+}
+
 static inline bool bio_integrity_flagged(struct bio *bio, enum bip_flags flag)
 {
 	struct bio_integrity_payload *bip = bio_integrity(bio);
@@ -795,6 +795,18 @@ static inline bool bio_integrity_flagged(struct bio *bio, enum bip_flags flag)
 	return false;
 }
 
+static inline void *bio_integrity_alloc(struct bio * bio, gfp_t gfp,
+								unsigned int nr)
+{
+	return NULL;
+}
+
+static inline int bio_integrity_add_page(struct bio *bio, struct page *page,
+					`unsigned int len, unsigned int offset)
+{
+	return 0;
+}
+
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
 
 #endif /* CONFIG_BLOCK */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1256169

Fromkbuild test robot <lkp@intel.com>
Date2015-10-26 18:00 +0100
Message-ID<qnThN-2d0-37@gated-at.bofh.it>
In reply to#1256150

[Multipart message — attachments visible in raw view] — view raw

Hi Keith,

[auto build test ERROR on v4.3-rc7 -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Keith-Busch/blk-integrity-empty-imlpementation-when-disabled/20151027-003330
config: i386-randconfig-r0-10252017 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   In file included from include/linux/blkdev.h:18:0,
                    from init/main.c:75:
>> include/linux/bio.h:805:6: error: stray '`' in program
         `unsigned int len, unsigned int offset)
         ^

vim +805 include/linux/bio.h

   799									unsigned int nr)
   800	{
   801		return NULL;
   802	}
   803	
   804	static inline int bio_integrity_add_page(struct bio *bio, struct page *page,
 > 805						`unsigned int len, unsigned int offset)
   806	{
   807		return 0;
   808	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web