X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fllite%2Fllite_internal.h;h=da5f369003d7eb008d945edcab8e17e8cc323db4;hp=6fae11a1fdbaaeb76baa1573c47921adb5d53f0e;hb=f384d789b21689f72dc1ad03bfbf16b114748ea2;hpb=be56983d01670119ed88923cc9b5c336f4552302 diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 6fae11a..da5f369 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2014, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -44,12 +44,12 @@ /* for struct cl_lock_descr and struct cl_io */ #include -#include #include #include #include #include +#include "vvp_internal.h" #include "range_lock.h" #ifndef FMODE_EXEC @@ -173,7 +173,9 @@ struct ll_inode_info { struct inode lli_vfs_inode; /* the most recent timestamps obtained from mds */ - struct ost_lvb lli_lvb; + s64 lli_atime; + s64 lli_mtime; + s64 lli_ctime; spinlock_t lli_agl_lock; /* Try to make the d::member and f::member are aligned. Before using @@ -206,10 +208,6 @@ struct ll_inode_info { unsigned int lli_sa_generation; /* directory stripe information */ struct lmv_stripe_md *lli_lsm_md; - /* striped directory size */ - loff_t lli_stripe_dir_size; - /* striped directory nlink */ - __u64 lli_stripe_dir_nlink; }; /* for non-directory */ @@ -258,7 +256,7 @@ struct ll_inode_info { * some of the following members can be moved into u.f. */ bool lli_has_smd; - struct cl_object *lli_clob; + struct cl_object *lli_clob; /* mutex to request for layout lock exclusively. */ struct mutex lli_layout_mutex; @@ -426,7 +424,7 @@ enum stats_track_type { "nolck", \ "checksum", \ "flock", \ - "xattr", \ + "user_xattr", \ "acl", \ "???", \ "rmt_client", \ @@ -442,7 +440,7 @@ enum stats_track_type { "verbose", \ "layout", \ "user_fid2path",\ - "xattr", \ + "xattr_cache", \ "norootsquash", \ } @@ -565,13 +563,6 @@ struct ll_sb_info { #define LL_DEFAULT_MAX_RW_CHUNK (32 * 1024 * 1024) -struct ll_ra_read { - pgoff_t lrr_start; - pgoff_t lrr_count; - struct task_struct *lrr_reader; - struct list_head lrr_linkage; -}; - /* * per file-descriptor read-ahead data. */ @@ -630,12 +621,6 @@ struct ll_readahead_state { */ unsigned long ras_request_index; /* - * list of struct ll_ra_read's one per read(2) call current in - * progress against this file descriptor. Used by read-ahead code, - * protected by ->ras_lock. - */ - struct list_head ras_read_beads; - /* * The following 3 items are used for detecting the stride I/O * mode. * In stride I/O mode, @@ -704,17 +689,15 @@ static inline int ll_need_32bit_api(struct ll_sb_info *sbi) #endif } -void ll_ra_read_in(struct file *f, struct ll_ra_read *rar); -void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar); -struct ll_ra_read *ll_ra_read_get(struct file *f); +void ll_ras_enter(struct file *f); /* llite/lproc_llite.c */ -#ifdef LPROCFS +#ifdef CONFIG_PROC_FS int lprocfs_register_mountpoint(struct proc_dir_entry *parent, struct super_block *sb, char *osc, char *mdc); void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi); void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count); -extern struct lprocfs_seq_vars lprocfs_llite_obd_vars[]; +extern struct lprocfs_vars lprocfs_llite_obd_vars[]; #else static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent, struct super_block *sb, char *osc, char *mdc){return 0;} @@ -808,7 +791,6 @@ void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras); int ll_readahead(const struct lu_env *env, struct cl_io *io, struct cl_page_list *queue, struct ll_readahead_state *ras, bool hit); -int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io); struct ll_cl_context *ll_cl_find(struct file *file); void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io); void ll_cl_remove(struct file *file, const struct lu_env *env); @@ -874,7 +856,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump, int set_default); int ll_dir_getstripe(struct inode *inode, void **lmmp, int *lmm_size, struct ptlrpc_request **request, - obd_valid valid); + u64 valid); #ifdef HAVE_FILE_FSYNC_4ARGS int ll_fsync(struct file *file, loff_t start, loff_t end, int data); #elif defined(HAVE_FILE_FSYNC_2ARGS) @@ -882,7 +864,7 @@ int ll_fsync(struct file *file, int data); #else int ll_fsync(struct file *file, struct dentry *dentry, int data); #endif -int ll_merge_lvb(const struct lu_env *env, struct inode *inode); +int ll_merge_attr(const struct lu_env *env, struct inode *inode); int ll_fid2path(struct inode *inode, void __user *arg); int ll_data_version(struct inode *inode, __u64 *data_version, int flags); int ll_hsm_release(struct inode *inode); @@ -984,66 +966,8 @@ struct ll_close_queue { atomic_t lcq_stop; }; -struct ccc_object *cl_inode2ccc(struct inode *inode); - - -void vvp_write_pending (struct ccc_object *club, struct ccc_page *page); -void vvp_write_complete(struct ccc_object *club, struct ccc_page *page); - -/* specific achitecture can implement only part of this list */ -enum vvp_io_subtype { - /** normal IO */ - IO_NORMAL, - /** io started from splice_{read|write} */ - IO_SPLICE -}; - -/* IO subtypes */ -struct vvp_io { - /** io subtype */ - enum vvp_io_subtype cui_io_subtype; - - union { - struct { - struct pipe_inode_info *cui_pipe; - unsigned int cui_flags; - } splice; - struct vvp_fault_io { - /** - * Inode modification time that is checked across DLM - * lock request. - */ - time_t ft_mtime; - struct vm_area_struct *ft_vma; - /** - * locked page returned from vvp_io - */ - struct page *ft_vmpage; - struct vm_fault_api { - /** - * kernel fault info - */ - struct vm_fault *ft_vmf; - /** - * fault API used bitflags for return code. - */ - unsigned int ft_flags; - /** - * check that flags are from filemap_fault - */ - bool ft_flags_valid; - } fault; - } fault; - } u; - /** - * Read-ahead state used by read and page-fault IO contexts. - */ - struct ll_ra_read cui_bead; - /** - * Set when cui_bead has been initialized. - */ - int cui_ra_window_set; -}; +void vvp_write_pending(struct vvp_object *club, struct vvp_page *page); +void vvp_write_complete(struct vvp_object *club, struct vvp_page *page); /** * IO arguments for various VFS I/O interfaces. @@ -1081,9 +1005,10 @@ struct vvp_thread_info { struct ll_cl_context vti_io_ctx; }; +extern struct lu_context_key vvp_key; + static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env) { - extern struct lu_context_key vvp_key; struct vvp_thread_info *info; info = lu_context_key_get(&env->le_ctx, &vvp_key); @@ -1101,25 +1026,6 @@ static inline struct vvp_io_args *vvp_env_args(const struct lu_env *env, return ret; } -struct vvp_session { - struct vvp_io vs_ios; -}; - -static inline struct vvp_session *vvp_env_session(const struct lu_env *env) -{ - extern struct lu_context_key vvp_session_key; - struct vvp_session *ses; - - ses = lu_context_key_get(env->le_ses, &vvp_session_key); - LASSERT(ses != NULL); - return ses; -} - -static inline struct vvp_io *vvp_env_io(const struct lu_env *env) -{ - return &vvp_env_session(env)->vs_ios; -} - int vvp_global_init(void); void vvp_global_fini(void); @@ -1258,7 +1164,7 @@ void ll_ra_stats_inc(struct inode *inode, enum ra_stat which); /* llite/llite_rmtacl.c */ #ifdef CONFIG_FS_POSIX_ACL -obd_valid rce_ops2valid(int ops); +u64 rce_ops2valid(int ops); struct rmtacl_ctl_entry *rct_search(struct rmtacl_ctl_table *rct, pid_t key); int rct_add(struct rmtacl_ctl_table *rct, pid_t key, int ops); int rct_del(struct rmtacl_ctl_table *rct, pid_t key); @@ -1430,54 +1336,6 @@ typedef enum llioc_iter (*llioc_callback_t)(struct inode *inode, void *ll_iocontrol_register(llioc_callback_t cb, int count, unsigned int *cmd); void ll_iocontrol_unregister(void *magic); - -/* lclient compat stuff */ -#define cl_inode_info ll_inode_info -#define cl_i2info(info) ll_i2info(info) -#define cl_inode_mode(inode) ((inode)->i_mode) -#define cl_i2sbi ll_i2sbi - -static inline struct ll_file_data *cl_iattr2fd(struct inode *inode, - const struct iattr *attr) -{ - LASSERT(attr->ia_valid & ATTR_FILE); - return LUSTRE_FPRIVATE(attr->ia_file); -} - -static inline void cl_isize_lock(struct inode *inode) -{ - ll_inode_size_lock(inode); -} - -static inline void cl_isize_unlock(struct inode *inode) -{ - ll_inode_size_unlock(inode); -} - -static inline void cl_isize_write_nolock(struct inode *inode, loff_t kms) -{ - LASSERT(mutex_is_locked(&ll_i2info(inode)->lli_size_mutex)); - i_size_write(inode, kms); -} - -static inline void cl_isize_write(struct inode *inode, loff_t kms) -{ - ll_inode_size_lock(inode); - i_size_write(inode, kms); - ll_inode_size_unlock(inode); -} - -#define cl_isize_read(inode) i_size_read(inode) - -static inline int cl_merge_lvb(const struct lu_env *env, struct inode *inode) -{ - return ll_merge_lvb(env, inode); -} - -#define cl_inode_atime(inode) LTIME_S((inode)->i_atime) -#define cl_inode_ctime(inode) LTIME_S((inode)->i_ctime) -#define cl_inode_mtime(inode) LTIME_S((inode)->i_mtime) - struct obd_capa *cl_capa_lookup(struct inode *inode, enum cl_req_type crt); int cl_sync_file_range(struct inode *inode, loff_t start, loff_t end, @@ -1506,7 +1364,7 @@ static inline void cl_stats_tally(struct cl_device *dev, enum cl_req_type crt, int opc = (crt == CRT_READ) ? LPROC_LL_OSC_READ : LPROC_LL_OSC_WRITE; - ll_stats_ops_tally(ll_s2sbi(cl2ccc_dev(dev)->cdv_sb), opc, rc); + ll_stats_ops_tally(ll_s2sbi(cl2vvp_dev(dev)->vdv_sb), opc, rc); } extern ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,