summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmount/docs/libmount-sections.txt21
-rw-r--r--libmount/src/context.c10
-rw-r--r--libmount/src/context_mount.c4
-rw-r--r--libmount/src/context_umount.c2
-rw-r--r--libmount/src/lock.c4
-rw-r--r--libmount/src/optstr.c6
-rw-r--r--libmount/src/tab_diff.c30
-rw-r--r--libmount/src/version.c10
8 files changed, 55 insertions, 32 deletions
diff --git a/libmount/docs/libmount-sections.txt b/libmount/docs/libmount-sections.txt
index 65f2859d6..b856d98a4 100644
--- a/libmount/docs/libmount-sections.txt
+++ b/libmount/docs/libmount-sections.txt
@@ -26,6 +26,7 @@ mnt_context_disable_helpers
mnt_context_disable_mtab
mnt_context_enable_fake
mnt_context_enable_force
+mnt_context_enable_fork
mnt_context_enable_lazy
mnt_context_enable_loopdel
mnt_context_enable_rdonly_umount
@@ -35,26 +36,33 @@ mnt_context_get_cache
mnt_context_get_fs
mnt_context_get_fstab
mnt_context_get_fstype
+mnt_context_get_helper_status
mnt_context_get_lock
mnt_context_get_mflags
mnt_context_get_mtab
mnt_context_get_optsmode
mnt_context_get_source
mnt_context_get_status
+mnt_context_get_syscall_errno
mnt_context_get_table
mnt_context_get_target
mnt_context_get_user_mflags
+mnt_context_helper_executed
mnt_context_helper_setopt
mnt_context_init_helper
+mnt_context_is_child
mnt_context_is_fake
mnt_context_is_force
+mnt_context_is_fork
mnt_context_is_fs_mounted
mnt_context_is_lazy
mnt_context_is_nomtab
+mnt_context_is_parent
mnt_context_is_rdonly_umount
mnt_context_is_restricted
mnt_context_is_sloppy
mnt_context_is_verbose
+mnt_context_reset_status
mnt_context_set_cache
mnt_context_set_fs
mnt_context_set_fstab
@@ -65,12 +73,15 @@ mnt_context_set_mountdata
mnt_context_set_options
mnt_context_set_options_pattern
mnt_context_set_optsmode
+mnt_context_set_passwd_cb
mnt_context_set_source
mnt_context_set_syscall_status
mnt_context_set_tables_errcb
mnt_context_set_target
mnt_context_set_user_mflags
mnt_context_strerror
+mnt_context_syscall_called
+mnt_context_wait_for_children
</SECTION>
<SECTION>
@@ -91,6 +102,7 @@ MNT_MS_NOFAIL
MNT_MS_OFFSET
MNT_MS_OWNER
MNT_MS_SIZELIMIT
+MNT_MS_ENCRYPTION
MNT_MS_UHELPER
MNT_MS_USER
MNT_MS_USERS
@@ -128,6 +140,7 @@ MS_UNBINDABLE
<FILE>context-umount</FILE>
mnt_context_do_umount
mnt_context_finalize_umount
+mnt_context_next_umount
mnt_context_prepare_umount
mnt_context_umount
</SECTION>
@@ -161,6 +174,9 @@ mnt_fs_get_userdata
mnt_fs_get_user_options
mnt_fs_get_vfs_options
mnt_fs_is_kernel
+mnt_fs_is_swaparea
+mnt_fs_is_netfs
+mnt_fs_is_pseudofs
mnt_fs_match_fstype
mnt_fs_match_options
mnt_fs_match_source
@@ -214,6 +230,7 @@ mnt_get_builtin_optmap
MNT_INVERT
MNT_NOMTAB
MNT_PREFIX
+MNT_NOHLPS
</SECTION>
<SECTION>
@@ -252,6 +269,7 @@ mnt_table_is_fs_mounted
mnt_table_next_child_fs
mnt_table_next_fs
mnt_table_parse_file
+mnt_table_parse_dir
mnt_table_parse_fstab
mnt_table_parse_mtab
mnt_table_parse_stream
@@ -289,8 +307,6 @@ mnt_update_table
mnt_fstype_is_netfs
mnt_fstype_is_pseudofs
mnt_get_fstab_path
-mnt_get_fstype
-mnt_get_library_version
mnt_get_mtab_path
mnt_has_regular_mtab
mnt_mangle
@@ -303,5 +319,6 @@ mnt_unmangle
<FILE>version</FILE>
mnt_parse_version_string
mnt_get_library_version
+mnt_get_library_features
LIBMOUNT_VERSION
</SECTION>
diff --git a/libmount/src/context.c b/libmount/src/context.c
index 2d88dc38e..f526d29bf 100644
--- a/libmount/src/context.c
+++ b/libmount/src/context.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Karel Zak <kzak@redhat.com>
+ * Copyright (C) 2010,2011,2012 Karel Zak <kzak@redhat.com>
*
* This file may be redistributed under the terms of the
* GNU Lesser General Public License.
@@ -175,7 +175,7 @@ int mnt_reset_context(struct libmnt_context *cxt)
* mnt_context_reset_status:
* @cxt: context
*
- * Resets mount(2) and mount.<type> statuses, so mnt_context_do_mount() or
+ * Resets mount(2) and mount.type statuses, so mnt_context_do_mount() or
* mnt_context_do_umount() could be again called with the same settings.
*
* BE CAREFUL -- after this soft reset the libmount will NOT parse mount
@@ -943,8 +943,10 @@ struct libmnt_cache *mnt_context_get_cache(struct libmnt_context *cxt)
/**
* mnt_context_set_passwd_cb:
* @cxt: mount context
+ * @get: callback to get password
+ * @release: callback to release (delallocate) password
*
- * Sets callbacks for encryption password.
+ * Sets callbacks for encryption password (e.g encrypted loopdev)
*
* Returns: 0 on success, negative number in case of error.
*/
@@ -1690,7 +1692,7 @@ int mnt_context_helper_executed(struct libmnt_context *cxt)
* mnt_context_get_helper_status:
* @cxt: mount context
*
- * Return: mount.<type> exit status, result is reliable only if
+ * Return: mount.type helper exit status, result is reliable only if
* mnt_context_helper_executed() returns 1.
*/
int mnt_context_get_helper_status(struct libmnt_context *cxt)
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index d38aa16be..8cbc25b27 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -597,7 +597,7 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt)
* another source or target than you have to call mnt_reset_context().
*
* If you want to call mount(2) for the same source and target with a diffrent
- * mount flags or fstype then you call mnt_context_reset_state() and then try
+ * mount flags or fstype then you call mnt_context_reset_status() and then try
* again mnt_context_do_mount().
*
* WARNING: non-zero return code does not mean that mount(2) syscall or
@@ -705,7 +705,7 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt)
*
* Note that this function could be called only once. If you want to mount with
* different setting than you have to call mnt_reset_context(). It's NOT enough
- * to call mnt_context_reset_state() if you want call this function more than
+ * to call mnt_context_reset_status() if you want call this function more than
* once, whole context has to be reseted.
*
* WARNING: non-zero return code does not mean that mount(2) syscall or
diff --git a/libmount/src/context_umount.c b/libmount/src/context_umount.c
index 45c7128e6..5a2ad9ec7 100644
--- a/libmount/src/context_umount.c
+++ b/libmount/src/context_umount.c
@@ -418,7 +418,7 @@ static int exec_helper(struct libmnt_context *cxt)
/*
* mnt_context_helper_setopt() backend.
*
- * This function applies umount.<type> command line option (for example parsed
+ * This function applies umount.type command line option (for example parsed
* by getopt() or getopt_long()) to @cxt. All unknown options are ignored and
* then 1 is returned.
*
diff --git a/libmount/src/lock.c b/libmount/src/lock.c
index 682c74acb..73dc6c8f7 100644
--- a/libmount/src/lock.c
+++ b/libmount/src/lock.c
@@ -298,7 +298,7 @@ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t m
*
* Where does the link point to? Obvious choices are mtab and mtab~~.
* HJLu points out that the latter leads to races. Right now we use
- * mtab~.<pid> instead.
+ * mtab~.pid instead.
*
*
* The original mount locking code has used sleep(1) between attempts and
@@ -319,7 +319,7 @@ static int mnt_wait_mtab_lock(struct libmnt_lock *ml, struct flock *fl, time_t m
* backwardly compatible code.
*
* Don't forget that this code has to be compatible with 3rd party mounts
- * (/sbin/mount.<foo>) and has to work with NFS.
+ * (/sbin/mount.foo) and has to work with NFS.
* -- kzak@redhat.com [May-2009]
*/
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 159ae62be..af5953bc6 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2009 Karel Zak <kzak@redhat.com>
+ * Copyright (C) 2008,2009,2012 Karel Zak <kzak@redhat.com>
*
* This file may be redistributed under the terms of the
* GNU Lesser General Public License.
@@ -848,7 +848,7 @@ static int set_uint_value(char **optstr, unsigned int num,
* @valsz: size of the value
* @next: returns pointer to the next option (optional argument)
- * Translates "<username>" or "useruid" to the real UID.
+ * Translates "username" or "useruid" to the real UID.
*
* For example:
* if (!mnt_optstr_get_option(optstr, "uid", &val, &valsz))
@@ -899,7 +899,7 @@ int mnt_optstr_fix_uid(char **optstr, char *value, size_t valsz, char **next)
* @valsz: size of the value
* @next: returns pointer to the next option (optional argument)
- * Translates "<groupname>" or "usergid" to the real GID.
+ * Translates "groupname" or "usergid" to the real GID.
*
* Returns: 0 on success, negative number in case of error.
*/
diff --git a/libmount/src/tab_diff.c b/libmount/src/tab_diff.c
index 45434fc71..c94bcfaa0 100644
--- a/libmount/src/tab_diff.c
+++ b/libmount/src/tab_diff.c
@@ -203,57 +203,57 @@ static struct tabdiff_entry *tabdiff_get_mount(struct libmnt_tabdiff *df,
/**
* mnt_diff_tables:
* @df: diff handler
- * @old: old table
- * @new: new table
+ * @old_tab: old table
+ * @new_tab: new table
*
- * Compares @old and @new, the result is stored in @df and accessible by
+ * Compares @old_tab and @new_tab, the result is stored in @df and accessible by
* mnt_tabdiff_next_change().
*
* Returns: number of changes, negative number in case of error.
*/
-int mnt_diff_tables(struct libmnt_tabdiff *df, struct libmnt_table *old,
- struct libmnt_table *new)
+int mnt_diff_tables(struct libmnt_tabdiff *df, struct libmnt_table *old_tab,
+ struct libmnt_table *new_tab)
{
struct libmnt_fs *fs;
struct libmnt_iter itr;
int no, nn;
- if (!df || !old || !new)
+ if (!df || !old_tab || !new_tab)
return -EINVAL;
tabdiff_reset(df);
- no = mnt_table_get_nents(old);
- nn = mnt_table_get_nents(new);
+ no = mnt_table_get_nents(old_tab);
+ nn = mnt_table_get_nents(new_tab);
if (!no && !nn) /* both tables are empty */
return 0;
DBG(DIFF, mnt_debug_h(df, "analyze new=%p (%d entries), "
"old=%p (%d entries)",
- new, nn, old, no));
+ new_tab, nn, old_tab, no));
mnt_reset_iter(&itr, MNT_ITER_FORWARD);
/* all mounted or umounted */
if (!no && nn) {
- while(mnt_table_next_fs(new, &itr, &fs) == 0)
+ while(mnt_table_next_fs(new_tab, &itr, &fs) == 0)
tabdiff_add_entry(df, NULL, fs, MNT_TABDIFF_MOUNT);
goto done;
} else if (no && !nn) {
- while(mnt_table_next_fs(old, &itr, &fs) == 0)
+ while(mnt_table_next_fs(old_tab, &itr, &fs) == 0)
tabdiff_add_entry(df, fs, NULL, MNT_TABDIFF_UMOUNT);
goto done;
}
/* search newly mounted or modified */
- while(mnt_table_next_fs(new, &itr, &fs) == 0) {
+ while(mnt_table_next_fs(new_tab, &itr, &fs) == 0) {
struct libmnt_fs *o_fs;
const char *src = mnt_fs_get_source(fs),
*tgt = mnt_fs_get_target(fs);
- o_fs = mnt_table_find_pair(old, src, tgt, MNT_ITER_FORWARD);
+ o_fs = mnt_table_find_pair(old_tab, src, tgt, MNT_ITER_FORWARD);
if (!o_fs)
/* 'fs' is not in the old table -- so newly mounted */
tabdiff_add_entry(df, NULL, fs, MNT_TABDIFF_MOUNT);
@@ -269,11 +269,11 @@ int mnt_diff_tables(struct libmnt_tabdiff *df, struct libmnt_table *old,
/* search umounted or moved */
mnt_reset_iter(&itr, MNT_ITER_FORWARD);
- while(mnt_table_next_fs(old, &itr, &fs) == 0) {
+ while(mnt_table_next_fs(old_tab, &itr, &fs) == 0) {
const char *src = mnt_fs_get_source(fs),
*tgt = mnt_fs_get_target(fs);
- if (!mnt_table_find_pair(new, src, tgt, MNT_ITER_FORWARD)) {
+ if (!mnt_table_find_pair(new_tab, src, tgt, MNT_ITER_FORWARD)) {
struct tabdiff_entry *de;
de = tabdiff_get_mount(df, src, mnt_fs_get_id(fs));
diff --git a/libmount/src/version.c b/libmount/src/version.c
index e3bc5ca8a..00e4f9961 100644
--- a/libmount/src/version.c
+++ b/libmount/src/version.c
@@ -68,16 +68,20 @@ int mnt_get_library_version(const char **ver_string)
* @features: returns pointer to the static array of strings, the array is
* terminated by NULL.
*
- * Example:
+ * Returns: number of items in the features array not including the last NULL,
+ * or less then zero in case of error
*
+ * Example:
+ * <informalexample>
+ * <programlisting>
* const char *features;
*
* mnt_get_library_features(&features);
* while (features && *features)
* printf("%s\n", *features++);
+ * </programlisting>
+ * </informalexample>
*
- * Returns: number of items in the features array not including the last NULL,
- * or less then zero in case of error
*/
int mnt_get_library_features(const char ***features)
{