[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH] lib/vfscore: Use mount definitions from <sys/mount.h>



Give mount constant/flags definitions introduced by the libC higher
priority than the internal ones. This is done to provide a correct
libC API implementation with vfscore.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 lib/nolibc/include/sys/mount.h      |  8 +++---
 lib/vfscore/include/vfscore/mount.h | 41 ++++++++++++++++++++++++++---
 lib/vfscore/mount.c                 |  3 ++-
 3 files changed, 44 insertions(+), 8 deletions(-)

diff --git a/lib/nolibc/include/sys/mount.h b/lib/nolibc/include/sys/mount.h
index d7a95b38..c8b1fe27 100644
--- a/lib/nolibc/include/sys/mount.h
+++ b/lib/nolibc/include/sys/mount.h
@@ -92,10 +92,10 @@ extern "C" {
 #define MS_MGC_VAL 0xc0ed0000
 #define MS_MGC_MSK 0xffff0000
 
-#define MNT_FORCE       1
-#define MNT_DETACH      2
-#define MNT_EXPIRE      4
-#define UMOUNT_NOFOLLOW 8
+#define MNT_FORCE       0x00000001
+#define MNT_DETACH      0x00000002
+#define MNT_EXPIRE      0x00000004
+#define UMOUNT_NOFOLLOW 0x00000008
 
 int mount(const char *dev, const char *dir, const char *fsname,
          unsigned long flags, const void *data);
diff --git a/lib/vfscore/include/vfscore/mount.h 
b/lib/vfscore/include/vfscore/mount.h
index b85e211e..11fa098b 100644
--- a/lib/vfscore/include/vfscore/mount.h
+++ b/lib/vfscore/include/vfscore/mount.h
@@ -29,11 +29,12 @@
  *     @(#)mount.h     8.21 (Berkeley) 5/20/95
  */
 
-#ifndef _SYS_MOUNT_H_
-#define _SYS_MOUNT_H_
+#ifndef _VFSCORE_SYS_MOUNT_H_
+#define _VFSCORE_SYS_MOUNT_H_
 
 #define _BSD_SOURCE
 
+#include <sys/mount.h>
 #include <sys/statfs.h>
 #include <limits.h>
 #include <uk/list.h>
@@ -60,39 +61,73 @@ struct mount {
 /*
  * Mount flags.
  */
+#ifndef MNT_RDONLY
 #define        MNT_RDONLY      0x00000001      /* read only filesystem */
+#endif
+#ifndef        MNT_SYNCHRONOUS
 #define        MNT_SYNCHRONOUS 0x00000002      /* file system written 
synchronously */
+#endif
+#ifndef        MNT_NOEXEC
 #define        MNT_NOEXEC      0x00000004      /* can't exec from filesystem */
+#endif
+#ifndef        MNT_NOSUID
 #define        MNT_NOSUID      0x00000008      /* don't honor setuid bits on 
fs */
+#endif
+#ifndef        MNT_NODEV
 #define        MNT_NODEV       0x00000010      /* don't interpret special 
files */
+#endif
+#ifndef        MNT_UNION
 #define        MNT_UNION       0x00000020      /* union with underlying 
filesystem */
+#endif
+#ifndef        MNT_ASYNC
 #define        MNT_ASYNC       0x00000040      /* file system written 
asynchronously */
+#endif
 
 /*
  * Unmount flags.
  */
+#ifndef MNT_FORCE
 #define MNT_FORCE      0x00000001      /* forced unmount */
+#endif
 
 /*
  * exported mount flags.
  */
+#ifndef        MNT_EXRDONLY
 #define        MNT_EXRDONLY    0x00000080      /* exported read only */
+#endif
+#ifndef        MNT_EXPORTED
 #define        MNT_EXPORTED    0x00000100      /* file system is exported */
+#endif
+#ifndef        MNT_DEFEXPORTED
 #define        MNT_DEFEXPORTED 0x00000200      /* exported to the world */
+#endif
+#ifndef        MNT_EXPORTANON
 #define        MNT_EXPORTANON  0x00000400      /* use anon uid mapping for 
everyone */
+#endif
+#ifndef        MNT_EXKERB
 #define        MNT_EXKERB      0x00000800      /* exported with Kerberos uid 
mapping */
+#endif
 
 /*
  * Flags set by internal operations.
  */
+#ifndef        MNT_LOCAL
 #define        MNT_LOCAL       0x00001000      /* filesystem is stored locally 
*/
+#endif
+#ifndef        MNT_QUOTA
 #define        MNT_QUOTA       0x00002000      /* quotas are enabled on 
filesystem */
+#endif
+#ifndef        MNT_ROOTFS
 #define        MNT_ROOTFS      0x00004000      /* identifies the root 
filesystem */
+#endif
 
 /*
  * Mask of flags that are visible to statfs()
  */
+#ifndef        MNT_VISFLAGMASK
 #define        MNT_VISFLAGMASK 0x0000ffff
+#endif
 
 /*
  * Filesystem type switch table.
@@ -144,4 +179,4 @@ void         vfs_unbusy(struct mount *mp);
 
 void    vfscore_release_mp_dentries(struct mount *mp);
 
-#endif /* !_SYS_MOUNT_H_ */
+#endif /* !_VFSCORE_SYS_MOUNT_H_ */
diff --git a/lib/vfscore/mount.c b/lib/vfscore/mount.c
index 9d7ace15..1a778be2 100644
--- a/lib/vfscore/mount.c
+++ b/lib/vfscore/mount.c
@@ -109,7 +109,8 @@ int device_close(struct device *dev)
 }
 
 int
-mount(const char *dev, const char *dir, const char *fsname, int flags, const 
void *data)
+mount(const char *dev, const char *dir, const char *fsname, unsigned long 
flags,
+      const void *data)
 {
        const struct vfscore_fs_type *fs;
        struct mount *mp;
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.