Re: [Q] [VFS] i_mapping vs. i_data ?

Alexander Viro (viro@math.psu.edu)
Tue, 22 May 2001 12:40:26 -0400 (EDT)


On Tue, 22 May 2001, Jean-Marc Saffroy wrote:

> Hello,
>
> I have the following question for VFS gurus here:
>
> In the inode struct, an address_space (i_data) and a pointer to an
> address_space (i_mapping) are defined, and it looks like i_mapping is
> always a reference to the inode's i_data (except in coda_open). Then what
> is the difference of meaning between these two ?

i_data is "pages read/written by this inode"
i_mapping is "whom should I ask for pages?"

IOW, everything outside of individual filesystems should use the latter.
They are same if (and only if) inode owns the data. CODA (or anything that
caches data on a local fs) will have i_mapping pointing to the i_data of
inode it caches into. Ditto for block devices if/when they go into pagecache -
we should associate pagecache with struct block_device, since we can have
many inodes with the same major:minor. IOW, ->i_mapping should be pointing
to the same place for all of them.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/