xfs: separate buffer indexing from block map
authorDave Chinner <dchinner@redhat.com>
Fri, 22 Jun 2012 08:50:08 +0000 (18:50 +1000)
committerBen Myers <bpm@sgi.com>
Sun, 1 Jul 2012 19:50:04 +0000 (14:50 -0500)
commitcbb7baab285a540f173ef1ec3d5bcf9d0ad29d16
tree33b570bfdf1a9e50482968823b05dd7c99b1e665
parent77c1a08fc9ece4cb130b9fd279738e799f0c2864
xfs: separate buffer indexing from block map

To support discontiguous buffers in the buffer cache, we need to
separate the cache index variables from the I/O map. While this is
currently a 1:1 mapping, discontiguous buffer support will break
this relationship.

However, for caching purposes, we can still treat them the same as a
contiguous buffer - the block number of the first block and the
length of the buffer - as that is still a unique representation.
Also, the only way we will ever access the discontiguous regions of
buffers is via bulding the complete buffer in the first place, so
using the initial block number and entire buffer length is a sane
way to index the buffers.

Add a block mapping vector construct to the xfs_buf and use it in
the places where we are doing IO instead of the current
b_bn/b_length variables.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_buf.c
fs/xfs/xfs_buf.h