Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compat: test and compat patch for bdev_nr_sectors
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
drbd/drbd-kernel-compat/cocci/bdev_nr_sectors__no_present.cocci
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@@ | ||
struct block_device *bd; | ||
@@ | ||
- bdev_nr_sectors(bd) | ||
+ get_capacity(bd->bd_disk) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* { "version": "v5.10-rc5", "commit": "a782483cc1f875355690625d8253a232f2581418", "comment": "the bdev_nr_sectors helper was introduced", "author": "Christoph Hellwig <hch@lst.de>", "date": "Thu Nov 26 18:43:37 2020 +0100" } */ | ||
|
||
#include <linux/blkdev.h> | ||
|
||
sector_t foo(struct block_device *bdev) | ||
{ | ||
return bdev_nr_sectors(bdev); | ||
} |