X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibspl%2Finclude%2Fsys%2Fmount.h;h=7b1e06bdb2874929c7fab5b202c6abc82bad0e95;hb=a1d9543a39942be56879ca9338078afc77c25cea;hp=144f915d2d9c65046470a4f4c3d32c5020c384e0;hpb=a26baf285f71eb95f1eace8c79d12d647a694488;p=zfs.git diff --git a/lib/libspl/include/sys/mount.h b/lib/libspl/include/sys/mount.h index 144f915..7b1e06b 100644 --- a/lib/libspl/include/sys/mount.h +++ b/lib/libspl/include/sys/mount.h @@ -42,9 +42,42 @@ #define BLKGETSIZE64 _IOR(0x12, 114, size_t) #endif -#define MS_FORCE MNT_FORCE -#define MS_OVERLAY 32768 -#define MS_NOMNTTAB 0 /* Not supported in Linux */ -#define MS_OPTIONSTR 0 /* Not necessary in Linux */ +/* + * Some old glibc headers don't correctly define MS_DIRSYNC and + * instead use the enum name S_WRITE. When using these older + * headers define MS_DIRSYNC to be S_WRITE. + */ +#if !defined(MS_DIRSYNC) +#define MS_DIRSYNC S_WRITE +#endif + +#define MS_USERS (MS_NOEXEC|MS_NOSUID|MS_NODEV) +#define MS_OWNER (MS_NOSUID|MS_NODEV) +#define MS_GROUP (MS_NOSUID|MS_NODEV) +#define MS_COMMENT 0 + +/* + * Older glibc headers did not define all the available + * umount2(2) flags. Both MNT_FORCE and MNT_DETACH are supported in the + * kernel back to 2.4.11 so we define them correctly if they are missing. + */ +#ifdef MNT_FORCE +# define MS_FORCE MNT_FORCE +#else +# define MS_FORCE 0x00000001 +#endif /* MNT_FORCE */ + +#ifdef MNT_DETACH +# define MS_DETACH MNT_DETACH +#else +# define MS_DETACH 0x00000002 +#endif /* MNT_DETACH */ + +/* + * Overlay mount is default in Linux, but for solaris/zfs + * compatibility, MS_OVERLAY is defined to explicitly have the user + * provide a flag (-O) to mount over a non empty directory. + */ +#define MS_OVERLAY 0x00000004 #endif /* _LIBSPL_SYS_MOUNT_H */