summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab_parse.c
Commit message (Collapse)AuthorAgeFilesLines
...
* libmount: optimize tab files parsingKarel Zak2013-02-261-20/+20
| | | | | | | - ignore empty files - ignore empty tables Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: read optional mountinfo fieldsOndrej Oprala2013-01-101-0/+2
| | | | | | | | | | [kzak@redhat.com: - rename struct member and functions from "propagation" to "optional fields" - split the original patch - fix parser] Signed-off-by: Ondrej Oprala <ondrej.oprala@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean nonnull attribute usageKarel Zak2012-12-041-2/+4
| | | | | | | | | | - use __attribute__((nonnull) for functions where we not able to return an return code ("is", "has" and some "get" functions). - use __attribute__((nonnull) for small functions where we always modify any of the function argument (some mnt_optstr_* functions) Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: more robust tab filter usageKarel Zak2012-11-151-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: convert /dev/root from mountinfo to the device nameKarel Zak2012-11-081-5/+40
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount, eject: replace index() and rindex() with strrch() or strrchr()Sami Kerola2012-10-221-2/+2
| | | | | | | | | | Both index() and rindex() are legacy functions which may be withdrawn in a future. Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/index.html Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/rindex.html Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: improve debug messageKarel Zak2012-09-251-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: optimize mtab and utab parsing in umountKarel Zak2012-09-251-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | create 8000 NFS mountpoints: #!/bin/bash mount=/tmp/mount if [ ! -d $mount ]; then mkdir -p $mount fi for dir in {1..8000}; do if [ ! -d $mount/$dir ]; then mkdir -p $mount/$dir fi echo mount $dir mount -t nfs 127.0.0.1:/ $mount/$dir done old version: time ./umount /tmp/mount/2255 real 0m1.254s user 0m1.002s sys 0m0.238s new version: time ./umount /tmp/mount/2244 real 0m0.332s user 0m0.111s sys 0m0.218s Reported-by: chenditang <chendt.fnst@cn.fujitsu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: save task ID for mountinfo tilesKarel Zak2012-06-281-0/+35
| | | | | | Add new function mnt_fs_get_tid() to get task ID for the given filesystem. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add support to parse /proc/swapsKarel Zak2012-04-031-1/+94
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up MNT_FMT_* usage in parserKarel Zak2012-04-031-15/+16
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*Karel Zak2012-03-021-11/+4Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_srcpath()Karel Zak2012-03-021-1/+1
| | | | | | | | | | We have to be careful with "none" or another dummy sources for pseudo filesystems. These strings should be canonicalized or compared as a paths. The function is not exported by library API. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: don't treat "none" differentlyDave Reisner2012-03-021-6/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This causes more problems than it solves. In the latest edition: # mount -t proc none foo mount: foo: mount failed: Invalid argument A check for source and target fails in mnt_context_apply_fstab() because, even though they were indeed specified on the cmdline, __mnt_fs_set_source_ptr() altered this and NULL'd out the source. If you're able to mount this device via other means, other tools start reporting oddities, such as mount's output: (null) on /foo type proc (rw,relatime) or findmnt: TARGET SOURCE FSTYPE OPTIONS /foo proc rw,relatime Simply treat "none" like any other source when passed in. [kzak@redhat.com: - don't translate NULL to "none" in mnt_fs_set_source()] Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix leak in tab parsing error codeKarel Zak2012-01-261-3/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove fstab.d supportKarel Zak2012-01-241-4/+0Star
| | | | | | | | If you really need to store your configuration to a alternative files then you have to explicitly specify the files or directories on mount(8) command line by --fstab option. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: support dirs for mnt_table_parse_fstab(), add mnt_table_parse_dir()Karel Zak2012-01-231-26/+37
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix a potential memory leak at mnt_table_parse_dirMasatake YAMATO2012-01-231-4/+7
| | | | | | | | mnt_table_parse_dir in libmount/src/tab_parse.c calls scandir, and then opendir. When the latter one, opendir is failed, buffers allocated in scandir are not released. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* libmount: Use filter arg of scandir* to pickup /etc/fstab.d/*.fstab filesMasatake YAMATO2012-01-231-36/+27Star
| | | | | | | | | | | | | | | | | | | This patch is based on my last patch: [PATCH 1/2] scandirat based mnt_table_parse_dir implementation scandir* used in `mnt_table_parse_dir in libmount/src/tab_parse.c can take filter function as an argument. `mnt_table_parse_dir' picks up fstab files from namelist returned from scandir* for itself. However, some parts of picking-up job can be done in the filter function. This patch introduces a new function `mnt_table_parse_dir_filter' to share the code for picking-up job between two implementations of `mnt_table_parse_dir_filter', scandir based and scandirat based. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* libmount: scandirat based mnt_table_parse_dir implementationMasatake YAMATO2012-01-231-2/+63
| | | | | | | | | | | | In comment of `mnt_table_parse_dir' of libmount/src/tab_parse.c: /* TODO: it would be nice to have a scandir() implementation that * is able to use already opened directory */ Nowadays glibc provides `scandirat'. This patch implements `scandirat' based `mnt_table_parse_dir'. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
* libmount: make options in fstab optionalKarel Zak2012-01-121-8/+15
| | | | | | .. to be compatible with old mount(8). Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: ignore tailing slash in netfs source pathsPetr Uzel2011-11-081-2/+9
| | | | | | Addresses: https://bugzilla.novell.com/show_bug.cgi?id=728480 Signed-off-by: Petr Uzel <petr.uzel@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: check scanf %ms modifierKarel Zak2011-10-101-11/+12
| | | | | | | | | | | | Without the check libmount builds on systems that has older than 2.7 glibc are silently unsuccessful. The missing %ms modifier will, at least, result on such system missing output of findmnt and lsblk commands. If either %ms or %as modifiers are present the libmount build is disabled. Based on patch from: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: fix debug messageKarel Zak2011-08-261-2/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove unnecessary includes, mask API as stableKarel Zak2011-07-251-6/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup code for "none" source and fstype, fix mem leakKarel Zak2011-07-201-8/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libmount rather than shlibs/mountKarel Zak2011-06-091-0/+745
Signed-off-by: Karel Zak <kzak@redhat.com>