lkml.org 
[lkml]   [2020]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 4/9] block: add a new revalidate_disk_size helper
On Tue, Sep 1, 2020 at 9:00 AM Christoph Hellwig <hch@lst.de> wrote:
>
[...]

> drivers/md/md-cluster.c | 6 ++---
> drivers/md/md-linear.c | 2 +-
> drivers/md/md.c | 10 ++++-----

For md bits:
Acked-by: Song Liu <song@kernel.org>

[...]
>
> +/**
> + * revalidate_disk_size - checks for disk size change and adjusts bdev size.
> + * @disk: struct gendisk to check
> + * @verbose: if %true log a message about a size change if there is any
> + *
> + * This routine checks to see if the bdev size does not match the disk size
> + * and adjusts it if it differs. When shrinking the bdev size, its all caches
> + * are freed.
> + */
> +void revalidate_disk_size(struct gendisk *disk, bool verbose)
> +{
> + struct block_device *bdev;
> +
> + /*
> + * Hidden disks don't have associated bdev so there's no point in
> + * revalidating them.
> + */
> + if (disk->flags & GENHD_FL_HIDDEN)
> + return;
> +
> + bdev = bdget_disk(disk, 0);
> + if (bdev) {
> + check_disk_size_change(disk, bdev, verbose);
> + bdput(bdev);
> + }
> +}
> +EXPORT_SYMBOL(revalidate_disk_size);

Shall we use EXPORT_SYMBOL_GPL() here?

[...]

\
 
 \ /
  Last update: 2020-09-02 08:07    [W:0.626 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site