diff options
author | Brian Foster <bfoster@redhat.com> | 2012-11-06 09:50:45 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-11-08 15:31:13 -0600 |
commit | 1b5560488d1ab7c932f6f99385b41116838c3486 (patch) | |
tree | 7610d27dadad7e3305186db81057e8dba0d1df56 /fs/xfs/xfs_icache.c | |
parent | 3e3f9f5863548e870edfcc72e7617ac8ddcad44a (diff) | |
download | op-kernel-dev-1b5560488d1ab7c932f6f99385b41116838c3486.zip op-kernel-dev-1b5560488d1ab7c932f6f99385b41116838c3486.tar.gz |
xfs: support multiple inode id filtering in eofblocks scan
Enhance the eofblocks scan code to filter based on multiply specified
inode id values. When multiple inode id values are specified, only
inodes that match all id values are selected.
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.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index b239da9..3290890 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -1175,14 +1175,19 @@ xfs_inode_match_id( struct xfs_inode *ip, struct xfs_eofblocks *eofb) { - if (eofb->eof_flags & XFS_EOF_FLAGS_UID) - return ip->i_d.di_uid == eofb->eof_uid; - else if (eofb->eof_flags & XFS_EOF_FLAGS_GID) - return ip->i_d.di_gid == eofb->eof_gid; - else if (eofb->eof_flags & XFS_EOF_FLAGS_PRID) - return xfs_get_projid(ip) == eofb->eof_prid; + if (eofb->eof_flags & XFS_EOF_FLAGS_UID && + ip->i_d.di_uid != eofb->eof_uid) + return 0; - return 0; + if (eofb->eof_flags & XFS_EOF_FLAGS_GID && + ip->i_d.di_gid != eofb->eof_gid) + return 0; + + if (eofb->eof_flags & XFS_EOF_FLAGS_PRID && + xfs_get_projid(ip) != eofb->eof_prid) + return 0; + + return 1; } STATIC int @@ -1210,10 +1215,7 @@ xfs_inode_free_eofblocks( mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) return 0; - if (eofb && - (eofb->eof_flags & (XFS_EOF_FLAGS_UID|XFS_EOF_FLAGS_GID| - XFS_EOF_FLAGS_PRID)) && - !xfs_inode_match_id(ip, eofb)) + if (eofb && !xfs_inode_match_id(ip, eofb)) return 0; ret = xfs_free_eofblocks(ip->i_mount, ip, true); |