Whamcloud - gitweb
LU-15850 llite: pass dmv inherit depth instead of dir depth
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index 09f8d70..b3188d0 100644 (file)
@@ -171,6 +171,10 @@ struct ll_inode_info {
                        pid_t                           lli_opendir_pid;
                        /* directory depth to ROOT */
                        unsigned short                  lli_dir_depth;
+                       /* directory depth to ancestor whose default LMV is
+                        * inherited.
+                        */
+                       unsigned short                  lli_inherit_depth;
                        /* stat will try to access statahead entries or start
                         * statahead if this flag is set, and this flag will be
                         * set upon dir open, and cleared when dir is closed,
@@ -489,6 +493,23 @@ static inline void obd_connect_set_enc(struct obd_connect_data *data)
 #endif
 }
 
+static inline bool obd_connect_has_name_enc(struct obd_connect_data *data)
+{
+#ifdef HAVE_LUSTRE_CRYPTO
+       return data->ocd_connect_flags & OBD_CONNECT_FLAGS2 &&
+               data->ocd_connect_flags2 & OBD_CONNECT2_ENCRYPT_NAME;
+#else
+       return false;
+#endif
+}
+
+static inline void obd_connect_set_name_enc(struct obd_connect_data *data)
+{
+#ifdef HAVE_LUSTRE_CRYPTO
+       data->ocd_connect_flags2 |= OBD_CONNECT2_ENCRYPT_NAME;
+#endif
+}
+
 /*
  * Locking to guarantee consistency of non-atomic updates to long long i_size,
  * consistency between file size and KMS.
@@ -654,6 +675,7 @@ enum ll_sbi_flags {
        LL_SBI_TINY_WRITE,              /* tiny write support */
        LL_SBI_FILE_HEAT,               /* file heat support */
        LL_SBI_PARALLEL_DIO,            /* parallel (async) O_DIRECT RPCs */
+       LL_SBI_ENCRYPT_NAME,            /* name encryption */
        LL_SBI_NUM_FLAGS
 };
 
@@ -1117,7 +1139,11 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
 int ll_getattr_dentry(struct dentry *de, struct kstat *stat, u32 request_mask,
                      unsigned int flags, bool foreign);
 #ifdef CONFIG_LUSTRE_FS_POSIX_ACL
-struct posix_acl *ll_get_acl(struct inode *inode, int type);
+struct posix_acl *ll_get_acl(struct inode *inode, int type
+#ifdef HAVE_GET_ACL_RCU_ARG
+                            , bool rcu
+#endif /* HAVE_GET_ACL_RCU_ARG */
+                            );
 int ll_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
               struct posix_acl *acl, int type);
 #else  /* !CONFIG_LUSTRE_FS_POSIX_ACL */
@@ -1163,6 +1189,9 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename,
                              struct ptlrpc_request **request);
 int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump,
                      int set_default);
+int ll_dir_get_default_layout(struct inode *inode, void **plmm, int *plmm_size,
+                             struct ptlrpc_request **request, u64 valid,
+                             enum get_default_layout_type type);
 int ll_dir_getstripe_default(struct inode *inode, void **lmmp,
                             int *lmm_size, struct ptlrpc_request **request,
                             struct ptlrpc_request **root_request, u64 valid);
@@ -1749,6 +1778,13 @@ int ll_fname_disk_to_usr(struct inode *inode,
                         struct lu_fid *fid);
 int ll_revalidate_d_crypto(struct dentry *dentry, unsigned int flags);
 int ll_file_open_encrypt(struct inode *inode, struct file *filp);
+static inline char *xattr_for_enc(struct inode *inode)
+{
+       if (ll_sbi_has_name_encrypt(ll_i2sbi(inode)))
+               return LL_XATTR_NAME_ENCRYPTION_CONTEXT;
+
+       return LL_XATTR_NAME_ENCRYPTION_CONTEXT_OLD;
+}
 #ifdef HAVE_LUSTRE_CRYPTO
 extern const struct llcrypt_operations lustre_cryptops;
 #endif