linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Noll <maan@systemlinux.org>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Neil Brown <neilb@suse.de>, linux-raid <linux-raid@vger.kernel.org>
Subject: Re: [PATCH/Resend] md: Push down data integrity code to personalities.
Date: Thu, 6 Aug 2009 10:37:10 +0200	[thread overview]
Message-ID: <20090806083710.GJ5174@skl-net.de> (raw)
In-Reply-To: <yq163d4f8q6.fsf@sermon.lab.mkp.net>

[-- Attachment #1: Type: text/plain, Size: 2474 bytes --]

On 01:28, Martin K. Petersen wrote:
> >>>>> "Andre" == Andre Noll <maan@systemlinux.org> writes:
> 
> [Inlining blk_get_integrity]
> 
> Andre> IMO this second alternative is be a bit cleaner and it might help
> Andre> other users of blk_get_integrity() as well. Martin, are you OK
> Andre> with this change to blkdev.h?
> 
> Yeah, that's fine.

So here's a patch that replaces the dummy macros for data integrity
by inline functions. The patch is only compile-tesed, but that's
hopefully OK as the new functions are only used if data integrity is
not compiled in and are thrown away by gcc anyway.

Thanks
Andre

commit e550b6fe0850933d1be4c430a22d25f9040c7627
Author: Andre Noll <maan@systemlinux.org>
Date:   Thu Aug 6 10:32:37 2009 +0200

    [blkdev.h] Replace dummy macros by inline functions.
    
    This avoids complaints about unused variables and improves type checking.

diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 69103e0..81d683f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1191,14 +1191,47 @@ static inline int blk_integrity_rq(struct request *rq)
 
 #else /* CONFIG_BLK_DEV_INTEGRITY */
 
-#define blk_integrity_rq(rq)			(0)
-#define blk_rq_count_integrity_sg(a)		(0)
-#define blk_rq_map_integrity_sg(a, b)		(0)
-#define bdev_get_integrity(a)			(0)
-#define blk_get_integrity(a)			(0)
-#define blk_integrity_compare(a, b)		(0)
-#define blk_integrity_register(a, b)		(0)
-#define blk_integrity_unregister(a)		do { } while (0);
+static inline int blk_integrity_rq(struct request *rq)
+{
+	return 0;
+}
+
+static inline int blk_rq_count_integrity_sg(struct request *rq)
+{
+	return 0;
+}
+
+static inline
+int blk_rq_map_integrity_sg(struct request *rq, struct scatterlist *sglist)
+{
+	return 0;
+}
+
+static inline
+struct blk_integrity *bdev_get_integrity(struct block_device *bdev)
+{
+	return NULL;
+}
+
+static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk)
+{
+	return NULL;
+}
+
+static inline int blk_integrity_compare(struct gendisk *gd1, struct gendisk *gd2)
+{
+	return 0;
+}
+
+static inline
+int blk_integrity_register(struct gendisk *disk, struct blk_integrity *template)
+{
+	return 0;
+}
+
+static inline void blk_integrity_unregister(struct gendisk *disk)
+{
+}
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
 
-- 
The only person who always got his work done by Friday was Robinson Crusoe

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2009-08-06  8:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-01  8:38 [PATCH/Resend] md: Push down data integrity code to personalities Andre Noll
2009-07-07  3:42 ` Neil Brown
2009-07-07 13:44   ` Andre Noll
2009-07-07 22:10   ` Bill Davidsen
2009-07-13  8:54   ` Andre Noll
2009-07-31  5:06     ` Neil Brown
2009-08-03 16:40       ` Andre Noll
2009-08-04  5:28         ` Martin K. Petersen
2009-08-06  8:37           ` Andre Noll [this message]
2009-08-07  4:48             ` Martin K. Petersen
2009-08-06  3:31         ` Neil Brown
2009-08-07 16:46           ` Andre Noll

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=20090806083710.GJ5174@skl-net.de \
    --to=maan@systemlinux.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=neilb@suse.de \
    /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).