aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_icache.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2012-11-06 09:50:45 -0500
committerBen Myers <bpm@sgi.com>2012-11-08 16:31:13 -0500
commit1b5560488d1ab7c932f6f99385b41116838c3486 (patch)
tree7610d27dadad7e3305186db81057e8dba0d1df56 /fs/xfs/xfs_icache.c
parent3e3f9f5863548e870edfcc72e7617ac8ddcad44a (diff)
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.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index b239da91c43b..32908909815e 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -1175,14 +1175,19 @@ xfs_inode_match_id(
1175 struct xfs_inode *ip, 1175 struct xfs_inode *ip,
1176 struct xfs_eofblocks *eofb) 1176 struct xfs_eofblocks *eofb)
1177{ 1177{
1178 if (eofb->eof_flags & XFS_EOF_FLAGS_UID) 1178 if (eofb->eof_flags & XFS_EOF_FLAGS_UID &&
1179 return ip->i_d.di_uid == eofb->eof_uid; 1179 ip->i_d.di_uid != eofb->eof_uid)
1180 else if (eofb->eof_flags & XFS_EOF_FLAGS_GID) 1180 return 0;
1181 return ip->i_d.di_gid == eofb->eof_gid;
1182 else if (eofb->eof_flags & XFS_EOF_FLAGS_PRID)
1183 return xfs_get_projid(ip) == eofb->eof_prid;
1184 1181
1185 return 0; 1182 if (eofb->eof_flags & XFS_EOF_FLAGS_GID &&
1183 ip->i_d.di_gid != eofb->eof_gid)
1184 return 0;
1185
1186 if (eofb->eof_flags & XFS_EOF_FLAGS_PRID &&
1187 xfs_get_projid(ip) != eofb->eof_prid)
1188 return 0;
1189
1190 return 1;
1186} 1191}
1187 1192
1188STATIC int 1193STATIC int
@@ -1210,10 +1215,7 @@ xfs_inode_free_eofblocks(
1210 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) 1215 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY))
1211 return 0; 1216 return 0;
1212 1217
1213 if (eofb && 1218 if (eofb && !xfs_inode_match_id(ip, eofb))
1214 (eofb->eof_flags & (XFS_EOF_FLAGS_UID|XFS_EOF_FLAGS_GID|
1215 XFS_EOF_FLAGS_PRID)) &&
1216 !xfs_inode_match_id(ip, eofb))
1217 return 0; 1219 return 0;
1218 1220
1219 ret = xfs_free_eofblocks(ip->i_mount, ip, true); 1221 ret = xfs_free_eofblocks(ip->i_mount, ip, true);