]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: libxcmd: allow 0 as a wildcard fs_table entry type selector
authorAlex Elder <aelder@sgi.com>
Wed, 28 Sep 2011 11:44:33 +0000 (11:44 +0000)
committerAlex Elder <aelder@sgi.com>
Thu, 29 Sep 2011 14:33:27 +0000 (09:33 -0500)
commitee0aba2ee43ad26948184b178206ee1822d250f2
tree9fac7c4d5696f3ccca9f442dafe2f859419ee6aa
parent06065b12cc21b1c891c247b237d98fea591f01e9
xfsprogs: libxcmd: allow 0 as a wildcard fs_table entry type selector

In libxcmd a table is used to represent filesystems and directories
that could be subject to quota operations.  A cursor mechanism is
used to search that table, and it includes a flag that indicates
whether the type of entry desired represents a directory (for project
quotas) or a mount point (otherwise).  It also allows a search for
either type.

There is only call to fs_cursor_initialise() where both mount points
and project paths are requested--all others just requested one or
the other.

Change it so when searching fs_table (in fs_table_lookup() and
fs_cursor_next_entry()), a zero "flags" value is interpreted as a
wildcard, matching either type of entry.

Also add some commentary explaining the use of 0 as a wildcard, and
simplify fs_cursor_next_entry() a bit in the process.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxcmd/paths.c