From aad777b65b174dcb1dae7e2908ccf7c8ba5fc21c Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 7 Nov 2012 12:21:14 -0500 Subject: [PATCH] --- yaml --- r: 339405 b: refs/heads/master c: 00ca79a04bef1a1b30ef8afd992d905b6d986caf h: refs/heads/master i: 339403: 3f2c6b30f44e01724b8f89b8f934159bc3373781 v: v3 --- [refs] | 2 +- trunk/fs/xfs/xfs_fs.h | 7 +++++-- trunk/fs/xfs/xfs_icache.c | 11 +++++++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index efd3ad101f88..d24ba79fa750 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1b5560488d1ab7c932f6f99385b41116838c3486 +refs/heads/master: 00ca79a04bef1a1b30ef8afd992d905b6d986caf diff --git a/trunk/fs/xfs/xfs_fs.h b/trunk/fs/xfs/xfs_fs.h index a19f9b205c15..6dda3f949b04 100644 --- a/trunk/fs/xfs/xfs_fs.h +++ b/trunk/fs/xfs/xfs_fs.h @@ -350,7 +350,8 @@ struct xfs_eofblocks { gid_t eof_gid; prid_t eof_prid; __u32 pad32; - __u64 pad64[13]; + __u64 eof_min_file_size; + __u64 pad64[12]; }; /* eof_flags values */ @@ -358,11 +359,13 @@ struct xfs_eofblocks { #define XFS_EOF_FLAGS_UID (1 << 1) /* filter by uid */ #define XFS_EOF_FLAGS_GID (1 << 2) /* filter by gid */ #define XFS_EOF_FLAGS_PRID (1 << 3) /* filter by project id */ +#define XFS_EOF_FLAGS_MINFILESIZE (1 << 4) /* filter by min file size */ #define XFS_EOF_FLAGS_VALID \ (XFS_EOF_FLAGS_SYNC | \ XFS_EOF_FLAGS_UID | \ XFS_EOF_FLAGS_GID | \ - XFS_EOF_FLAGS_PRID) + XFS_EOF_FLAGS_PRID | \ + XFS_EOF_FLAGS_MINFILESIZE) /* diff --git a/trunk/fs/xfs/xfs_icache.c b/trunk/fs/xfs/xfs_icache.c index 32908909815e..906e6dcd2c55 100644 --- a/trunk/fs/xfs/xfs_icache.c +++ b/trunk/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);