#include <linux/compat.h>
#include <linux/aio.h>
#include <lustre_compat.h>
+#include <lustre_crypto.h>
+
+#ifndef VM_FAULT_RETRY
+#include <linux/mm_types.h>
+#endif
#include "vvp_internal.h"
#include "range_lock.h"
s64 lli_atime;
s64 lli_mtime;
s64 lli_ctime;
+ s64 lli_btime;
spinlock_t lli_agl_lock;
/* Try to make the d::member and f::member are aligned. Before using
char *lli_symlink_name;
struct ll_trunc_sem lli_trunc_sem;
struct range_lock_tree lli_write_tree;
+ struct mutex lli_setattr_mutex;
struct rw_semaphore lli_glimpse_sem;
ktime_t lli_glimpse_time;
struct mutex lli_group_mutex;
__u64 lli_group_users;
unsigned long lli_group_gid;
+
+ __u64 lli_attr_valid;
+ __u64 lli_lazysize;
+ __u64 lli_lazyblocks;
};
};
wake_up_var(&sem->ll_trunc_readers);
}
+#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
+static inline void lli_clear_acl(struct ll_inode_info *lli)
+{
+ if (lli->lli_posix_acl) {
+ posix_acl_release(lli->lli_posix_acl);
+ lli->lli_posix_acl = NULL;
+ }
+}
+
+static inline void lli_replace_acl(struct ll_inode_info *lli,
+ struct lustre_md *md)
+{
+ spin_lock(&lli->lli_lock);
+ if (lli->lli_posix_acl)
+ posix_acl_release(lli->lli_posix_acl);
+ lli->lli_posix_acl = md->posix_acl;
+ spin_unlock(&lli->lli_lock);
+}
+#else
+static inline void lli_clear_acl(struct ll_inode_info *lli)
+{
+}
+
+static inline void lli_replace_acl(struct ll_inode_info *lli,
+ struct lustre_md *md)
+{
+}
+#endif
+
static inline __u32 ll_layout_version_get(struct ll_inode_info *lli)
{
__u32 gen;
int ll_listsecurity(struct inode *inode, char *secctx_name,
size_t secctx_name_size);
+static inline bool obd_connect_has_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;
+#else
+ return false;
+#endif
+}
+
+static inline void obd_connect_set_enc(struct obd_connect_data *data)
+{
+#ifdef HAVE_LUSTRE_CRYPTO
+ data->ocd_connect_flags2 |= OBD_CONNECT2_ENCRYPT;
+#endif
+}
+
/*
* Locking to guarantee consistency of non-atomic updates to long long i_size,
* consistency between file size and KMS.
2.10, abandoned */
#define LL_SBI_TINY_WRITE 0x2000000 /* tiny write support */
#define LL_SBI_FILE_HEAT 0x4000000 /* file heat support */
+#define LL_SBI_TEST_DUMMY_ENCRYPTION 0x8000000 /* test dummy encryption */
+#define LL_SBI_ENCRYPT 0x10000000 /* client side encryption */
#define LL_SBI_FLAGS { \
"nolck", \
"checksum", \
"pio", \
"tiny_write", \
"file_heat", \
+ "test_dummy_encryption", \
+ "noencrypt", \
}
/* This is embedded into llite super-blocks to keep track of connect
#else
int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
#endif
-int ll_getattr_dentry(struct dentry *de, struct kstat *stat);
+int ll_getattr_dentry(struct dentry *de, struct kstat *stat, u32 request_mask,
+ unsigned int flags);
struct posix_acl *ll_get_acl(struct inode *inode, int type);
#ifdef HAVE_IOP_SET_ACL
#ifdef CONFIG_LUSTRE_FS_POSIX_ACL
atomic_t sai_cache_count; /* entry count in cache */
};
-int ll_statahead(struct inode *dir, struct dentry **dentry, bool unplug);
+int ll_revalidate_statahead(struct inode *dir, struct dentry **dentry,
+ bool unplug);
+int ll_start_statahead(struct inode *dir, struct dentry *dentry, bool agl);
void ll_authorize_statahead(struct inode *dir, void *key);
void ll_deauthorize_statahead(struct inode *dir, void *key);
* 'lld_sa_generation == lli->lli_sa_generation'.
*/
ldd = ll_d2d(dentry);
- if (ldd != NULL && ldd->lld_sa_generation == lli->lli_sa_generation)
+ if (ldd != NULL && lli->lli_sa_generation &&
+ ldd->lld_sa_generation == lli->lli_sa_generation)
return false;
return true;
*/
static inline void d_lustre_invalidate(struct dentry *dentry, int nested)
{
- CDEBUG(D_DENTRY, "invalidate dentry %.*s (%p) parent %p inode %p "
- "refc %d\n", dentry->d_name.len, dentry->d_name.name, dentry,
+ CDEBUG(D_DENTRY, "invalidate dentry %pd (%p) parent %p inode %p refc %d\n",
+ dentry, dentry,
dentry->d_parent, dentry->d_inode, ll_d_count(dentry));
spin_lock_nested(&dentry->d_lock,
return ll_i2pccs(ll_info2i(lli));
}
+#ifdef HAVE_LUSTRE_CRYPTO
+/* crypto.c */
+extern const struct llcrypt_operations lustre_cryptops;
+#endif
+
#endif /* LLITE_INTERNAL_H */