-
Notifications
You must be signed in to change notification settings - Fork 93
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 cocci patch for fs_dax_get_by_bdev
The fs_dax_get_by_bdev helper only appeared in 2017, before there was fs_dax_get_by_host. Since fs_dax_get_by_bdev at the time of the transition was almost trivially based on fs_dax_get_by_host, just open code the function.
- Loading branch information
1 parent
eacd742
commit ba10add
Showing
3 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
drbd/drbd-kernel-compat/cocci/fs_dax_get_by_bdev__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,8 @@ | ||
@@ | ||
expression b; | ||
identifier d; | ||
@@ | ||
- d = fs_dax_get_by_bdev(b); | ||
+ if (!blk_queue_dax(b ->bd_queue)) | ||
+ return -ENODEV; | ||
+ d = fs_dax_get_by_host(b->bd_disk->disk_name); |
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,9 @@ | ||
/* { "version": "v4.13-rc7", "commit": "78f35473508118df5ea04b9515ac3f1aaec0a980", "comment": "fs_dax_get_by_bdev was introduced", "author": "Dan Williams <dan.j.williams@intel.com>", "date": "Wed Aug 30 09:16:38 2017 -0700" } */ | ||
|
||
#include <linux/blkdev.h> | ||
#include <linux/dax.h> | ||
|
||
struct dax_device *foo(struct block_device *bdev) | ||
{ | ||
return fs_dax_get_by_bdev(bdev); | ||
} |