#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"
#define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET)
struct ll_dentry_data {
- struct lookup_intent *lld_it;
unsigned int lld_sa_generation;
unsigned int lld_invalid:1;
unsigned int lld_nfs_dentry:1;
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.
unsigned long ra_max_read_ahead_whole_pages;
struct workqueue_struct *ll_readahead_wq;
/*
- * Max number of active works for readahead workqueue,
- * default is 0 which make workqueue init number itself,
- * unless there is a specific need for throttling the
- * number of active work items, specifying '0' is recommended.
+ * Max number of active works could be triggered
+ * for async readahead.
*/
unsigned int ra_async_max_active;
+ /* how many async readahead triggered in flight */
+ atomic_t ra_async_inflight;
/* Threshold to control when to trigger async readahead */
unsigned long ra_async_pages_per_file_threshold;
};
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
/* async worker to handler read */
struct work_struct lrw_readahead_work;
+ char lrw_jobid[LUSTRE_JOBID_SIZE];
};
extern struct kmem_cache *ll_file_data_slab;
LPROC_LL_LISTXATTR,
LPROC_LL_REMOVEXATTR,
LPROC_LL_INODE_PERM,
+ LPROC_LL_FALLOCATE,
LPROC_LL_FILE_OPCODES
};
#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
#endif /* CONFIG_LUSTRE_FS_POSIX_ACL */
#endif
+
+static inline int ll_xflags_to_inode_flags(int xflags)
+{
+ return ((xflags & FS_XFLAG_SYNC) ? S_SYNC : 0) |
+ ((xflags & FS_XFLAG_NOATIME) ? S_NOATIME : 0) |
+ ((xflags & FS_XFLAG_APPEND) ? S_APPEND : 0) |
+ ((xflags & FS_XFLAG_IMMUTABLE) ? S_IMMUTABLE : 0);
+}
+
+static inline int ll_inode_flags_to_xflags(int flags)
+{
+ return ((flags & S_SYNC) ? FS_XFLAG_SYNC : 0) |
+ ((flags & S_NOATIME) ? FS_XFLAG_NOATIME : 0) |
+ ((flags & S_APPEND) ? FS_XFLAG_APPEND : 0) |
+ ((flags & S_IMMUTABLE) ? FS_XFLAG_IMMUTABLE : 0);
+}
+
int ll_migrate(struct inode *parent, struct file *file,
struct lmv_user_md *lum, const char *name);
int ll_get_fid_by_name(struct inode *parent, const char *name,
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);
return false;
/* not the same process, don't statahead */
- if (lli->lli_opendir_pid != current_pid())
+ if (lli->lli_opendir_pid != current->pid)
return false;
/*
* '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 */