LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Chinner <dgc@sgi.com>
To: mmarek@suse.cz
Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS in compat mode
Date: Thu, 28 Jun 2007 13:49:57 +1000 [thread overview]
Message-ID: <20070628034957.GE989688@sgi.com> (raw)
In-Reply-To: <20070619132726.893544847@suse.cz>
On Tue, Jun 19, 2007 at 03:25:52PM +0200, mmarek@suse.cz wrote:
> * 32bit struct xfs_fsop_bulkreq has different size and layout of
> members, no matter the alignment. Move the code out of the #else
> branch (why was it there in the first place?). Define _32 variants of
> the ioctl constants.
> * 32bit struct xfs_bstat is different because of time_t and on
> i386 becaus of different padding. Create a new formatter
> xfs_bulkstat_one_compat() that takes care of this. To do this, we need
> to make xfs_bulkstat_one_iget() and xfs_bulkstat_one_dinode()
> non-static.
> * i386 struct xfs_inogrp has different padding. Introduce a similar
> "formatter" mechanism for xfs_inumbers: the native formatter is just a
> copy_to_user, the compat formatter takes care of the different layout
Oh, wow, that is so much nicer than the first version, Michal. ;)
Still, I think there's possibly one further revision:
> +static int xfs_bulkstat_one_compat(
> + xfs_mount_t *mp, /* mount point for filesystem */
> + xfs_ino_t ino, /* inode number to get data for */
> + void __user *buffer, /* buffer to place output in */
> + int ubsize, /* size of buffer */
> + void *private_data, /* my private data */
> + xfs_daddr_t bno, /* starting bno of inode cluster */
> + int *ubused, /* bytes used by me */
> + void *dibuff, /* on-disk inode buffer */
> + int *stat) /* BULKSTAT_RV_... */
Hmmm - this is almost all duplicated code. It's pretty much what I
described, but maybe not /quite/ what I had in mind here. It's a
*big* improvement on the first version, but it seems now that the
only real difference xfs_bulkstat_one() and
xfs_bulkstat_one_compat() is copy_to_user() vs the discrete put_user
calls.
I think we can remove xfs_bulkstat_one_compat() completely by using
the same method you used with the xfs_inumber_fmt functions. That
would mean the only duplicated code is the initial ioctl handling
(which we can't really avoid). It would also mean that there is no
need to make xfs_bulkstat_one_iget() and xfs_bulkstat_one_dinode()
non-static. Your thoughts?
Other than that possible improvement, this looks really good.
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
next prev parent reply other threads:[~2007-06-28 3:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-19 13:25 [patch 0/3] Fix for XFS compat ioctls (try2) mmarek
2007-06-19 13:25 ` [patch 1/3] Fix XFS_IOC_FSGEOMETRY_V1 in compat mode mmarek
2007-06-28 3:06 ` David Chinner
2007-06-19 13:25 ` [patch 2/3] Fix XFS_IOC_*_TO_HANDLE and XFS_IOC_{OPEN,READLINK}_BY_HANDLE " mmarek
2007-06-28 3:07 ` David Chinner
2007-06-19 13:25 ` [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS " mmarek
2007-06-28 3:49 ` David Chinner [this message]
2007-07-02 9:40 ` Michal Marek
2007-07-02 15:05 ` [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS in compat mode (try3) Michal Marek
2007-07-03 1:03 ` David Chinner
2007-06-28 18:15 ` [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS in compat mode Andrew Morton
2007-06-29 11:02 ` Michal Marek
-- strict thread matches above, loose matches on Subject: below --
2007-05-30 12:59 [patch 0/3] Fix for XFS compat ioctls Michal Marek
2007-05-30 12:59 ` [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS in compat mode Michal Marek
2007-05-31 6:37 ` David Chinner
2007-05-31 8:52 ` Michal Marek
2007-05-31 13:03 ` David Chinner
2007-05-31 7:06 ` Arnd Bergmann
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=20070628034957.GE989688@sgi.com \
--to=dgc@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=xfs@oss.sgi.com \
--subject='Re: [patch 3/3] Fix XFS_IOC_FSBULKSTAT{,_SINGLE} and XFS_IOC_FSINUMBERS in compat mode' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).