summaryrefslogtreecommitdiffstats
path: root/libmount/docs
Commit message (Collapse)AuthorAgeFilesLines
* libmount: handle btrfs default subvolume mountStanislav Brabec2016-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mounting btrfs volume without subvol= and subvolid=, and the btrfs volume has default subvolume defined, mount() mounts the default subvolume and not the volume root as other filesystems do. To handle this situation correctly (for example for "mount -a"), libmount has to be capable to detect default subvolume. Add btrfs.c and btrfs.h that implement needed functions. This patch adds mnt_table_find_target_with_option() to the library API. Known problems not covered by this patch: - Use of subvolid= in fstab is not yet handled. - Use of type auto in combination with subvol= in fstab is not yet handled. - Use of btrfs in loop devices, where image file is specified in fstab is not yet handled (use of /dev/loop0 in fstab works). - If fstab uses subvol=, and subvol path changes since last "mount -a", subsequent "mount -a" will not recognize that it is already mounted, and it will attempt to mount it second time. To fix it, libmount should remember subvolid in time of mount (subvolid is unique for the subvolume, subvol is not). - mountinfo contains subvol and subvolid since kernel 4.2. Before kernel 4.2, there is no reasonable way to solve this situation. (One would create temporary mount point, mount the default, call needed ioctl() to determine what was mounted, deduce the default subvolume, compare it with subvolume of mounted volume, unmount and return result.) How to reproduce: truncate -s1G btrfs_test.img mkdir -p btrfs_mnt /sbin/mkfs.btrfs -f -d single -m single ./btrfs_test.img mount -o loop btrfs_test.img btrfs_mnt pushd . cd btrfs_mnt mkdir -p d0/dd0/ddd0 cd d0/dd0/ddd0 touch file{1..5} btrfs subvol create s1 cd s1 touch file{1..5} mkdir -p d1/dd1/ddd1 cd d1/dd1/ddd1 btrfs subvol create s2 rid=$(btrfs inspect rootid s2) echo new default $rid btrfs subvol get-default . btrfs subvol set-default $rid . popd umount btrfs_mnt losetup /dev/loop0 $PWD/btrfs_test.img echo "/dev/loop0 $PWD/btrfs_mnt btrfs defaults 0 0" >>/etc/fstab mount -a mount -a umount btrfs_mnt sed -i "/\/dev\/loop0/d" /etc/fstab losetup -d /dev/loop0 rm btrfs_test.img rmdir btrfs_mnt Current behavior: mount: /dev/loop0 is already mounted or /root/btrfs_mnt busy /dev/loop0 is already mounted on /root/btrfs_mnt Expected behavior is to ignore already mounted FS. [kzak@redhat.com: - make 'var' optional for mnt_table_find_target_with_option(), - add mnt_table_find_target_with_option() to symbols table and docs - add "btrfs" string between supported debug modes - minor coding style changes] Signed-off-by: Stanislav Brabec <sbrabec@suse.cz> Cc: David Štěrba <dsterba@suse.cz> Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: fix gtk-docs related warningsKarel Zak2015-05-282-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add options map to docsKarel Zak2015-01-261-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update API docs yearsKarel Zak2015-01-131-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup gtk-docs warningsKarel Zak2015-01-131-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* linmount: (monitor) refresh docs, headers and symbols tableKarel Zak2015-01-061-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: (monitor) cleanup wait/verify stuffKarel Zak2015-01-061-2/+4
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: split monitor initializationKarel Zak2015-01-061-1/+1
| | | | | | | The patch introduces mnt_monitor_enable_*() functions (now for userspace only) to make the API easy to use for high-level purpose. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add new libmnt_monitor APIKarel Zak2014-12-052-0/+13
| | | | | | | | | | | | It's usually enough to us [e]poll() to monitor kernel mount table, but there is no way how to monitor changes in userspace mount options (e.g. _netdev). The management of these mount options is completely hidden in libmount and /rub/mount/utab is private libmount file. This patch introduces new libmnt_mount API to monitor also userspace mount table. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: rename libs xml/version.xml to xml/version-utils.xmlKarel Zak2014-06-032-2/+2
| | | | | | | It seems that gtk-docs stuff is confused when we use version.xml (package version) and xml/version.xml (library version functions). Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: sort gitignore filesSami Kerola2014-03-121-8/+8
| | | | | | Use 'LC_ALL=C sort -fu' order for all lists. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
* libmount: add mnt_table_uniq_fs()Karel Zak2013-12-111-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_tag_is_valid()Karel Zak2013-11-191-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: update docsKarel Zak2013-09-271-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add reference counter to libmnt_tableKarel Zak2013-08-211-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add reference counting to libmnt_cacheKarel Zak2013-08-211-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add reference counting to libmount_fsKarel Zak2013-08-211-0/+2
| | | | | | | | | | | | | | | | | | | | * mnt_new_fs() returns object with refcount=1 * mnt_free_fs() does not care about reference counter * new functions mnt_ref_fs() and mnt_unref_fs() * mnt_table_add_fs() and mnt_table_rem_fs() uses reference counter * libmmnt_context uses reference counter for internal FS (as it could be shared outside the context) * backwardly incompatible change: - FS could be deallocated after mnt_table_remove_fs() * it's recommended to use mnt_unref_fs() after mnt_table_add_fs() Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add function for context userdataKarel Zak2013-08-211-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_is_empty(), improve table list usageKarel Zak2013-08-201-0/+1
| | | | | | | | Currently you have to use mnt_table_remove_fs() + mnt_free_fs() to destroy the list in the table. This is complicated in same situations. This patch allows to use mnt_free_fs() only. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_{first,last}_fs()Karel Zak2013-08-201-0/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add new function to docsKarel Zak2013-08-201-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add missing declarations to libmount.h.in and documentationOndrej Oprala2013-08-011-0/+12
| | | | Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
* libmount: add mnt_table_find_mountpoint()Karel Zak2013-03-251-0/+1
| | | | | | | | This is more robust implementation of mnt_get_mountpoint() that does not ignore bind mountpoints (mount --bind /mnt /mnt) as it does not depend on st_dev numbers. Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update yearKarel Zak2013-03-151-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up header fileKarel Zak2013-03-151-0/+11
| | | | | | | | | | | * don't teach people C by header files, so use warn_unused_result attribute only on places where we return allocated memory (to avoid leaks in applications). * merge multiple function attributes to the one list to make it usable with gtk-doc Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_get_propagation()Karel Zak2013-01-101-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: read optional mountinfo fieldsOndrej Oprala2013-01-101-0/+1
| | | | | | | | | | [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: add mnt_optstr_deduplicate_option()Karel Zak2012-08-011-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: allow to disable swap between source and targetKarel Zak2012-07-171-1/+3
| | | | | | | | | | | | | | | | | | | | | In some cases (for example if only one mount argument is given) may be mount request ambivalent: # mount /foo and fstab: /dev/sda5 /foo rw 0 0 /foo /bar bind 0 0 The libmount allows to swap between source and target (if source is not LABEL or UUID) by default. The new function mnt_context_disable_swapmatch() allows to disable this feature. Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: rename mnt_context_fstab_applied to mnt_context_tab_appliedKarel Zak2012-07-121-1/+1
| | | | | | | The function is also usable in umount to detect is mtab has been applied. Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: enable libmount and libblkid docsKarel Zak2012-06-261-10/+2Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_table_find_devno()Karel Zak2012-04-251-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_context_get_options()Karel Zak2012-04-181-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_context_fstab_applied()Karel Zak2012-04-171-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add support to parse /proc/swapsKarel Zak2012-04-031-1/+7
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup flags usageKarel Zak2012-03-071-0/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: add mnt_fs_streq_target() and export all mnt_fs_streq_*Karel Zak2012-03-021-1/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* docs: update copyright yearsKarel Zak2012-02-221-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup docsKarel Zak2012-02-221-2/+19
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: remove teaser proto for mnt_table_get_nameDave Reisner2012-02-221-1/+0Star
| | | | | | | | | | This function was never implemented, but the proto has existed since the inception of the library. As the libmnt_table struct doesn't include a member necessary to carry the name of the table, simply discard this prototype. If ever a need to break ABI comes up, perhaps this could be revisited. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
* build-sys: remove and ignore generated filesKarel Zak2011-07-282-0/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: fix gtk-doc distcleanKarel Zak2011-07-271-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: clean up docsKarel Zak2011-07-251-12/+54
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libmount: cleanup docsKarel Zak2011-07-233-124/+166
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libmount rather than shlibs/mountKarel Zak2011-06-096-0/+408
Signed-off-by: Karel Zak <kzak@redhat.com>