mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-02-26 14:09:03 +07:00
util: introduce fstype_is_network()
This commit is contained in:
parent
1adf1049dc
commit
42856c1093
18
util.c
18
util.c
@ -1276,6 +1276,24 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
|
|||||||
return buf;
|
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[] = {
|
static const char *const ioprio_class_table[] = {
|
||||||
[IOPRIO_CLASS_NONE] = "none",
|
[IOPRIO_CLASS_NONE] = "none",
|
||||||
[IOPRIO_CLASS_RT] = "realtime",
|
[IOPRIO_CLASS_RT] = "realtime",
|
||||||
|
2
util.h
2
util.h
@ -196,6 +196,8 @@ int fd_cloexec(int fd, bool cloexec);
|
|||||||
|
|
||||||
int close_all_fds(const int except[], unsigned n_except);
|
int close_all_fds(const int except[], unsigned n_except);
|
||||||
|
|
||||||
|
bool fstype_is_network(const char *fstype);
|
||||||
|
|
||||||
extern char * __progname;
|
extern char * __progname;
|
||||||
|
|
||||||
const char *ioprio_class_to_string(int i);
|
const char *ioprio_class_to_string(int i);
|
||||||
|
Loading…
Reference in New Issue
Block a user