Re: [PATCH 1/2] fs: Replace direct ->bmap calls by bmap()

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

 



On Wed, Sep 05, 2018 at 09:23:26AM -0500, Eric Sandeen wrote:
> >  	block0 = page->index;
> >  	block0 <<= shift;
> >  
> > -	block = inode->i_mapping->a_ops->bmap(inode->i_mapping, block0);
> > +	block = bmap(inode, block0);
> 
> Prior to this there's an ASSERT that inode->i_mapping->a_ops->bmap
> exists.  Should that stay, if the goal is to move all ->bmap use out
> of calling code?

I think it needs to go away.

> OTOH, what will this code do if bmap() finds that there
> is no ->bmap present and returns 0?

I think we just need to fix the bmap() prototype so that it can return
error, which would be very useful for various reasons.  Something like
this:

int bmap(struct address_space *mapping, sector_t *block)
{
	if (!mapping->a_ops->bmap)
		return -EINVAL;
	*block = mapping->a_ops->bmap(mapping, *block);
	return 0;
}

then add fiemap support with real error handling later.



[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