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,
#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.
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
};
unsigned int ll_xattr_cache_enabled:1,
ll_xattr_cache_set:1, /* already set to 0/1 */
ll_client_common_fill_super_succeeded:1,
- ll_checksum_set:1;
+ ll_checksum_set:1,
+ ll_inode_cache_enabled:1;
struct lustre_client_ocd ll_lco;
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 */
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);
*/
struct ll_digest_filename {
struct lu_fid ldf_fid;
- char ldf_excerpt[LLCRYPT_FNAME_DIGEST_SIZE];
+ char ldf_excerpt[LL_CRYPTO_BLOCK_SIZE];
};
int ll_setup_filename(struct inode *dir, const struct qstr *iname,
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