Whamcloud - gitweb
LU-6142 lustre: convert IFTODT to S_DT
[fs/lustre-release.git] / libcfs / include / libcfs / linux / linux-fs.h
index 327793c..a5beff2 100644 (file)
 #ifndef __LIBCFS_LINUX_CFS_FS_H__
 #define __LIBCFS_LINUX_CFS_FS_H__
 
-#ifndef __LIBCFS_LIBCFS_H__
-#error Do not #include this file directly. #include <libcfs/libcfs.h> instead
-#endif
-
-#ifndef __KERNEL__
-#error This include is only for kernel use.
-#endif
-
 #include <linux/fs.h>
 #include <linux/stat.h>
 #include <linux/mount.h>
 #include <linux/backing-dev.h>
-#include <linux/posix_acl_xattr.h>
 
 #ifndef HAVE_FILE_DENTRY
 static inline struct dentry *file_dentry(const struct file *file)
@@ -58,36 +49,15 @@ static inline struct dentry *file_dentry(const struct file *file)
 }
 #endif
 
-#if defined(HAVE_FILE_FSYNC_4ARGS) || defined(HAVE_FILE_FSYNC_2ARGS)
-#define ll_vfs_fsync_range(fp, start, end, datasync) \
-       vfs_fsync_range(fp, start, end, datasync)
-#else
-#define ll_vfs_fsync_range(fp, start, end, datasync) \
-       vfs_fsync_range(fp, file_dentry(fp), start, end, datasync)
-#endif
-
-#ifndef IFSHIFT
-#define IFSHIFT                        12
+#ifndef S_DT_SHIFT
+#define S_DT_SHIFT             12
 #endif
 
-#ifndef IFTODT
-#define IFTODT(type)           (((type) & S_IFMT) >> IFSHIFT)
+#ifndef S_DT
+#define S_DT(type)             (((type) & S_IFMT) >> S_DT_SHIFT)
 #endif
 #ifndef DTTOIF
-#define DTTOIF(dirtype)                ((dirtype) << IFSHIFT)
+#define DTTOIF(dirtype)                ((dirtype) << S_DT_SHIFT)
 #endif
 
-#ifndef HAVE_POSIXACL_USER_NS
-/*
- * Mask out &init_user_ns so we don't jump
- * through hoops to define it somehow only
- * to have it ignored anyway.
- */
-#define posix_acl_from_xattr(a,b,c)    posix_acl_from_xattr(b,c)
-#define posix_acl_to_xattr(a,b,c,d)    posix_acl_to_xattr(b,c,d)
-#endif
-
-#ifndef HAVE_POSIX_ACL_VALID_USER_NS
-#define posix_acl_valid(a,b) posix_acl_valid(b)
-#endif
 #endif