Add a function vfs_deleteopt() which searches through the vfsoptlist

linked list of mount options by name, and deletes the option if it finds it.
This commit is contained in:
Craig Rodrigues 2006-12-16 15:44:03 +00:00
parent e521ae0c64
commit 2892f3bbfa
2 changed files with 12 additions and 0 deletions

View File

@ -197,6 +197,17 @@ vfs_freeopts(struct vfsoptlist *opts)
free(opts, M_MOUNT);
}
void
vfs_deleteopt(struct vfsoptlist *opts, const char *name)
{
struct vfsopt *opt, *temp;
TAILQ_FOREACH_SAFE(opt, opts, link, temp) {
if (strcmp(opt->name, name) == 0)
vfs_freeopt(opts, opt);
}
}
/*
* Check if options are equal (with or without the "no" prefix).
*/

View File

@ -650,6 +650,7 @@ struct mntarg *mount_argsu(struct mntarg *ma, const char *name, const void *val,
struct vfsconf *vfs_byname(const char *);
struct vfsconf *vfs_byname_kld(const char *, struct thread *td, int *);
void vfs_event_signal(fsid_t *, u_int32_t, intptr_t);
void vfs_deleteopt(struct vfsoptlist *opts, const char *name);
int vfs_flagopt(struct vfsoptlist *opts, const char *name, u_int *w, u_int val);
int vfs_getopt(struct vfsoptlist *, const char *, void **, int *);
char *vfs_getopts(struct vfsoptlist *, const char *, int *error);