#include <lustre_intent.h>
#include <linux/compat.h>
#include <linux/aio.h>
-
#include <lustre_compat.h>
+
#include "vvp_internal.h"
#include "range_lock.h"
/* update atime from MDS no matter if it's older than
* local inode atime. */
- unsigned int lli_update_atime:1,
- lli_inode_locked:1;
+ unsigned int lli_update_atime:1;
/* Try to make the d::member and f::member are aligned. Before using
* these members, make clear whether it is directory or not. */
unsigned int lli_sa_enabled:1;
/* generation for statahead */
unsigned int lli_sa_generation;
+ /* rw lock protects lli_lsm_md */
+ struct rw_semaphore lli_lsm_sem;
/* directory stripe information */
struct lmv_stripe_md *lli_lsm_md;
/* default directory stripe offset. This is extracted
LLIF_FILE_RESTORING = 1,
/* Xattr cache is attached to the file */
LLIF_XATTR_CACHE = 2,
+ /* Project inherit */
+ LLIF_PROJECT_INHERIT = 3,
};
static inline void ll_file_set_flag(struct ll_inode_info *lli,
size_t size,
__u64 valid);
+static inline bool obd_connect_has_secctx(struct obd_connect_data *data)
+{
+#if defined(HAVE_SECURITY_DENTRY_INIT_SECURITY) && defined(CONFIG_SECURITY)
+ return data->ocd_connect_flags & OBD_CONNECT_FLAGS2 &&
+ data->ocd_connect_flags2 & OBD_CONNECT2_FILE_SECCTX;
+#else
+ return false;
+#endif /* HAVE_SECURITY_DENTRY_INIT_SECURITY */
+}
+
+static inline void obd_connect_set_secctx(struct obd_connect_data *data)
+{
+#if defined(HAVE_SECURITY_DENTRY_INIT_SECURITY) && defined(CONFIG_SECURITY)
+ data->ocd_connect_flags2 |= OBD_CONNECT2_FILE_SECCTX;
+#endif /* HAVE_SECURITY_DENTRY_INIT_SECURITY */
+}
+
int ll_dentry_init_security(struct dentry *dentry, int mode, struct qstr *name,
const char **secctx_name, void **secctx,
__u32 *secctx_size);
* suppress_pings */
#define LL_SBI_FAST_READ 0x400000 /* fast read support */
#define LL_SBI_FILE_SECCTX 0x800000 /* set file security context at create */
-#define LL_SBI_PIO 0x1000000 /* parallel IO support */
+/* LL_SBI_PIO 0x1000000 parallel IO support, introduced in
+ 2.10, abandoned */
#define LL_SBI_TINY_WRITE 0x2000000 /* tiny write support */
#define LL_SBI_FLAGS { \
"fast_read", \
"file_secctx", \
"pio", \
- "tiny_write", \
+ "tiny_write", \
}
/* This is embedded into llite super-blocks to keep track of connect
struct ll_sb_info {
/* this protects pglist and ra_info. It isn't safe to
* grab from interrupt contexts */
- spinlock_t ll_lock;
- spinlock_t ll_pp_extent_lock; /* pp_extent entry*/
- spinlock_t ll_process_lock; /* ll_rw_process_info */
- struct obd_uuid ll_sb_uuid;
- struct obd_export *ll_md_exp;
- struct obd_export *ll_dt_exp;
- struct proc_dir_entry* ll_proc_root;
- struct lu_fid ll_root_fid; /* root object fid */
+ spinlock_t ll_lock;
+ spinlock_t ll_pp_extent_lock; /* pp_extent entry*/
+ spinlock_t ll_process_lock; /* ll_rw_process_info */
+ struct obd_uuid ll_sb_uuid;
+ struct obd_export *ll_md_exp;
+ struct obd_export *ll_dt_exp;
+ struct obd_device *ll_md_obd;
+ struct obd_device *ll_dt_obd;
+ struct dentry *ll_debugfs_entry;
+ struct lu_fid ll_root_fid; /* root object fid */
int ll_flags;
unsigned int ll_umounting:1,
int ll_rw_stats_on;
/* metadata stat-ahead */
+ unsigned int ll_sa_running_max;/* max concurrent
+ * statahead instances */
unsigned int ll_sa_max; /* max statahead RPCs */
atomic_t ll_sa_total; /* statahead thread started
* count */
__u32 fd_layout_version;
};
-extern struct proc_dir_entry *proc_lustre_fs_root;
void llite_tunables_unregister(void);
int llite_tunables_register(void);
void cl_put_grouplock(struct ll_grouplock *lg);
/* llite/lproc_llite.c */
-#ifdef CONFIG_PROC_FS
-int lprocfs_ll_register_obd(struct super_block *sb, const char *obdname);
-void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
-extern struct lprocfs_vars lprocfs_llite_obd_vars[];
-#else
-static inline int ll_debugs_register_super(struct super_block *sb,
- const char *name)
-{ return 0; }
-static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
-#endif
int ll_debugfs_register_super(struct super_block *sb, const char *name);
void ll_debugfs_unregister_super(struct super_block *sb);
+void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
enum {
LPROC_LL_DIRTY_HITS,
#endif /* CONFIG_FS_POSIX_ACL */
#endif
-int ll_migrate(struct inode *parent, struct file *file, int mdtidx,
- const char *name, int namelen);
+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,
int namelen, struct lu_fid *fid, struct inode **inode);
#ifdef HAVE_GENERIC_PERMISSION_4ARGS
int ll_inode_permission(struct inode *inode, int mask);
# endif
#endif
+int ll_ioctl_check_project(struct inode *inode, struct fsxattr *fa);
int ll_ioctl_fsgetxattr(struct inode *inode, unsigned int cmd,
unsigned long arg);
int ll_ioctl_fssetxattr(struct inode *inode, unsigned int cmd,
struct inode *ll_inode_from_resource_lock(struct ldlm_lock *lock);
void ll_dir_clear_lsm_md(struct inode *inode);
void ll_clear_inode(struct inode *inode);
-int ll_setattr_raw(struct dentry *dentry, struct iattr *attr, bool hsm_import);
+int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
+ enum op_xvalid xvalid, bool hsm_import);
int ll_setattr(struct dentry *de, struct iattr *attr);
int ll_statfs(struct dentry *de, struct kstatfs *sfs);
int ll_statfs_internal(struct ll_sb_info *sbi, struct obd_statfs *osfs,
u32 flags);
int ll_update_inode(struct inode *inode, struct lustre_md *md);
+void ll_update_inode_flags(struct inode *inode, int ext_flags);
int ll_read_inode2(struct inode *inode, void *opaque);
void ll_delete_inode(struct inode *inode);
int ll_iocontrol(struct inode *inode, struct file *file,
LUSTRE_OPC_ANY = 5,
};
+void ll_unlock_md_op_lsm(struct md_op_data *op_data);
struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data,
struct inode *i1, struct inode *i2,
const char *name, size_t namelen,
struct lov_user_md **kbuf);
void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req);
+void ll_dom_finish_open(struct inode *inode, struct ptlrpc_request *req,
+ struct lookup_intent *it);
+
/* Compute expected user md size when passing in a md from user space */
static inline ssize_t ll_lov_user_md_size(const struct lov_user_md *lum)
{
#define LL_SA_RPC_MIN 2
#define LL_SA_RPC_DEF 32
-#define LL_SA_RPC_MAX 8192
+#define LL_SA_RPC_MAX 512
+
+/* XXX: If want to support more concurrent statahead instances,
+ * please consider to decentralize the RPC lists attached
+ * on related import, such as imp_{sending,delayed}_list.
+ * LU-11079 */
+#define LL_SA_RUNNING_MAX 256
+#define LL_SA_RUNNING_DEF 16
#define LL_SA_CACHE_BIT 5
#define LL_SA_CACHE_SIZE (1 << LL_SA_CACHE_BIT)
/* lcommon_cl.c */
int cl_setattr_ost(struct cl_object *obj, const struct iattr *attr,
- unsigned int attr_flags);
+ enum op_xvalid xvalid, unsigned int attr_flags);
extern struct lu_env *cl_inode_fini_env;
extern __u16 cl_inode_fini_refcheck;