Skip to content

Commit

Permalink
lightnvm: assume 64-bit lba numbers
Browse files Browse the repository at this point in the history
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: a4bd217 ("lightnvm: physical block device (pblk) target")
Signed-off-by: Arnd Bergmann <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
arndb authored and axboe committed Apr 19, 2017
1 parent d0fac02 commit ef69790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/lightnvm/pblk.h
Original file line number Diff line number Diff line change
@@ -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 */
};

0 comments on commit ef69790

Please sign in to comment.