summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_icache.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2012-11-07 17:21:14 (GMT)
committerBen Myers <bpm@sgi.com>2012-11-08 21:32:29 (GMT)
commit00ca79a04bef1a1b30ef8afd992d905b6d986caf (patch)
treeee4a3f4dbb6fbfeae01e58f98a1c2c8457f5b4b0 /fs/xfs/xfs_icache.c
parent1b5560488d1ab7c932f6f99385b41116838c3486 (diff)
downloadlinux-00ca79a04bef1a1b30ef8afd992d905b6d986caf.tar.xz
xfs: add minimum file size filtering to eofblocks scan
Support minimum file size filtering in the eofblocks scan. The caller must set the XFS_EOF_FLAGS_MINFILESIZE flags bit and minimum file size value in bytes. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Mark Tinguely <tinguely@sgi.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_icache.c')
-rw-r--r--fs/xfs/xfs_icache.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 3290890..906e6dc 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1215,8 +1215,15 @@ xfs_inode_free_eofblocks(
mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
return 0;
- if (eofb && !xfs_inode_match_id(ip, eofb))
- return 0;
+ if (eofb) {
+ if (!xfs_inode_match_id(ip, eofb))
+ return 0;
+
+ /* skip the inode if the file size is too small */
+ if (eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE &&
+ XFS_ISIZE(ip) < eofb->eof_min_file_size)
+ return 0;
+ }
ret = xfs_free_eofblocks(ip->i_mount, ip, true);