static int set_flag(struct libmnt_context *cxt, int flag, int enable)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
if (enable) {
*/
int mnt_context_set_user_mflags(struct libmnt_context *cxt, unsigned long flags)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
cxt->user_mountflags = flags;
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt || !cxt->fs)
- return -EINVAL;
-
DBG(CXT, ul_debugobj(cxt, "preparing source path"));
src = mnt_fs_get_source(cxt->fs);
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt || !cxt->fs)
- return -EINVAL;
-
DBG(CXT, ul_debugobj(cxt, "preparing target path"));
tgt = mnt_fs_get_target(cxt->fs);
DBG(CXT, ul_debugobj(cxt, "preparing fstype"));
- if (!cxt || !cxt->fs)
- return -EINVAL;
-
if ((cxt->mountflags & (MS_BIND | MS_MOVE))
|| mnt_context_propagation_only(cxt))
goto none;
assert(cxt);
assert(cxt->fs);
- if (!cxt->fs)
- return -EINVAL;
-
src = mnt_fs_get_source(cxt->fs);
tgt = mnt_fs_get_target(cxt->fs);
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt)
- return -EINVAL;
-
backing_file = mnt_fs_get_srcpath(cxt->fs);
if (!backing_file)
return -EINVAL;
assert(cxt);
assert(cxt->fs);
- if (!cxt)
- return -EINVAL;
-
src = mnt_fs_get_srcpath(cxt->fs);
if (!src)
return -EINVAL;
{
assert(cxt);
- if (!cxt)
- return -EINVAL;
-
if (mnt_context_get_status(cxt) == 0 &&
(cxt->flags & MNT_FL_LOOPDEV_READY)) {
/*
};
#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;
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;
assert(cxt);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
-
/*
* Use the pattern as list of the filesystems
*/
{
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))
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"));
assert(cxt->fs);
assert((cxt->flags & MNT_FL_MOUNTFLAGS_MERGED));
- if (!cxt || !cxt->fs)
- return -EINVAL;
-
if (!mnt_context_is_restricted(cxt))
return 0; /* superuser mount */
{
int rc;
- 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_context_get_source(cxt) && !mnt_context_get_target(cxt))
if (cxt->flags & MNT_FL_PREPARED)
return 0;
+ assert(cxt->helper_exec_status == 1);
+ assert(cxt->syscall_status == 1);
+
free(cxt->helper); /* be paranoid */
cxt->helper = NULL;
cxt->action = MNT_ACT_UMOUNT;
assert(itr);
assert(me);
- if (!mn || !itr || !me)
- return -EINVAL;
-
*me = NULL;
if (!itr->head)
{
int rc;
- assert(mn);
- assert(me);
-
if (!me || me->enable == 0) /* not-initialized or disabled */
return -EINVAL;
if (me->fd >= 0)
{
int rc;
- assert(mn);
- assert(me);
-
if (!me || me->enable == 0) /* not-initialized or disabled */
return -EINVAL;
if (me->fd >= 0)
struct libmnt_fs *fs = NULL;
struct libmnt_iter itr;
- assert(tb);
-
if (!tb)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)