From: Lennart Poettering Date: Sat, 10 Apr 2010 15:41:34 +0000 (+0200) Subject: util: introduce fstype_is_network() X-Git-Tag: 0.git+20100605+dfd8ee-1~171 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42856c1093c1644d31b83d7a131bfe4b061c5e4d;p=systemd util: introduce fstype_is_network() --- diff --git a/util.c b/util.c index 52ca5e25..f3161bd7 100644 --- a/util.c +++ b/util.c @@ -1276,6 +1276,24 @@ char *format_timestamp(char *buf, size_t l, usec_t t) { return buf; } +bool fstype_is_network(const char *fstype) { + static const char * const table[] = { + "cifs", + "smbfs", + "ncpfs", + "nfs", + "nfs4" + }; + + unsigned i; + + for (i = 0; i < ELEMENTSOF(table); i++) + if (streq(table[i], fstype)) + return true; + + return false; +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", diff --git a/util.h b/util.h index df2f3f79..a716d8a5 100644 --- a/util.h +++ b/util.h @@ -196,6 +196,8 @@ int fd_cloexec(int fd, bool cloexec); int close_all_fds(const int except[], unsigned n_except); +bool fstype_is_network(const char *fstype); + extern char * __progname; const char *ioprio_class_to_string(int i);