diff options
author | Xie Yongji <xieyongji@bytedance.com> | 2021-09-22 15:37:08 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-21 19:12:41 +0300 |
commit | f059a1d2e23a165bf86e33673c6a7535a08c6341 (patch) | |
tree | c009d3e5c96d7848902627704c613bb324156dd4 /include | |
parent | e94f68527a35271131cdf9d3fb4eb3c2513dc3d0 (diff) | |
download | linux-f059a1d2e23a165bf86e33673c6a7535a08c6341.tar.xz |
block: Add invalidate_disk() helper to invalidate the gendisk
To hide internal implementation and simplify some driver code,
this adds a helper to invalidate the gendisk. It will clean the
gendisk's associated buffer/page caches and reset its internal
states.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210922123711.187-2-xieyongji@bytedance.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/genhd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c70bc5fce4db..13f313ab99e7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -213,6 +213,8 @@ static inline int add_disk(struct gendisk *disk) } extern void del_gendisk(struct gendisk *gp); +void invalidate_disk(struct gendisk *disk); + void set_disk_ro(struct gendisk *disk, bool read_only); static inline int get_disk_ro(struct gendisk *disk) |