]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: add support for passing project paths on cmdline
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 29 Jan 2009 21:57:34 +0000 (22:57 +0100)
committerChristoph Hellwig <hch@brick.lst.de>
Thu, 29 Jan 2009 21:57:34 +0000 (22:57 +0100)
commit02b26a6db7be0b36609214391d1b9d6d6f6a11a8
tree8364ba04011fbc7ef5a5cbe94471fb1097201ff5
parent544f6ba0433594c57c8385f3406946e7716d90b4
xfs_quota: add support for passing project paths on cmdline

/etc/project is currently required for using project quota. This
patch adds ability to specify paths at command line.

fs_table_insert_project_path() introduced in libxcmd. Allows to insert
arbitrary path to fs_* iterating engine. We insert our paths with
-1 as project id (because we know no "original" id for this path
and generally this knowledge is not needed).

New option introduced for paths passing - project -p <path>.

Example:
$ sudo rm -f /etc/projects /etc/projid

$ sudo ./xfs_quota -x -c "project -p /tmp/xx -s 60"
Setting up project 60 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 60 with
recursion depth infinite (-1).

$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 60"
Checking project 60 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 60 with
recursion depth infinite (-1).

$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 70"
Checking project 70 (path /tmp/xx)...
/tmp/xx - project identifier is not set (inode=60, tree=70)
/tmp/xx/file1 - project identifier is not set (inode=60, tree=70)
/tmp/xx/file2 - project identifier is not set (inode=60, tree=70)
/tmp/xx/file3 - project identifier is not set (inode=60, tree=70)
/tmp/xx/dir1 - project identifier is not set (inode=60, tree=70)
/tmp/xx/dir2 - project identifier is not set (inode=60, tree=70)
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).

$ sudo ./xfs_quota -x -c "project -p /tmp/xx -s 70"
Setting up project 70 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).

$ sudo ./xfs_quota -x -c "project -p /tmp/xx -c 70"
Checking project 70 (path /tmp/xx)...
Processed 1 (/etc/projects and cmdline) paths for project 70 with
recursion depth infinite (-1).

Signed-off-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
Reviewed-by: Donald Douwsma <ddouwsma@bigpond.net.au>
Reviewed-by: Christoph Hellwig <hch@lst.de>
include/path.h
libxcmd/paths.c
quota/project.c