lightnvm: assume 64-bit lba numbers
authorArnd Bergmann <arnd@arndb.de>
Wed, 19 Apr 2017 17:39:13 +0000 (19:39 +0200)
committerJens Axboe <axboe@fb.com>
Wed, 19 Apr 2017 18:07:28 +0000 (12:07 -0600)
The driver uses both u64 and sector_t to refer to offsets, and assigns between the
two. This causes one harmless warning when sector_t is 32-bit:

drivers/lightnvm/pblk-rb.c: In function 'pblk_rb_write_entry_gc':
include/linux/lightnvm.h:215:20: error: large integer implicitly truncated to unsigned type [-Werror=overflow]
drivers/lightnvm/pblk-rb.c:324:22: note: in expansion of macro 'ADDR_EMPTY'

As the driver is already doing this inconsistently, changing the type
won't make it worse and is an easy way to avoid the warning.

Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/pblk.h

index c82120ce3be58ef14aa2ea0822b3738bd1390c69..11ed7d83f572053d98c69a33cce2541e9dd2ccf8 100644 (file)
@@ -119,7 +119,7 @@ struct pblk_w_ctx {
        struct bio_list bios;           /* Original bios - used for completion
                                         * in REQ_FUA, REQ_FLUSH case
                                         */
-       sector_t lba;                   /* Logic addr. associated with entry */
+       u64 lba;                        /* Logic addr. associated with entry */
        struct ppa_addr ppa;            /* Physic addr. associated with entry */
        int flags;                      /* Write context flags */
 };