libmount Reference Manual | ||||
---|---|---|---|---|
Top | Description |
int mnt_context_find_umount_fs (struct libmnt_context *cxt
,const char *tgt
,struct libmnt_fs **pfs
); int mnt_context_do_umount (struct libmnt_context *cxt
); int mnt_context_finalize_umount (struct libmnt_context *cxt
); int mnt_context_next_umount (struct libmnt_context *cxt
,struct libmnt_iter *itr
,struct libmnt_fs **fs
,int *mntrc
,int *ignored
); int mnt_context_prepare_umount (struct libmnt_context *cxt
); int mnt_context_umount (struct libmnt_context *cxt
);
int mnt_context_find_umount_fs (struct libmnt_context *cxt
,const char *tgt
,struct libmnt_fs **pfs
);
|
mount context |
|
mountpoint, device, ... |
|
returns point to filesystem |
Returns : |
0 on success, <0 on error, 1 if target filesystem not found |
int mnt_context_do_umount (struct libmnt_context *cxt
);
Umount filesystem by umount(2) or fork()
+exec(/sbin/umount.type).
Unnecessary for mnt_context_umount()
.
See also mnt_context_disable_helpers()
.
WARNING: non-zero return code does not mean that umount(2) syscall or umount.type helper wasn't successfully called.
Check mnt_context_get_status()
after error!
|
mount context |
Returns : |
0 on success; >0 in case of umount(2) error (returns syscall errno), <0 in case of other errors. |
int mnt_context_finalize_umount (struct libmnt_context *cxt
);
Mtab update, etc. Unnecessary for mnt_context_umount()
, but should be called
after mnt_context_do_umount()
. See also mnt_context_set_syscall_status()
.
|
context |
Returns : |
negative number on error, 0 on success. |
int mnt_context_next_umount (struct libmnt_context *cxt
,struct libmnt_iter *itr
,struct libmnt_fs **fs
,int *mntrc
,int *ignored
);
This function tries to umount the next filesystem from mtab (as returned by
mnt_context_get_mtab()
).
You can filter out filesystems by:
mnt_context_set_options_pattern()
to simulate umount -a -O pattern
mnt_context_set_fstype_pattern()
to simulate umount -a -t pattern
If the filesystem is not mounted or does not match defined criteria,
then the function mnt_context_next_umount()
returns zero, but the ignored
is
non-zero. Note that the root filesystem is always ignored.
If umount(2) syscall or umount.type helper failed, then the
mnt_context_next_umount()
function returns zero, but the mntrc
is non-zero.
Use also mnt_context_get_status()
to check if the filesystem was
successfully umounted.
|
context |
|
iterator |
|
returns the current filesystem |
|
returns the return code from mnt_context_umount()
|
|
returns 1 for not matching |
Returns : |
0 on success, <0 in case of error (!= umount(2) errors) 1 at the end of the list. |
int mnt_context_prepare_umount (struct libmnt_context *cxt
);
Prepare context for umounting, unnecessary for mnt_context_umount()
.
|
mount context |
Returns : |
0 on success, and negative number in case of error. |
int mnt_context_umount (struct libmnt_context *cxt
);
High-level, umounts filesystem by umount(2) or fork()
+exec(/sbin/umount.type).
This is similar to:
mnt_context_prepare_umount(cxt); mnt_context_do_umount(cxt); mnt_context_finalize_umount(cxt);
See also mnt_context_disable_helpers()
.
WARNING: non-zero return code does not mean that umount(2) syscall or umount.type helper wasn't successfully called.
Check mnt_context_get_status()
after error!
|
umount context |
Returns : |
0 on success; >0 in case of umount(2) error (returns syscall errno), <0 in case of other errors. |