xfs: add EOFBLOCKS inode tagging/untagging
authorBrian Foster <bfoster@redhat.com>
Tue, 6 Nov 2012 14:50:38 +0000 (09:50 -0500)
committerBen Myers <bpm@sgi.com>
Thu, 8 Nov 2012 20:20:44 +0000 (14:20 -0600)
commit27b52867925e3aaed090063c1c58a7537e6373f3
tree901719517ac8dc751053f6bf9d86cbe2b73bf538
parent69a58a43f74eb2cb23d9bce2524dae33c289a40f
xfs: add EOFBLOCKS inode tagging/untagging

Add the XFS_ICI_EOFBLOCKS_TAG inode tag to identify inodes with
speculatively preallocated blocks beyond EOF. An inode is tagged
when speculative preallocation occurs and untagged either via
truncate down or when post-EOF blocks are freed via release or
reclaim.

The tag management is intentionally not aggressive to prefer
simplicity over the complexity of handling all the corner cases
under which post-EOF blocks could be freed (i.e., forward
truncation, fallocate, write error conditions, etc.). This means
that a tagged inode may or may not have post-EOF blocks after a
period of time. The tag is eventually cleared when the inode is
released or reclaimed.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
fs/xfs/xfs_ag.h
fs/xfs/xfs_icache.c
fs/xfs/xfs_icache.h
fs/xfs/xfs_iomap.c
fs/xfs/xfs_iops.c
fs/xfs/xfs_trace.h
fs/xfs/xfs_vnodeops.c