]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_quota: refactor code to generate id from name
authorEric Sandeen <sandeen@redhat.com>
Tue, 26 May 2020 18:36:04 +0000 (14:36 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 26 May 2020 18:36:04 +0000 (14:36 -0400)
commit67a73d6139d0336eb7ced05bd78a26b57f408187
tree540c399e033013af7e2da062de84c235907fc0d9
parenta4d94d6c30acac66ff82e740e2dcb95736d7d195
xfs_quota: refactor code to generate id from name

There's boilerplate for setting limits and warnings, where we have
a case statement for each of the 3 quota types, and from there call
3 different functions to configure each of the 3 types, each of which
calls its own version of id to string function...

Refactor this so that the main function can call a generic id to string
conversion routine, and then call a common action.  This save a lot of
LOC.

I was looking at allowing xfs to bump out individual grace periods like
setquota can do, and this refactoring allows us to add new actions like
that without copying all the boilerplate again.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
quota/edit.c