]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
block: Stop using macro stubs for the bio data integrity calls
authorMartin K. Petersen <martin.petersen@oracle.com>
Fri, 13 Jan 2012 07:15:33 +0000 (08:15 +0100)
committerJens Axboe <axboe@kernel.dk>
Fri, 13 Jan 2012 07:15:33 +0000 (08:15 +0100)
Replace preprocessor macro stubs with real function declarations to
prevent warnings when CONFIG_BLK_DEV_INTEGRITY is disabled.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/bio.h

index 847994aef0e9755a3a39d76dd42f87c9f43d23be..129a9c097958f098827abe2243ab6fe1c033ca95 100644 (file)
@@ -515,24 +515,64 @@ extern void bio_integrity_init(void);
 
 #else /* CONFIG_BLK_DEV_INTEGRITY */
 
-#define bio_integrity(a)               (0)
-#define bioset_integrity_create(a, b)  (0)
-#define bio_integrity_prep(a)          (0)
-#define bio_integrity_enabled(a)       (0)
+static inline int bio_integrity(struct bio *bio)
+{
+       return 0;
+}
+
+static inline int bio_integrity_enabled(struct bio *bio)
+{
+       return 0;
+}
+
+static inline int bioset_integrity_create(struct bio_set *bs, int pool_size)
+{
+       return 0;
+}
+
+static inline void bioset_integrity_free (struct bio_set *bs)
+{
+       return;
+}
+
+static inline int bio_integrity_prep(struct bio *bio)
+{
+       return 0;
+}
+
+static inline void bio_integrity_free(struct bio *bio, struct bio_set *bs)
+{
+       return;
+}
+
 static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
                                      gfp_t gfp_mask, struct bio_set *bs)
 {
        return 0;
 }
-#define bioset_integrity_free(a)       do { } while (0)
-#define bio_integrity_free(a, b)       do { } while (0)
-#define bio_integrity_endio(a, b)      do { } while (0)
-#define bio_integrity_advance(a, b)    do { } while (0)
-#define bio_integrity_trim(a, b, c)    do { } while (0)
-#define bio_integrity_split(a, b, c)   do { } while (0)
-#define bio_integrity_set_tag(a, b, c) do { } while (0)
-#define bio_integrity_get_tag(a, b, c) do { } while (0)
-#define bio_integrity_init(a)          do { } while (0)
+
+static inline void bio_integrity_split(struct bio *bio, struct bio_pair *bp,
+                                      int sectors)
+{
+       return;
+}
+
+static inline void bio_integrity_advance(struct bio *bio,
+                                        unsigned int bytes_done)
+{
+       return;
+}
+
+static inline void bio_integrity_trim(struct bio *bio, unsigned int offset,
+                                     unsigned int sectors)
+{
+       return;
+}
+
+static inline void bio_integrity_init(void)
+{
+       return;
+}
 
 #endif /* CONFIG_BLK_DEV_INTEGRITY */