lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRE: [PATCH v4 3/5] block: add ioctl to read the disk sequence number
Date


> -----Original Message-----
> From: Matteo Croce <mcroce@linux.microsoft.com>
> Sent: Sunday, July 11, 2021 12:54 PM
...
> Subject: [PATCH v4 3/5] block: add ioctl to read the disk sequence number
>
> From: Matteo Croce <mcroce@microsoft.com>
>
> Add a new BLKGETDISKSEQ ioctl which retrieves the disk sequence number
> from the genhd structure.
...


Given:
static int put_u64(u64 __user *argp, u64 val)
{
return put_user(val, argp);
}

> diff --git a/block/ioctl.c b/block/ioctl.c
> index 24beec9ca9c9..0c3a4a53fa11 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -469,6 +469,8 @@ static int blkdev_common_ioctl(struct block_device
> *bdev, fmode_t mode,
> BLKDEV_DISCARD_SECURE);
...

> + case BLKGETDISKSEQ:
> + return put_u64(argp, bdev->bd_disk->diskseq);

How does that work on a system in which int is 32 bits?


\
 
 \ /
  Last update: 2021-07-12 21:25    [W:0.079 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site