Changeset View
Changeset View
Standalone View
Standalone View
sbin/mount/mount.c
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | int mountfs(const char *, const char *, const char *, | ||||
int, const char *, const char *); | int, const char *, const char *); | ||||
void remopt(char *, const char *); | void remopt(char *, const char *); | ||||
void prmount(struct statfs *); | void prmount(struct statfs *); | ||||
void putfsent(struct statfs *); | void putfsent(struct statfs *); | ||||
void usage(void); | void usage(void); | ||||
char *flags2opts(int); | char *flags2opts(int); | ||||
/* Map from mount options to printable formats. */ | /* Map from mount options to printable formats. */ | ||||
static struct opt { | static struct opt { | ||||
imp: This needs a smidge more work... I missed it focusing on the kernel.
| |||||
uint64_t o_opt; | uint64_t o_opt; | ||||
const char *o_name; | const char *o_name; | ||||
} optnames[] = { | } optnames[] = { | ||||
{ MNT_ASYNC, "asynchronous" }, | { MNT_ASYNC, "asynchronous" }, | ||||
{ MNT_EXPORTED, "NFS exported" }, | { MNT_EXPORTED, "NFS exported" }, | ||||
{ MNT_LOCAL, "local" }, | { MNT_LOCAL, "local" }, | ||||
{ MNT_NOATIME, "noatime" }, | { MNT_NOATIME, "noatime" }, | ||||
{ MNT_NOEXEC, "noexec" }, | { MNT_NOEXEC, "noexec" }, | ||||
Show All 12 Lines | static struct opt { | ||||
{ MNT_ACLS, "acls" }, | { MNT_ACLS, "acls" }, | ||||
{ MNT_NFS4ACLS, "nfsv4acls" }, | { MNT_NFS4ACLS, "nfsv4acls" }, | ||||
{ MNT_GJOURNAL, "gjournal" }, | { MNT_GJOURNAL, "gjournal" }, | ||||
{ MNT_AUTOMOUNTED, "automounted" }, | { MNT_AUTOMOUNTED, "automounted" }, | ||||
{ MNT_VERIFIED, "verified" }, | { MNT_VERIFIED, "verified" }, | ||||
{ MNT_UNTRUSTED, "untrusted" }, | { MNT_UNTRUSTED, "untrusted" }, | ||||
{ MNT_NOCOVER, "nocover" }, | { MNT_NOCOVER, "nocover" }, | ||||
{ MNT_EMPTYDIR, "emptydir" }, | { MNT_EMPTYDIR, "emptydir" }, | ||||
{ 0, NULL } | { 0, NULL } | ||||
Not Done Inline Actionsstatic const kib: static const | |||||
}; | }; | ||||
/* | /* | ||||
* List of VFS types that can be remounted without becoming mounted on top | * List of VFS types that can be remounted without becoming mounted on top | ||||
* of each other. | * of each other. | ||||
* XXX Is this list correct? | * XXX Is this list correct? | ||||
*/ | */ | ||||
static const char * | static const char * | ||||
▲ Show 20 Lines • Show All 559 Lines • ▼ Show 20 Lines | if (sfp->f_syncwrites != 0 || sfp->f_asyncwrites != 0) | ||||
(void)printf(", writes: sync %ju async %ju", | (void)printf(", writes: sync %ju async %ju", | ||||
(uintmax_t)sfp->f_syncwrites, | (uintmax_t)sfp->f_syncwrites, | ||||
(uintmax_t)sfp->f_asyncwrites); | (uintmax_t)sfp->f_asyncwrites); | ||||
if (sfp->f_syncreads != 0 || sfp->f_asyncreads != 0) | if (sfp->f_syncreads != 0 || sfp->f_asyncreads != 0) | ||||
(void)printf(", reads: sync %ju async %ju", | (void)printf(", reads: sync %ju async %ju", | ||||
(uintmax_t)sfp->f_syncreads, | (uintmax_t)sfp->f_syncreads, | ||||
(uintmax_t)sfp->f_asyncreads); | (uintmax_t)sfp->f_asyncreads); | ||||
if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) { | if (sfp->f_fsid.val[0] != 0 || sfp->f_fsid.val[1] != 0) { | ||||
printf(", fsid "); | (void)printf(", fsid "); | ||||
for (i = 0; i < sizeof(sfp->f_fsid); i++) | for (i = 0; i < sizeof(sfp->f_fsid); i++) | ||||
printf("%02x", ((u_char *)&sfp->f_fsid)[i]); | (void)printf("%02x", ((u_char *)&sfp->f_fsid)[i]); | ||||
} | } | ||||
} | } | ||||
(void)printf(")\n"); | (void)printf(")\n"); | ||||
} | } | ||||
struct statfs * | struct statfs * | ||||
getmntpt(const char *name) | getmntpt(const char *name) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 274 Lines • Show Last 20 Lines |
This needs a smidge more work... I missed it focusing on the kernel.