From: Arnd Bergmann <arnd@arndb.de>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
tytso@mit.edu, sandeen@redhat.com, adilger.kernel@dilger.ca,
gregkh@suse.de, hch@infradead.org, axboe@kernel.dk
Subject: Re: [PATCH 2/2] Add BLKGETQUEUEINFO for reading block queue attributes
Date: Fri, 10 Dec 2010 19:39:20 +0100 [thread overview]
Message-ID: <201012101939.20984.arnd@arndb.de> (raw)
In-Reply-To: <1291908337-18805-3-git-send-email-lczerner@redhat.com>
On Thursday 09 December 2010 16:25:37 Lukas Czerner wrote:
> +enum blkq_info_type {
> + BLKQ_REQUESTS = 0,
> + BLKQ_RA,
> + BLKQ_MAX_HW_SECTORS,
> + BLKQ_MAX_SECTORS,
> + BLKQ_MAX_SEGMENTS,
> + BLKQ_MAX_INTEGRITY_SEGMENTS,
> + BLKQ_MAX_SEGMENT_SIZE,
> + BLKQ_IOSCHED,
> + BLKQ_HW_SECTOR_SIZE,
> + BLKQ_LOGICAL_BLOCK_SIZE,
> + BLKQ_PHYSICAL_BLOCK_SIZE,
> + BLKQ_IO_MIN,
> + BLKQ_IO_OPT,
> + BLKQ_DISCARD_GRANULARITY,
> + BLKQ_DISCARD_MAX,
> + BLKQ_DISCARD_ZEROES_DATA,
> + BLKQ_NONROT,
> + BLKQ_NOMERGES,
> + BLKQ_RQ_AFFINITY,
> + BLKQ_IOSTATS,
> + BLKQ_RANDOM,
> + BLKQ_END, /* Last item = quantity of items */
> +};
> +
> +struct blk_queue_info {
> + enum blkq_info_type type;
> + unsigned long data;
> +};
You are adding another indirection to an indirect system call
here. Besides the problems that Greg mentioned, this is
also really ugly. If it turns out that we want an ioctl interface
for this after all, better make it either one command per value,
or one data structure that contains all the values (plus some
reserved fields for future extensions).
Furthermore, you should use neither enum nor long data types
in a data structure that is used as an ABI. Use either __u32
or __u64 here, and make sure you have no padding in the middle
or at the end if you mix the two.
> diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
> index 30b8815..71bd06c 100644
> --- a/include/linux/sysfs.h
> +++ b/include/linux/sysfs.h
> @@ -112,6 +112,7 @@ struct bin_attribute {
> struct sysfs_ops {
> ssize_t (*show)(struct kobject *, struct attribute *,char *);
> ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
> + ssize_t (*get)(struct kobject *, struct attribute *, void *);
> };
>
This looks like it can significantly add to the .data size of the kernel.
Arnd
next prev parent reply other threads:[~2010-12-10 18:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 15:25 [RFC PATCH 0/2 v1] Ioctl for reading block queue information Lukas Czerner
2010-12-09 15:25 ` [PATCH 1/2] blk-sysfs: Clean-up attribute definitions Lukas Czerner
2010-12-09 15:25 ` [PATCH 2/2] Add BLKGETQUEUEINFO for reading block queue attributes Lukas Czerner
2010-12-10 18:39 ` Arnd Bergmann [this message]
2010-12-09 19:20 ` [RFC PATCH 0/2 v1] Ioctl for reading block queue information Greg KH
2010-12-09 19:49 ` Andreas Dilger
2010-12-09 19:54 ` Greg KH
2010-12-10 14:07 ` Lukas Czerner
2010-12-10 17:34 ` Greg KH
2010-12-10 17:59 ` Lukas Czerner
2010-12-10 18:25 ` Kay Sievers
2010-12-10 18:38 ` Lukas Czerner
2010-12-10 17:51 ` Kay Sievers
2010-12-10 17:54 ` Lukas Czerner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201012101939.20984.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=adilger.kernel@dilger.ca \
--cc=axboe@kernel.dk \
--cc=gregkh@suse.de \
--cc=hch@infradead.org \
--cc=lczerner@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox