text-based mount.nfs: parse option strings into lists
Adapt a parsing trick used by Python.
Parse mount option strings into an abstract data type so we don't have to
copy and/or tokenize the whole option string multiple times while trying
to manipulate the mount options. Then, just before calling the mount(2)
system call, convert the object back into a C string.
One major advantage of this approach is that we can copy the final version
of the mount options into /etc/mtab when we're done, instead of copying in
the original mount options that the user specified. Any fallback from NFS
v3 to NFS v2 or TCP to UDP that was done by mount.nfs will be reflected in
/etc/mtab.
This patch adds methods for creating and manipulating mount option data
objects.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Neil Brown <neilb@suse.de>