[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210713012522.70abe32e@linux.microsoft.com>
Date: Tue, 13 Jul 2021 01:25:22 +0200
From: Matteo Croce <mcroce@...ux.microsoft.com>
To: "Elliott, Robert (Servers)" <elliott@....com>
Cc: "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Lennart Poettering" <lennart@...ttering.net>,
Luca Boccassi <bluca@...ian.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
Damien Le Moal <damien.lemoal@....com>,
Tejun Heo <tj@...nel.org>,
Javier González <javier@...igon.com>,
Niklas Cassel <niklas.cassel@....com>,
Johannes Thumshirn <johannes.thumshirn@....com>,
Hannes Reinecke <hare@...e.de>,
Matthew Wilcox <willy@...radead.org>,
Christoph Hellwig <hch@...radead.org>,
JeffleXu <jefflexu@...ux.alibaba.com>
Subject: Re: [PATCH v4 3/5] block: add ioctl to read the disk sequence
number
On Mon, 12 Jul 2021 19:22:43 +0000
"Elliott, Robert (Servers)" <elliott@....com> wrote:
>
>
> > -----Original Message-----
> > From: Matteo Croce <mcroce@...ux.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@...rosoft.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?
>
>
Hi,
what's the difference with this?
case BLKGETSIZE64:
return put_u64(argp, i_size_read(bdev->bd_inode));
The returned int is an error code, not the diskseq value itself, e.g.
case BLKFRAGET:
if (!argp)
return -EINVAL;
Regards,
--
per aspera ad upstream
Powered by blists - more mailing lists