aboutsummaryrefslogtreecommitdiffstats
path: root/quota
diff options
context:
space:
mode:
authorAlex Elder <aelder@sgi.com>2011-10-03 12:49:17 +0000
committerAlex Elder <aelder@sgi.com>2011-10-06 15:19:29 -0500
commit0900efe40df790d6696023dc0578306a4db487e6 (patch)
tree742fe330a52893042d845bb8c747680b843e7411 /quota
parent19e786523a98399cc45f52ddee7c988c18b8432f (diff)
downloadxfsprogs-dev-0900efe40df790d6696023dc0578306a4db487e6.tar.gz
xfsprogs: libxcmd: encapsulate fs_table initialization
Change fs_table_initialise() so it takes an array of mount points and an array of project identifiers as arguments (along with their respective sizes). Change the quota code to provide fs_table_initialise() these arrays rather than doing the individual mount point and project insertion by itself. Other users just pass 0 counts, which results in filling fs_table with entries for all mounted filesystems and all defined projects. This allows a few fs_table functions to be given private scope. Signed-off-by: Alex Elder <aelder@sgi.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'quota')
-rw-r--r--quota/init.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/quota/init.c b/quota/init.c
index 96b6389394..3293b90d7b 100644
--- a/quota/init.c
+++ b/quota/init.c
@@ -135,19 +135,8 @@ init(
}
}
- if (optind == argc) {
- fs_table_initialise();
- } else {
- while (optind < argc)
- fs_table_insert_mount(argv[optind++]);
- if (!nprojopts)
- fs_table_insert_project(NULL);
- else
- for (c = 0; c < nprojopts; c++)
- fs_table_insert_project(projopts[c]);
- }
- if (projopts)
- free(projopts);
+ fs_table_initialise(argc - optind, &argv[optind], nprojopts, projopts);
+ free(projopts);
init_commands();
add_args_command(init_args_command);