From: Andreas Dilger <adilger@turbolabs.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Mark Swanson <swansma@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: Request: removal of fs/fs.h/super_block.u to enable partition locking
Date: Wed, 19 Sep 2001 14:26:51 -0600 [thread overview]
Message-ID: <20010919142651.O14526@turbolinux.com> (raw)
In-Reply-To: <3BA7FF92.D6477904@yahoo.com> <E15jn1X-0003cU-00@the-village.bc.nu>
In-Reply-To: <E15jn1X-0003cU-00@the-village.bc.nu>
On Sep 19, 2001 20:28 +0100, Alan Cox wrote:
> > [Re: removing the fs union from struct inode]
>
> However you don't need to remove anything for that
No, but there are other things which will probably remove the union from
struct inode in 2.5. Since it is starting to get so huge, it is a penalty
for filesystems that don't need all of this space in each inode. Al Viro
has patches already to move some of the fs types into their own slab cache.
It may make sense to leave a small number of bytes inside the inode struct
(they would be used anyways for alignment/padding in the inode slab) for
filesystems that only have very small space requirements.
If you move the union to an external declaration, you can do things like:
static inline struct fs_inode_info *FSI(inode)
{
if (sizeof(union inode_fs_data) >= sizeof(struct fs_inode_info))
return (struct fs_inode_info *)&inode->u.generic_ip;
else
return (struct fs_inode_info *)inode->u.generic_ip;
}
and the compiler should pick one or the other by virtue of the fact that
it is comparing constants which can be resolved at compile time. Sadly
sizeof cannot be handled by the preprocessor so the following does not work:
#if sizeof(union inode_fs_data) >= sizeof(struct fs_inode_info)
#define FSI(inode) ((struct fs_inode_info *)&(inode)->u.generic_ip);
#else
#define FSI(inode) ((struct fs_inode_info *)(inode)->u.generic_ip);
#endif
which would guarantee that we do not bloat the code or impose run-time
overhead.
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
prev parent reply other threads:[~2001-09-19 20:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-19 2:14 Request: removal of fs/fs.h/super_block.u to enable partition locking Mark Swanson
2001-09-19 6:00 ` Andreas Dilger
2001-09-19 19:28 ` Alan Cox
2001-09-19 19:50 ` Mark Swanson
2001-09-19 21:52 ` Request: removal of fs/fs.h/super_block.u to enable partition Alan Cox
2001-09-19 23:16 ` Andreas Dilger
2001-09-19 23:06 ` Request: removal of fs/fs.h/super_block.u to enable partition locking Andreas Dilger
2001-09-19 20:26 ` Andreas Dilger [this message]
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=20010919142651.O14526@turbolinux.com \
--to=adilger@turbolabs.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=swansma@yahoo.com \
/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