[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 1/3] block: Add invalidate_gendisk() helper to invalidate the gendisk



On Mon, Sep 13, 2021 at 07:25:55PM +0800, Xie Yongji wrote:
>  
> +/**
> + * invalidate_gendisk - invalidate the gendisk
> + * @disk: the struct gendisk to invalidate
> + *
> + * A helper to invalidates the gendisk. It will clean the gendisk's associated
> + * buffer/page caches and reset its internal states so that the gendisk
> + * can be reused by the drivers.
> + *
> + * Context: can sleep
> + */
> +
> +void invalidate_gendisk(struct gendisk *disk)

No need for the empty line.  Also I wonder if invalidate_disk might be a
better name - except for del_gendisk we don't really use _gendisk in
function names at all.

> +extern void invalidate_gendisk(struct gendisk *gp);

No need for the extern.  Also I'd name the argument disk, just as in
the actual implementation.

The actual functionality looks good to me despite these nitpicks.


Reply to: