Re: [Ocfs2-devel] [PATCH 1/3] ext3/ext4: Factor out disk addressability check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 12, 2010 at 12:45:41PM -0600, Andreas Dilger wrote:
> On 2010-08-12, at 11:42, Joel Becker wrote:
> >> +/**
> >> + * generic_check_addressable - Check addressability of file system
> >> + * @blocksize_bits:	log of file system block size
> >> + * @num_blocks:		number of blocks in file system
> >> + *
> >> + * Determine whether a file system with @num_blocks blocks (and a
> >> + * block size of 2**@blocksize_bits) is addressable by the sector_t
> >> + * and page cache of the system.  Return 0 if so and -EFBIG otherwise.
> >> + */
> >> +int generic_check_addressable(unsigned blocksize_bits, u64 num_blocks)
> >> +{
> >> +	u64 last_fs_block = num_blocks - 1;
> >> +
> >> +	BUG_ON(blocksize_bits < 9);
> >> +	BUG_ON(blocksize_bits > PAGE_CACHE_SHIFT);
> 
> I'd rather not have a BUG_ON() for a "check" function that may be called with on-disk values by some filesystem.  Some filesystems (AFAIR) also handle blocksize > PAGE_SIZE internally, so this helper would not be useful for them.

	Filesystems that handle their own page cache certainly wouldn't
be interested in a generic helper anyway.  All of our pagecache assumes
blocks between 512<->PAGE_CACHE_SIZE.
	If I change the BUG_ON()s to -EINVAL, does that work?  Or do you
have some way you'd like to allow non-pagecache filesystems to use this
as well?

Joel

-- 

"I am working for the time when unqualified blacks, browns, and
 women join the unqualified men in running our government."
	- Sissy Farenthold

Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker@xxxxxxxxxx
Phone: (650) 506-8127
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux