diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-10-27 13:45:00 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-27 13:45:53 +0100 |
commit | 4e036b7a96b7a72461bdb68ded304041e892b8eb (patch) | |
tree | 8b1b79bb8e1ca4e715f1fd6ec3e643567e690996 | |
parent | 5e524b404b7b319aa6a24bf21132b1074b206996 (diff) |
mount-util: move fstype_is_network() and name_to_handle_at() definitions over
-rw-r--r-- | src/basic/mount-util.c | 23 | ||||
-rw-r--r-- | src/basic/mount-util.h | 16 | ||||
-rw-r--r-- | src/basic/stat-util.h | 1 | ||||
-rw-r--r-- | src/basic/util.c | 23 | ||||
-rw-r--r-- | src/basic/util.h | 8 | ||||
-rw-r--r-- | src/core/mount.c | 1 | ||||
-rw-r--r-- | src/libudev/libudev-monitor.c | 1 | ||||
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 1 |
8 files changed, 42 insertions, 32 deletions
diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c index fefa50709c..d04e7492e5 100644 --- a/src/basic/mount-util.c +++ b/src/basic/mount-util.c @@ -483,3 +483,26 @@ int mount_move_root(const char *path) { return 0; } + +bool fstype_is_network(const char *fstype) { + static const char table[] = + "afs\0" + "cifs\0" + "smbfs\0" + "sshfs\0" + "ncpfs\0" + "ncp\0" + "nfs\0" + "nfs4\0" + "gfs\0" + "gfs2\0" + "glusterfs\0"; + + const char *x; + + x = startswith(fstype, "fuse."); + if (x) + fstype = x; + + return nulstr_contains(table, fstype); +} diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h index b415d00e2f..c87ae93e55 100644 --- a/src/basic/mount-util.h +++ b/src/basic/mount-util.h @@ -21,8 +21,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <stdbool.h> +#include <fcntl.h> #include <mntent.h> +#include <stdbool.h> +#include <sys/stat.h> +#include <sys/types.h> + +#include "missing.h" int fd_is_mount_point(int fd, const char *filename, int flags); int path_is_mount_point(const char *path, int flags); @@ -34,3 +39,12 @@ int mount_move_root(const char *path); DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent); #define _cleanup_endmntent_ _cleanup_(endmntentp) + +bool fstype_is_network(const char *fstype); + +union file_handle_union { + struct file_handle handle; + char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ]; +}; + +#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ } diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h index 82edea06a8..909b220a24 100644 --- a/src/basic/stat-util.h +++ b/src/basic/stat-util.h @@ -23,6 +23,7 @@ #include <stdbool.h> #include <sys/stat.h> +#include <sys/types.h> #include <sys/vfs.h> #include "macro.h" diff --git a/src/basic/util.c b/src/basic/util.c index 62d58c13fd..da7de27a04 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -125,29 +125,6 @@ size_t page_size(void) { return pgsz; } -bool fstype_is_network(const char *fstype) { - static const char table[] = - "afs\0" - "cifs\0" - "smbfs\0" - "sshfs\0" - "ncpfs\0" - "ncp\0" - "nfs\0" - "nfs4\0" - "gfs\0" - "gfs2\0" - "glusterfs\0"; - - const char *x; - - x = startswith(fstype, "fuse."); - if (x) - fstype = x; - - return nulstr_contains(table, fstype); -} - void rename_process(const char name[8]) { assert(name); diff --git a/src/basic/util.h b/src/basic/util.h index e2fceafd9a..fc329a869b 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -66,8 +66,6 @@ static inline const char* one_zero(bool b) { return b ? "1" : "0"; } -bool fstype_is_network(const char *fstype); - noreturn void freeze(void); void execute_directories(const char* const* directories, usec_t timeout, char *argv[]); @@ -202,12 +200,6 @@ const char *personality_to_string(unsigned long); uint64_t physical_memory(void); -union file_handle_union { - struct file_handle handle; - char padding[sizeof(struct file_handle) + MAX_HANDLE_SZ]; -}; -#define FILE_HANDLE_INIT { .handle.handle_bytes = MAX_HANDLE_SZ } - int update_reboot_param_file(const char *param); #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1) diff --git a/src/core/mount.c b/src/core/mount.c index 68cf312fca..77b5ec27eb 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -36,6 +36,7 @@ #include "manager.h" #include "mkdir.h" #include "mount-setup.h" +#include "mount-util.h" #include "mount.h" #include "parse-util.h" #include "path-util.h" diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c index fedaea6118..c3883e485b 100644 --- a/src/libudev/libudev-monitor.c +++ b/src/libudev/libudev-monitor.c @@ -36,6 +36,7 @@ #include "formats-util.h" #include "libudev-private.h" #include "missing.h" +#include "mount-util.h" #include "socket-util.h" #include "string-util.h" diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 3c0b9993e3..45335425ce 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -57,6 +57,7 @@ #include "macro.h" #include "missing.h" #include "mkdir.h" +#include "mount-util.h" #include "parse-util.h" #include "path-util.h" #include "rm-rf.h" |