Whamcloud - gitweb
LU-10086 libcfs: use dynamic minors for /dev/{lnet,obd}
[fs/lustre-release.git] / lustre / include / lustre_compat.h
index 11217c2..237d7b8 100644 (file)
@@ -290,19 +290,6 @@ static inline int ll_namei_to_lookup_intent_flag(int flag)
        return flag;
 }
 
-#ifdef HAVE_QC_MAKE_REQUEST_FN
-# define ll_mrf_ret blk_qc_t
-# define LL_MRF_RETURN(rc) RETURN(BLK_QC_T_NONE)
-#else
-# ifdef HAVE_VOID_MAKE_REQUEST_FN
-#  define ll_mrf_ret void
-#  define LL_MRF_RETURN(rc)
-# else
-#  define ll_mrf_ret int
-#  define LL_MRF_RETURN(rc) RETURN(rc)
-# endif
-#endif
-
 #include <linux/fs.h>
 #ifndef HAVE_PROTECT_I_NLINK
 static inline void set_nlink(struct inode *inode, unsigned int nlink)
@@ -493,6 +480,30 @@ __vfs_setxattr(struct dentry *dentry, struct inode *inode, const char *name,
 #endif /* HAVE_XATTR_HANDLER_FLAGS */
 #endif /* HAVE_VFS_SETXATTR */
 
+#ifdef HAVE_IOP_SET_ACL
+#ifdef CONFIG_FS_POSIX_ACL
+#ifndef HAVE_POSIX_ACL_UPDATE_MODE
+static inline int posix_acl_update_mode(struct inode *inode, umode_t *mode_p,
+                         struct posix_acl **acl)
+{
+       umode_t mode = inode->i_mode;
+       int error;
+
+       error = posix_acl_equiv_mode(*acl, &mode);
+       if (error < 0)
+               return error;
+       if (error == 0)
+               *acl = NULL;
+       if (!in_group_p(inode->i_gid) &&
+           !capable_wrt_inode_uidgid(inode, CAP_FSETID))
+               mode &= ~S_ISGID;
+       *mode_p = mode;
+       return 0;
+}
+#endif /* HAVE_POSIX_ACL_UPDATE_MODE */
+#endif
+#endif
+
 #ifndef HAVE_IOV_ITER_TRUNCATE
 static inline void iov_iter_truncate(struct iov_iter *i, u64 count)
 {
@@ -633,4 +644,11 @@ static inline void __user *get_vmf_address(struct vm_fault *vmf)
 # define ll_filemap_fault(vma, vmf) filemap_fault(vma, vmf)
 #endif
 
+#ifndef HAVE_CURRENT_TIME
+static inline struct timespec current_time(struct inode *inode)
+{
+       return CURRENT_TIME;
+}
+#endif
+
 #endif /* _LUSTRE_COMPAT_H */