summaryrefslogtreecommitdiffstats
path: root/mount
diff options
context:
space:
mode:
authorKarel Zak2011-01-22 00:09:34 +0100
committerKarel Zak2011-01-22 00:27:26 +0100
commit68164f6c308af1f53567b627876cd1bc8afe8817 (patch)
tree619ba5ff92b2f6a23ce899b9f771279179a7c7ba /mount
parentlibmount: add functions for mount.<type> helpers (diff)
downloadkernel-qcow2-util-linux-68164f6c308af1f53567b627876cd1bc8afe8817.tar.gz
kernel-qcow2-util-linux-68164f6c308af1f53567b627876cd1bc8afe8817.tar.xz
kernel-qcow2-util-linux-68164f6c308af1f53567b627876cd1bc8afe8817.zip
libmount: cleanup API, remove typedef
- replace mnt_ with libmnt_ prefix for types (the old prefix was too generic) - remove typedef, use struct everywhere - use shorter functions names (s/userspace/user/; s/mountflags/mflags/) Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount')
-rw-r--r--mount/fstab.c16
-rw-r--r--mount/fstab.h2
-rw-r--r--mount/mount.c10
-rw-r--r--mount/umount.c6
4 files changed, 17 insertions, 17 deletions
diff --git a/mount/fstab.c b/mount/fstab.c
index f812e120c..26d3fc291 100644
--- a/mount/fstab.c
+++ b/mount/fstab.c
@@ -156,19 +156,19 @@ read_mntentchn(mntFILE *mfp, const char *fnam, struct mntentchn *mc0) {
static void read_mounttable()
{
struct mntentchn *mc0 = &mounttable, *mc = mc0;
- mnt_tab *tb = mnt_new_tab();
- mnt_iter *itr = mnt_new_iter(MNT_ITER_FORWARD);
- mnt_fs *fs;
+ struct libmnt_table *tb = mnt_new_table();
+ struct libmnt_iter *itr = mnt_new_iter(MNT_ITER_FORWARD);
+ struct libmnt_fs *fs;
got_mtab = 1;
mc->nxt = mc->prev = NULL;
if (!tb || !itr)
goto err;
- if (mnt_tab_parse_mtab(tb, NULL))
+ if (mnt_table_parse_mtab(tb, NULL))
goto err;
- while(mnt_tab_next_fs(tb, itr, &fs) == 0) {
+ while(mnt_table_next_fs(tb, itr, &fs) == 0) {
const char *type = mnt_fs_get_fstype(fs);
struct my_mntent *mnt = NULL;
@@ -187,7 +187,7 @@ static void read_mounttable()
return;
err:
error(_("warning: failed to read mtab"));
- mnt_free_tab(tb);
+ mnt_free_table(tb);
mnt_free_iter(itr);
mc->nxt = mc->prev = NULL;
}
@@ -566,9 +566,9 @@ setlkw_timeout (int sig) {
}
#ifdef HAVE_LIBMOUNT_MOUNT
-static mnt_lock *libmount_lock;
+static struct libmnt_lock *libmount_lock;
-mnt_lock *
+struct libmnt_lock *
init_libmount_lock(const char *filename)
{
if (filename)
diff --git a/mount/fstab.h b/mount/fstab.h
index 09e995c17..850cb67a5 100644
--- a/mount/fstab.h
+++ b/mount/fstab.h
@@ -6,7 +6,7 @@
#ifdef HAVE_LIBMOUNT_MOUNT
#define USE_UNSTABLE_LIBMOUNT_API
#include <libmount.h>
-extern mnt_lock *init_libmount_lock(const char *filename);
+extern struct libmnt_lock *init_libmount_lock(const char *filename);
#endif
int mtab_is_writable(void);
diff --git a/mount/mount.c b/mount/mount.c
index d5f9e4c9c..bb4bd3476 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -88,7 +88,7 @@ static int restricted = 1;
static int pfd = -1;
#ifdef HAVE_LIBMOUNT_MOUNT
-static mnt_update *mtab_update;
+static struct libmnt_update *mtab_update;
static char *mtab_opts;
static unsigned long mtab_flags;
@@ -1339,7 +1339,7 @@ static void
prepare_mtab_entry(const char *spec, const char *node, const char *type,
const char *opts, unsigned long flags)
{
- mnt_fs *fs = mnt_new_fs();
+ struct libmnt_fs *fs = mnt_new_fs();
int rc = -1;
if (!mtab_update)
@@ -1372,12 +1372,12 @@ prepare_mtab_entry(const char *spec, const char *node, const char *type,
static void update_mtab_entry(int flags)
{
unsigned long fl;
- mnt_lock *lc;
+ struct libmnt_lock *lc;
if (!mtab_update)
return;
- fl = mnt_update_get_mountflags(mtab_update);
+ fl = mnt_update_get_mflags(mtab_update);
if ((flags & MS_RDONLY) != (fl & MS_RDONLY))
mnt_update_force_rdonly(mtab_update, flags & MS_RDONLY);
@@ -1391,7 +1391,7 @@ static void update_mtab_entry(int flags)
}
lc = init_libmount_lock( mnt_update_get_filename(mtab_update) );
- mnt_update_tab(mtab_update, lc);
+ mnt_update_table(mtab_update, lc);
init_libmount_lock(NULL);
}
diff --git a/mount/umount.c b/mount/umount.c
index b93b0b390..079aa337b 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -336,12 +336,12 @@ umount_one (const char *spec, const char *node, const char *type,
if (!nomtab &&
(umnt_err == 0 || umnt_err == EINVAL || umnt_err == ENOENT)) {
#ifdef HAVE_LIBMOUNT_MOUNT
- mnt_update *upd = mnt_new_update();
+ struct libmnt_update *upd = mnt_new_update();
if (upd && !mnt_update_set_fs(upd, 0, node, NULL)) {
- mnt_lock *lc = init_libmount_lock(
+ struct libmnt_lock *lc = init_libmount_lock(
mnt_update_get_filename(upd));
- mnt_update_tab(upd, lc);
+ mnt_update_table(upd, lc);
init_libmount_lock(NULL);
}
mnt_free_update(upd);