From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] fat: optimize fat_count_free_clusters()
Date: Tue, 06 Nov 2007 11:07:12 +0900 [thread overview]
Message-ID: <87pryom8j3.fsf@duaron.myhome.or.jp> (raw)
In-Reply-To: <20071105164954.ac568ba3.akpm@linux-foundation.org> (Andrew Morton's message of "Mon\, 5 Nov 2007 16\:49\:54 -0800")
Andrew Morton <akpm@linux-foundation.org> writes:
>> +/* 128kb is the whole sectors for FAT12 and FAT16 */
>> +#define FAT_READA_SIZE (128 * 1024)
>> +
>> +static void fat_ent_reada(struct super_block *sb, struct fat_entry *fatent,
>> + unsigned long reada_blocks)
>> +{
>> + struct fatent_operations *ops = MSDOS_SB(sb)->fatent_ops;
>> + sector_t blocknr;
>> + int i, offset;
>> +
>> + ops->ent_blocknr(sb, fatent->entry, &offset, &blocknr);
>> +
>> + for (i = 0; i < reada_blocks; i++)
>> + sb_breadahead(sb, blocknr + i);
>> +}
>
> You might find that it's simpler and faster to call
> page_cache_sync_readahead() against sb->s_bdev->bd_inode->i_mapping.
>
> Or maybe not - that requires a struct file_ra_state. We _used_ to have a
> nice simple read-some-stuff-into-pagecache function which didn't need an
> ra_state but that seems to have disappeared in the various recent readahead
> churn. Oh well.
Yes. I found it, but I gave up for now by file_ra_state. Also I'd like
to use a large block to read FAT. I'll rethink this code after large
block was merged.
Thanks.
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
prev parent reply other threads:[~2007-11-06 2:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 22:09 [PATCH 2/2] fat: optimize fat_count_free_clusters() OGAWA Hirofumi
2007-11-06 0:49 ` Andrew Morton
2007-11-06 2:07 ` OGAWA Hirofumi [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=87pryom8j3.fsf@duaron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.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