mount-util: move fstype_is_network() and name_to_handle_at() definitions over
authorLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:45:00 +0000 (13:45 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:45:53 +0000 (13:45 +0100)
src/basic/mount-util.c
src/basic/mount-util.h
src/basic/stat-util.h
src/basic/util.c
src/basic/util.h
src/core/mount.c
src/libudev/libudev-monitor.c
src/tmpfiles/tmpfiles.c

index fefa507..d04e749 100644 (file)
@@ -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);
+}
index b415d00..c87ae93 100644 (file)
   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 }
index 82edea0..909b220 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <stdbool.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <sys/vfs.h>
 
 #include "macro.h"
index 62d58c1..da7de27 100644 (file)
@@ -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);
 
index e2fceaf..fc329a8 100644 (file)
@@ -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)
index 68cf312..77b5ec2 100644 (file)
@@ -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"
index fedaea6..c3883e4 100644 (file)
@@ -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"
 
index 3c0b999..4533542 100644 (file)
@@ -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"