From: Andries.Brouwer@cwi.nl
To: aebr@win.tue.nl, akpm@osdl.org
Cc: Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: i_blksize
Date: Tue, 5 Aug 2003 11:20:02 +0200 (MEST) [thread overview]
Message-ID: <UTC200308050920.h759K2n21546.aeb@smtp.cwi.nl> (raw)
From: Andrew Morton <akpm@osdl.org>
> You propose to remove i_blksize.
> It is used in stat only, so we have to produce some value for stat.
> Do you want to replace
> inode->i_blksize
> by
> inode->i_sb->s_optimal_io_size
> ?
No, that's different. You are referring to stat.st_blksize. That is a
different animal, and we can leave that alone.
inode->i_blksize is equal to (1 << inode->i_blkbits) always, all the time.
It is just duplicated nonsense and usually leads to poorer code -
multiplications instead of shifts.
It should be a pretty easy incremental set of patches to ease i_blksize out
of the kernel.
Hmm. Let me first read stat.c.
generic_fillattr():
stat->blksize = inode->i_blksize;
vfs_getattr():
generic_fillattr(inode, stat);
if (!stat->blksize)
stat->blksize = s->s_blocksize;
cp_new_stat64():
tmp.st_blksize = stat->blksize;
copy_to_user(statbuf, &tmp, sizeof(tmp));
So really, if inode->i_blksize has a nonzero value,
this value is returned in stat.st_blksize.
Remains your other claim: inode->i_blksize == (1 << inode->i_blkbits).
I don't see any code that would enforce that.
Andries
[and there are lots of comments around:
inode->i_blksize = PAGE_SIZE; /* This is the optimal IO size ... */
]
Maybe also a good candidate for renaming if it is not eliminated?
next reply other threads:[~2003-08-05 9:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-05 9:20 Andries.Brouwer [this message]
2003-08-05 15:55 ` i_blksize Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2003-08-05 19:48 i_blksize Andries.Brouwer
2003-08-05 16:27 i_blksize Andries.Brouwer
2003-08-05 17:50 ` i_blksize Andrew Morton
2003-08-05 18:09 ` i_blksize Andreas Dilger
2003-08-04 2:03 do_div considered harmful Andries.Brouwer
2003-08-04 2:29 ` Andrew Morton
2003-08-05 2:58 ` i_blksize Andries Brouwer
2003-08-05 6:10 ` i_blksize Andrew Morton
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=UTC200308050920.h759K2n21546.aeb@smtp.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=aebr@win.tue.nl \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/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;
as well as URLs for NNTP newsgroup(s).