int mnt_cache_set_targets(struct libmnt_cache *cache,
struct libmnt_table *mtab)
{
- assert(cache);
if (!cache)
return -EINVAL;
{
size_t i;
- assert(cache);
- assert(path);
-
if (!cache || !path)
return NULL;
size_t i;
size_t tksz;
- assert(cache);
- assert(token);
- assert(value);
-
if (!cache || !token || !value)
return NULL;
const char *tags[] = { "LABEL", "UUID", "TYPE", "PARTUUID", "PARTLABEL" };
const char *blktags[] = { "LABEL", "UUID", "TYPE", "PART_ENTRY_UUID", "PART_ENTRY_NAME" };
- assert(cache);
- assert(devname);
-
if (!cache || !devname)
return -EINVAL;
{
char *p = NULL;
- assert(token);
- assert(value);
-
/*DBG(CACHE, ul_debugobj(cache, "resolving tag token=%s value=%s",
token, value));*/
*/
int mnt_context_reset_status(struct libmnt_context *cxt)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
*/
int mnt_context_set_optsmode(struct libmnt_context *cxt, int mode)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
cxt->optsmode = mode;
int mnt_context_get_optsmode(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->optsmode;
}
*/
struct libmnt_fs *mnt_context_get_fs(struct libmnt_context *cxt)
{
- assert(cxt);
if (!cxt)
return NULL;
if (!cxt->fs)
*/
void *mnt_context_get_fs_userdata(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->fs ? mnt_fs_get_userdata(cxt->fs) : NULL;
}
*/
void *mnt_context_get_fstab_userdata(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->fstab ? mnt_table_get_userdata(cxt->fstab) : NULL;
}
*/
void *mnt_context_get_mtab_userdata(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->mtab ? mnt_table_get_userdata(cxt->mtab) : NULL;
}
*/
int mnt_context_set_source(struct libmnt_context *cxt, const char *source)
{
- assert(cxt);
return mnt_fs_set_source(mnt_context_get_fs(cxt), source);
}
*/
const char *mnt_context_get_source(struct libmnt_context *cxt)
{
- assert(cxt);
return mnt_fs_get_source(mnt_context_get_fs(cxt));
}
*/
int mnt_context_set_target(struct libmnt_context *cxt, const char *target)
{
- assert(cxt);
return mnt_fs_set_target(mnt_context_get_fs(cxt), target);
}
*/
const char *mnt_context_get_target(struct libmnt_context *cxt)
{
- assert(cxt);
return mnt_fs_get_target(mnt_context_get_fs(cxt));
}
*/
int mnt_context_set_fstype(struct libmnt_context *cxt, const char *fstype)
{
- assert(cxt);
return mnt_fs_set_fstype(mnt_context_get_fs(cxt), fstype);
}
*/
const char *mnt_context_get_fstype(struct libmnt_context *cxt)
{
- assert(cxt);
return mnt_fs_get_fstype(mnt_context_get_fs(cxt));
}
*/
int mnt_context_set_options(struct libmnt_context *cxt, const char *optstr)
{
- assert(cxt);
return mnt_fs_set_options(mnt_context_get_fs(cxt), optstr);
}
*/
int mnt_context_append_options(struct libmnt_context *cxt, const char *optstr)
{
- assert(cxt);
return mnt_fs_append_options(mnt_context_get_fs(cxt), optstr);
}
*/
const char *mnt_context_get_options(struct libmnt_context *cxt)
{
- assert(cxt);
return mnt_fs_get_options(mnt_context_get_fs(cxt));
}
{
char *p = NULL;
- assert(cxt);
if (!cxt)
return -EINVAL;
if (pattern) {
{
char *p = NULL;
- assert(cxt);
if (!cxt)
return -EINVAL;
if (pattern) {
*/
int mnt_context_set_fstab(struct libmnt_context *cxt, struct libmnt_table *tb)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
*/
int mnt_context_get_fstab(struct libmnt_context *cxt, struct libmnt_table **tb)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
if (!cxt->fstab) {
*/
int mnt_context_get_mtab(struct libmnt_context *cxt, struct libmnt_table **tb)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
if (!cxt->mtab) {
int (*fltr)(struct libmnt_fs *, void *),
void *data)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
{
int rc;
- assert(cxt);
- assert(tb);
if (!cxt || !tb)
return -EINVAL;
int mnt_context_set_tables_errcb(struct libmnt_context *cxt,
int (*cb)(struct libmnt_table *tb, const char *filename, int line))
{
- assert(cxt);
if (!cxt)
return -EINVAL;
*/
struct libmnt_cache *mnt_context_get_cache(struct libmnt_context *cxt)
{
- assert(cxt);
if (!cxt || mnt_context_is_nocanonicalize(cxt))
return NULL;
char *(*get)(struct libmnt_context *),
void (*release)(struct libmnt_context *, char *))
{
- assert(cxt);
if (!cxt)
return -EINVAL;
cxt->pwd_get_cb = get;
*/
struct libmnt_lock *mnt_context_get_lock(struct libmnt_context *cxt)
{
- assert(cxt);
/*
* DON'T call this function within libmount, it will always allocate
* the lock. The mnt_update_* functions are able to allocate the lock
*/
int mnt_context_set_mflags(struct libmnt_context *cxt, unsigned long flags)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
int rc = 0;
struct list_head *p;
- assert(cxt);
- assert(flags);
if (!cxt || !flags)
return -EINVAL;
{
int rc = 0;
- assert(cxt);
- assert(flags);
if (!cxt || !flags)
return -EINVAL;
*/
int mnt_context_set_mountdata(struct libmnt_context *cxt, void *data)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
cxt->mountdata = data;
const char *src = NULL, *tgt = NULL;
unsigned long mflags = 0;
- assert(cxt);
- assert(cxt->fs);
-
- if (!cxt)
+ if (!cxt || !cxt->fs)
return -EINVAL;
if (mnt_context_tab_applied(cxt)) /* already applied */
*/
int mnt_context_tab_applied(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->flags & MNT_FL_TAB_APPLIED;
}
*/
int mnt_context_propagation_only(struct libmnt_context *cxt)
{
- assert(cxt);
- assert(cxt->fs);
-
if (cxt->action != MNT_ACT_MOUNT)
return 0;
*/
int mnt_context_get_status(struct libmnt_context *cxt)
{
- assert(cxt);
return !cxt->syscall_status || !cxt->helper_exec_status;
}
*/
int mnt_context_helper_executed(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->helper_exec_status != 1;
}
*/
int mnt_context_get_helper_status(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->helper_status;
}
*/
int mnt_context_syscall_called(struct libmnt_context *cxt)
{
- assert(cxt);
return cxt->syscall_status != 1;
}
*/
int mnt_context_get_syscall_errno(struct libmnt_context *cxt)
{
- assert(cxt);
if (cxt->syscall_status < 0)
return -cxt->syscall_status;
return 0;
*/
int mnt_context_set_syscall_status(struct libmnt_context *cxt, int status)
{
- assert(cxt);
if (!cxt)
return -EINVAL;
{
int rc;
- assert(cxt);
+ if (!cxt)
+ return -EINVAL;
rc = mnt_context_disable_helpers(cxt, TRUE);
if (!rc)
struct libmnt_table *mtab;
int rc;
- assert(cxt);
if (!cxt || !fs || !mounted)
return -EINVAL;
{
pid_t *pids;
- assert(cxt);
if (!cxt)
return -EINVAL;
{
int i;
- assert(cxt);
if (!cxt)
return -EINVAL;
*/
void *mnt_fs_get_userdata(struct libmnt_fs *fs)
{
- assert(fs);
-
if (!fs)
return NULL;
*/
int mnt_fs_set_userdata(struct libmnt_fs *fs, void *data)
{
- assert(fs);
if (!fs)
return -EINVAL;
*/
const char *mnt_fs_get_srcpath(struct libmnt_fs *fs)
{
- assert(fs);
if (!fs)
return NULL;
*/
const char *mnt_fs_get_source(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->source : NULL;
}
char *p = NULL;
int rc;
- assert(fs);
if (!fs)
return -EINVAL;
{
const char *p;
- assert(fs);
if (!fs)
return 0;
*/
int mnt_fs_streq_target(struct libmnt_fs *fs, const char *path)
{
- assert(fs);
return fs && streq_except_trailing_slash(mnt_fs_get_target(fs), path);
}
*/
int mnt_fs_get_tag(struct libmnt_fs *fs, const char **name, const char **value)
{
- assert(fs);
if (fs == NULL || !fs->tagname)
return -EINVAL;
if (name)
*/
const char *mnt_fs_get_target(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->target : NULL;
}
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (target) {
*/
int mnt_fs_get_propagation(struct libmnt_fs *fs, unsigned long *flags)
{
- assert(fs);
if (!fs || !flags)
return -EINVAL;
*/
int mnt_fs_is_swaparea(struct libmnt_fs *fs)
{
- assert(fs);
return mnt_fs_get_flags(fs) & MNT_FS_SWAP;
}
*/
int mnt_fs_is_pseudofs(struct libmnt_fs *fs)
{
- assert(fs);
return mnt_fs_get_flags(fs) & MNT_FS_PSEUDO;
}
*/
int mnt_fs_is_netfs(struct libmnt_fs *fs)
{
- assert(fs);
return mnt_fs_get_flags(fs) & MNT_FS_NET;
}
*/
const char *mnt_fs_get_fstype(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->fstype : NULL;
}
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (fstype) {
{
char *res;
- assert(fs);
+ if (!fs)
+ return NULL;
+
errno = 0;
if (fs->optstr)
return strdup(fs->optstr);
*/
const char *mnt_fs_get_options(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->optstr : NULL;
}
*/
const char *mnt_fs_get_optional_fields(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->opt_fields : NULL;
}
{
char *v = NULL, *f = NULL, *u = NULL, *n = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (optstr) {
char *v = NULL, *f = NULL, *u = NULL;
int rc;
- assert(fs);
if (!fs)
return -EINVAL;
if (!optstr)
char *v = NULL, *f = NULL, *u = NULL;
int rc;
- assert(fs);
if (!fs)
return -EINVAL;
if (!optstr)
*/
const char *mnt_fs_get_fs_options(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->fs_optstr : NULL;
}
*/
const char *mnt_fs_get_vfs_options(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->vfs_optstr : NULL;
}
*/
const char *mnt_fs_get_user_options(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->user_optstr : NULL;
}
*/
const char *mnt_fs_get_attributes(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->attrs : NULL;
}
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (optstr) {
*/
int mnt_fs_prepend_attributes(struct libmnt_fs *fs, const char *optstr)
{
- assert(fs);
if (!fs)
return -EINVAL;
if (!optstr)
*/
int mnt_fs_get_freq(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->freq : 0;
}
*/
int mnt_fs_set_freq(struct libmnt_fs *fs, int freq)
{
- assert(fs);
if (!fs)
return -EINVAL;
fs->freq = freq;
*/
int mnt_fs_get_passno(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->passno: 0;
}
*/
int mnt_fs_set_passno(struct libmnt_fs *fs, int passno)
{
- assert(fs);
if (!fs)
return -EINVAL;
fs->passno = passno;
*/
const char *mnt_fs_get_root(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->root : NULL;
}
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (root) {
*/
const char *mnt_fs_get_swaptype(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->swaptype : NULL;
}
*/
off_t mnt_fs_get_size(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->size : 0;
}
*/
off_t mnt_fs_get_usedsize(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->usedsize : 0;
}
*/
int mnt_fs_get_priority(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->priority : 0;
}
*/
int mnt_fs_set_priority(struct libmnt_fs *fs, int prio)
{
- assert(fs);
if (!fs)
return -EINVAL;
fs->priority = prio;
*/
const char *mnt_fs_get_bindsrc(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->bindsrc : NULL;
}
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (src) {
*/
int mnt_fs_get_id(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->id : -EINVAL;
}
*/
int mnt_fs_get_parent_id(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->parent : -EINVAL;
}
*/
dev_t mnt_fs_get_devno(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->devno : 0;
}
*/
pid_t mnt_fs_get_tid(struct libmnt_fs *fs)
{
- assert(fs);
return fs ? fs->tid : 0;
}
{
char rc = 1;
- assert(fs);
if (!fs)
return -EINVAL;
if (fs->fs_optstr)
{
char rc = 1;
- assert(fs);
if (!fs)
return -EINVAL;
if (fs->attrs)
*/
const char *mnt_fs_get_comment(struct libmnt_fs *fs)
{
- assert(fs);
if (!fs)
return NULL;
return fs->comment;
{
char *p = NULL;
- assert(fs);
if (!fs)
return -EINVAL;
if (comm) {
*/
int mnt_fs_append_comment(struct libmnt_fs *fs, const char *comm)
{
- assert(fs);
if (!fs)
return -EINVAL;
{
int rc = 0;
- assert(fs);
if (!fs || !target || !fs->target)
return 0;
char *cn;
const char *src, *t, *v;
- assert(fs);
if (!fs)
return 0;
*/
int mnt_fs_match_fstype(struct libmnt_fs *fs, const char *types)
{
- assert(fs);
return mnt_match_fstype(fs->fstype, types);
}
*/
int mnt_fs_match_options(struct libmnt_fs *fs, const char *options)
{
- assert(fs);
return mnt_match_options(mnt_fs_get_options(fs), options);
}
int rc;
struct mntent *m;
- assert(fs);
- assert(mnt);
if (!fs || !mnt)
return -EINVAL;
char *lo = NULL, *ln = NULL;
size_t losz;
- assert(datafile);
+ if (!datafile)
+ return NULL;
/* for flock we use "foo.lock, for mtab "foo~"
*/
return 1;
assert(name);
- assert(optstr);
namesz = strlen(name);
* @name: value name
* @value: value
*
- * Returns: 0 on success or -1 in case of error. After an error the @optstr should
+ * Returns: 0 on success or <0 in case of error. After an error the @optstr should
* be unmodified.
*/
int mnt_optstr_append_option(char **optstr, const char *name, const char *value)
{
size_t vsz, nsz;
- assert(optstr);
-
+ if (!optstr)
+ return -EINVAL;
if (!name || !*name)
return 0;
* @name: value name
* @value: value
*
- * Returns: 0 on success or -1 in case of error. After an error the @optstr should
+ * Returns: 0 on success or <0 in case of error. After an error the @optstr should
* be unmodified.
*/
int mnt_optstr_prepend_option(char **optstr, const char *name, const char *value)
int rc = 0;
char *tmp = *optstr;
- assert(optstr);
-
+ if (!optstr)
+ return -EINVAL;
if (!name || !*name)
return 0;
struct libmnt_optloc ol;
int rc;
- assert(optstr);
- assert(name);
+ if (!optstr || !name)
+ return -EINVAL;
mnt_init_optloc(&ol);
int rc;
char *begin = NULL, *end = NULL, *opt;
- assert(optstr);
- assert(name);
+ if (!optstr || !name)
+ return -EINVAL;
opt = *optstr;
do {
char *nameend;
int rc = 1;
- assert(optstr);
- assert(name);
-
- if (!optstr)
+ if (!optstr || !name)
return -EINVAL;
mnt_init_optloc(&ol);
struct libmnt_optloc ol;
int rc;
- assert(optstr);
- assert(name);
+ if (!optstr || !name)
+ return -EINVAL;
mnt_init_optloc(&ol);
size_t namesz, valsz;
struct libmnt_optmap const *maps[2];
- assert(optstr);
-
if (!optstr)
return -EINVAL;
size_t namesz = 0, valsz = 0;
int nmaps = 0;
- assert(optstr);
-
if (!optstr || !flags || !map)
return -EINVAL;
unsigned long fl;
int rc = 0;
- assert(optstr);
-
if (!optstr || !map)
return -EINVAL;
*/
int mnt_table_is_empty(struct libmnt_table *tb)
{
- assert(tb);
return tb == NULL || list_empty(&tb->ents) ? 1 : 0;
}
*/
int mnt_table_set_userdata(struct libmnt_table *tb, void *data)
{
- assert(tb);
if (!tb)
return -EINVAL;
*/
void *mnt_table_get_userdata(struct libmnt_table *tb)
{
- assert(tb);
return tb ? tb->userdata : NULL;
}
* # this comments belongs to the first fs
* LABEL=foo /mnt/foo auto defaults 1 2
* # this comments belongs to the second fs
- * LABEL=bar /mnt/bar auto defaults 1 2
+ * LABEL=bar /mnt/bar auto defaults 1 2
* # tailing comment
* </programlisting>
* </informalexample>
*/
void mnt_table_enable_comments(struct libmnt_table *tb, int enable)
{
- assert(tb);
if (tb)
tb->comms = enable;
}
*/
const char *mnt_table_get_intro_comment(struct libmnt_table *tb)
{
- assert(tb);
return tb ? tb->comm_intro : NULL;
}
{
char *p = NULL;
- assert(tb);
if (!tb)
return -EINVAL;
if (comm) {
*/
int mnt_table_append_intro_comment(struct libmnt_table *tb, const char *comm)
{
- assert(tb);
if (!tb)
return -EINVAL;
return append_string(&tb->comm_intro, comm);
*/
const char *mnt_table_get_trailing_comment(struct libmnt_table *tb)
{
- assert(tb);
return tb ? tb->comm_tail : NULL;
}
{
char *p = NULL;
- assert(tb);
if (!tb)
return -EINVAL;
if (comm) {
*/
int mnt_table_append_trailing_comment(struct libmnt_table *tb, const char *comm)
{
- assert(tb);
if (!tb)
return -EINVAL;
return append_string(&tb->comm_tail, comm);
*/
int mnt_table_set_cache(struct libmnt_table *tb, struct libmnt_cache *mpc)
{
- assert(tb);
if (!tb)
return -EINVAL;
*/
struct libmnt_cache *mnt_table_get_cache(struct libmnt_table *tb)
{
- assert(tb);
return tb ? tb->cache : NULL;
}
*/
int mnt_table_add_fs(struct libmnt_table *tb, struct libmnt_fs *fs)
{
- assert(tb);
- assert(fs);
-
if (!tb || !fs)
return -EINVAL;
*/
int mnt_table_remove_fs(struct libmnt_table *tb, struct libmnt_fs *fs)
{
- assert(tb);
- assert(fs);
-
if (!tb || !fs)
return -EINVAL;
struct libmnt_fs *fs;
int root_id = 0;
- assert(tb);
- assert(root);
-
if (!tb || !root || !is_mountinfo(tb))
return -EINVAL;
{
int rc = 1;
- assert(tb);
- assert(itr);
- assert(fs);
-
if (!tb || !itr || !fs)
return -EINVAL;
*fs = NULL;
*/
int mnt_table_first_fs(struct libmnt_table *tb, struct libmnt_fs **fs)
{
- assert(tb);
- assert(fs);
-
if (!tb || !fs)
return -EINVAL;
if (list_empty(&tb->ents))
*/
int mnt_table_last_fs(struct libmnt_table *tb, struct libmnt_fs **fs)
{
- assert(tb);
- assert(fs);
-
if (!tb || !fs)
return -EINVAL;
if (list_empty(&tb->ents))
struct libmnt_iter itr;
struct libmnt_fs *fs;
- assert(tb);
-
if (!tb)
return -EINVAL;
if (list_empty(&tb->ents))
struct libmnt_fs *fs;
int direction = MNT_ITER_BACKWARD;
- assert(tb);
- assert(cmp);
-
if (!tb || !cmp)
return -EINVAL;
if (list_empty(&tb->ents))
*/
int mnt_table_set_iter(struct libmnt_table *tb, struct libmnt_iter *itr, struct libmnt_fs *fs)
{
- assert(tb);
- assert(itr);
- assert(fs);
-
if (!tb || !itr || !fs)
return -EINVAL;
struct libmnt_fs *fs = NULL;
char *cn;
- assert(tb);
- assert(path);
-
if (!tb || !path || !*path)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)
char *cn;
const char *p;
- assert(tb);
if (!tb || !path || !*path)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)
struct libmnt_iter itr;
struct libmnt_fs *fs = NULL;
- assert(tb);
- assert(tag);
- assert(val);
-
if (!tb || !tag || !*tag || !val)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)
struct libmnt_fs *fs;
char *t = NULL, *v = NULL;
- assert(tb);
-
if (!tb)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)
struct libmnt_fs *fs = NULL;
struct libmnt_iter itr;
- assert(tb);
- assert(target);
-
if (!tb || !target || !*target || !source || !*source)
return NULL;
if (direction != MNT_ITER_FORWARD && direction != MNT_ITER_BACKWARD)
}
/**
- * mnt_table_is_fs__mounted:
+ * mnt_table_is_fs_mounted:
* @tb: /proc/self/mountinfo file
* @fstab_fs: /etc/fstab entry
*
int rc = 0;
dev_t devno = 0;
- assert(tb);
- assert(fstab_fs);
-
DBG(FS, ul_debugobj(fstab_fs, "is FS mounted? [target=%s]",
mnt_fs_get_target(fstab_fs)));
int rc = 1;
struct tabdiff_entry *de = NULL;
- assert(df);
- assert(df);
-
if (!df || !itr)
return -EINVAL;
FILE *f;
int rc;
- assert(tb);
- assert(filename);
-
if (!filename || !tb)
return -EINVAL;
struct libmnt_table *tb;
struct stat st;
- assert(filename);
if (!filename)
return NULL;
if (stat(filename, &st))
*/
struct libmnt_table *mnt_new_table_from_file(const char *filename)
{
- assert(filename);
+ if (!filename)
+ return NULL;
+
return __mnt_new_table_from_file(filename, MNT_FMT_GUESS);
}
{
struct libmnt_table *tb;
- assert(dirname);
if (!dirname)
return NULL;
tb = mnt_new_table();
int mnt_table_set_parser_errcb(struct libmnt_table *tb,
int (*cb)(struct libmnt_table *tb, const char *filename, int line))
{
- assert(tb);
if (!tb)
return -EINVAL;
tb->errcb = cb;
int (*cb)(struct libmnt_fs *, void *),
void *data)
{
- assert(tb);
if (!tb)
return -EINVAL;
*/
int mnt_table_parse_swaps(struct libmnt_table *tb, const char *filename)
{
- assert(tb);
-
if (!tb)
return -EINVAL;
if (!filename) {
struct stat st;
int rc = 0;
- assert(tb);
if (!tb)
return -EINVAL;
if (!filename)
struct libmnt_iter itr;
const char *optstr, *src, *target, *root, *attrs;
- assert(tb);
- assert(uf);
if (!tb || !uf)
return NULL;
const char *path = NULL;
int rw = 0;
- assert(upd);
if (!upd)
return -EINVAL;
*/
const char *mnt_update_get_filename(struct libmnt_update *upd)
{
- assert(upd);
return upd ? upd->filename : NULL;
}
*/
int mnt_update_is_ready(struct libmnt_update *upd)
{
- assert(upd);
return upd ? upd->ready : FALSE;
}
{
int rc;
- assert(upd);
- assert(target || fs);
-
if (!upd)
return -EINVAL;
if ((mountflags & MS_MOVE) && (!fs || !mnt_fs_get_srcpath(fs)))
*/
struct libmnt_fs *mnt_update_get_fs(struct libmnt_update *upd)
{
- assert(upd);
return upd ? upd->fs : NULL;
}
*/
unsigned long mnt_update_get_mflags(struct libmnt_update *upd)
{
- assert(upd);
return upd ? upd->mountflags : 0;
}
{
int rc = 0;
- assert(upd);
if (!upd || !upd->fs)
return -EINVAL;
char *p;
int rc = 0;
- assert(fs);
- assert(f);
-
if (!fs || !f)
return -EINVAL;
int rc, fd;
char *uq = NULL;
- assert(upd);
if (!tb || !upd->filename)
return -EINVAL;
struct libmnt_lock *lc0 = lc;
int rc = -EINVAL;
- assert(upd);
if (!upd || !upd->filename)
return -EINVAL;
if (!upd->ready)
*/
int mnt_fstype_is_netfs(const char *type)
{
- assert(type);
-
if (strcmp(type, "cifs") == 0 ||
strcmp(type, "smbfs") == 0 ||
strncmp(type,"nfs", 3) == 0 ||
struct stat st;
dev_t dir, base;
- assert(path);
+ if (!path)
+ return NULL;
mnt = strdup(path);
if (!mnt)