summaryrefslogtreecommitdiffstats
path: root/libmount/src/context_mount.c
diff options
context:
space:
mode:
authorKarel Zak2015-08-04 13:21:42 +0200
committerKarel Zak2015-08-04 13:21:42 +0200
commitcba392b661d3fcf92d50d0df7c8783e18bb992da (patch)
treecad7faaf330e273e359fe0a1800642d8eeadc396 /libmount/src/context_mount.c
parentlibfdisk: cleanup assert() usage (diff)
downloadkernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.tar.gz
kernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.tar.xz
kernel-qcow2-util-linux-cba392b661d3fcf92d50d0df7c8783e18bb992da.zip
libmount: cleanup assert() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/context_mount.c')
-rw-r--r--libmount/src/context_mount.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index 210f0f169..63cba216b 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -159,11 +159,8 @@ static int fix_optstr(struct libmnt_context *cxt)
};
#endif
assert(cxt);
- assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt)
- return -EINVAL;
if (!cxt->fs || (cxt->flags & MNT_FL_MOUNTOPTS_FIXED))
return 0;
@@ -390,11 +387,8 @@ static int evaluate_permissions(struct libmnt_context *cxt)
unsigned long u_flags = 0;
assert(cxt);
- assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt)
- return -EINVAL;
if (!cxt->fs)
return 0;
@@ -816,7 +810,6 @@ static int do_mount_by_pattern(struct libmnt_context *cxt, const char *pattern)
assert(cxt);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
-
/*
* Use the pattern as list of the filesystems
*/
@@ -861,11 +854,6 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt)
{
int rc = -EINVAL;
- assert(cxt);
- assert(cxt->fs);
- assert(cxt->helper_exec_status == 1);
- assert(cxt->syscall_status == 1);
-
if (!cxt || !cxt->fs || mnt_fs_is_swaparea(cxt->fs))
return -EINVAL;
if (!mnt_fs_get_source(cxt->fs) && !mnt_fs_get_target(cxt->fs))
@@ -873,6 +861,9 @@ int mnt_context_prepare_mount(struct libmnt_context *cxt)
if (cxt->flags & MNT_FL_PREPARED)
return 0;
+ assert(cxt->helper_exec_status == 1);
+ assert(cxt->syscall_status == 1);
+
cxt->action = MNT_ACT_MOUNT;
DBG(CXT, ul_debugobj(cxt, "mount: preparing"));