Whamcloud - gitweb
LU-3319 procfs: move llite proc handling over to seq_file
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index a0cfd37..deee1ef 100644 (file)
@@ -198,6 +198,8 @@ struct ll_inode_info {
                        /* "opendir_pid" is the token when lookup/revalid
                         * -- I am the owner of dir statahead. */
                        pid_t                           d_opendir_pid;
+                       /* directory stripe information */
+                       struct lmv_stripe_md            *d_lmv_md;
                } d;
 
 #define lli_readdir_mutex       u.d.d_readdir_mutex
@@ -206,6 +208,7 @@ struct ll_inode_info {
 #define lli_def_acl             u.d.d_def_acl
 #define lli_sa_lock             u.d.d_sa_lock
 #define lli_opendir_pid         u.d.d_opendir_pid
+#define lli_lmv_md             u.d.d_lmv_md
 
                /* for non-directory */
                struct {
@@ -496,6 +499,10 @@ struct ll_sb_info {
 
         struct lprocfs_stats     *ll_stats; /* lprocfs stats counter */
 
+       /* Used to track "unstable" pages on a client, and maintain a
+        * LRU list of clean pages. An "unstable" page is defined as
+        * any page which is sent to a server as part of a bulk request,
+        * but is uncommitted to stable storage. */
        struct cl_client_cache    ll_cache;
 
         struct lprocfs_stats     *ll_ra_stats;
@@ -699,29 +706,30 @@ 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);
-void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
+extern struct lprocfs_seq_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;}
 static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
 static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
-static void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
-{
-        memset(lvars, 0, sizeof(*lvars));
-}
 #endif
 
 
 /* llite/dir.c */
-void ll_release_page(struct page *page, int remove);
 extern struct file_operations ll_dir_operations;
 extern struct inode_operations ll_dir_inode_operations;
-struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
-                             struct ll_dir_chain *chain);
-int ll_dir_read(struct inode *inode, __u64 *_pos, void *cookie,
-               filldir_t filldir);
-
+int ll_dir_read(struct inode *inode, struct md_op_data *op_data,
+               void *cookie, filldir_t filldir);
 int ll_get_mdt_idx(struct inode *inode);
+
+struct lu_dirent *ll_dir_entry_start(struct inode *dir,
+                                    struct md_op_data *op_data);
+
+struct lu_dirent *ll_dir_entry_next(struct inode *dir,
+                                   struct md_op_data *op_data,
+                                   struct lu_dirent *ent);
+void ll_dir_entry_end(struct inode *dir, struct md_op_data *op_data,
+                     struct lu_dirent *ent);
 /* llite/namei.c */
 int ll_objects_destroy(struct ptlrpc_request *request,
                        struct inode *dir);
@@ -737,8 +745,6 @@ struct dentry *ll_splice_alias(struct inode *inode, struct dentry *de);
 int ll_rmdir_entry(struct inode *dir, char *name, int namelen);
 
 /* llite/rw.c */
-int ll_prepare_write(struct file *, struct page *, unsigned from, unsigned to);
-int ll_commit_write(struct file *, struct page *, unsigned from, unsigned to);
 int ll_writepage(struct page *page, struct writeback_control *wbc);
 int ll_writepages(struct address_space *, struct writeback_control *wbc);
 void ll_removepage(struct page *page);
@@ -751,6 +757,9 @@ int ll_sync_page_range(struct inode *, struct address_space *, loff_t, size_t);
 int ll_readahead(const struct lu_env *env, struct cl_io *io,
                  struct ll_readahead_state *ras, struct address_space *mapping,
                  struct cl_page_list *queue, int flags);
+int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io);
+struct ll_cl_context *ll_cl_init(struct file *file, struct page *vmpage);
+void ll_cl_fini(struct ll_cl_context *lcc);
 
 /* llite/file.c */
 extern struct file_operations ll_file_operations;
@@ -782,7 +791,7 @@ int ll_local_open(struct file *file,
 int ll_release_openhandle(struct dentry *, struct lookup_intent *);
 int ll_md_close(struct obd_export *md_exp, struct inode *inode,
                 struct file *file);
-int ll_md_real_close(struct inode *inode, int flags);
+int ll_md_real_close(struct inode *inode, fmode_t fmode);
 void ll_ioepoch_close(struct inode *inode, struct md_op_data *op_data,
                       struct obd_client_handle **och, unsigned long flags);
 void ll_done_writing_attr(struct inode *inode, struct md_op_data *op_data);
@@ -852,13 +861,6 @@ void ll_intent_release(struct lookup_intent *);
 void ll_invalidate_aliases(struct inode *);
 void ll_frob_intent(struct lookup_intent **itp, struct lookup_intent *deft);
 void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry);
-#ifdef HAVE_D_COMPARE_7ARGS
-int ll_dcompare(const struct dentry *parent, const struct inode *pinode,
-               const struct dentry *dentry, const struct inode *inode,
-               unsigned int len, const char *str, const struct qstr *d_name);
-#else
-int ll_dcompare(struct dentry *parent, struct qstr *d_name, struct qstr *name);
-#endif
 int ll_revalidate_it_finish(struct ptlrpc_request *request,
                             struct lookup_intent *it, struct dentry *de);
 
@@ -1110,15 +1112,19 @@ struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
 
 static inline void ll_invalidate_page(struct page *vmpage)
 {
-        struct address_space *mapping = vmpage->mapping;
-        loff_t offset = vmpage->index << PAGE_CACHE_SHIFT;
+       struct address_space *mapping = vmpage->mapping;
+       loff_t offset = vmpage->index << PAGE_CACHE_SHIFT;
 
-        LASSERT(PageLocked(vmpage));
-        if (mapping == NULL)
-                return;
+       LASSERT(PageLocked(vmpage));
+       if (mapping == NULL)
+               return;
 
+       /*
+        * truncate_complete_page() calls
+        * a_ops->invalidatepage()->cl_page_delete()->vvp_page_delete().
+        */
        ll_teardown_mmaps(mapping, offset, offset + PAGE_CACHE_SIZE);
-        truncate_complete_page(mapping, vmpage);
+       truncate_complete_page(mapping, vmpage);
 }
 
 #define    ll_s2sbi(sb)        (s2lsi(sb)->lsi_llsbi)
@@ -1338,7 +1344,7 @@ ll_statahead_mark(struct inode *dir, struct dentry *dentry)
 }
 
 static inline int
-ll_need_statahead(struct inode *dir, struct dentry *dentryp)
+d_need_statahead(struct inode *dir, struct dentry *dentryp)
 {
        struct ll_inode_info  *lli;
        struct ll_dentry_data *ldd;
@@ -1383,7 +1389,7 @@ ll_statahead_enter(struct inode *dir, struct dentry **dentryp, int only_unplug)
 {
        int ret;
 
-       ret = ll_need_statahead(dir, *dentryp);
+       ret = d_need_statahead(dir, *dentryp);
        if (ret <= 0)
                return ret;
 
@@ -1608,12 +1614,12 @@ 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,
-              dentry->d_parent, dentry->d_inode, d_refcount(dentry));
+              dentry->d_parent, dentry->d_inode, d_count(dentry));
 
        spin_lock_nested(&dentry->d_lock,
                         nested ? DENTRY_D_LOCK_NESTED : DENTRY_D_LOCK_NORMAL);
        __d_lustre_invalidate(dentry);
-       if (d_refcount(dentry) == 0)
+       if (d_count(dentry) == 0)
                __d_drop(dentry);
        spin_unlock(&dentry->d_lock);
 }
@@ -1656,4 +1662,7 @@ int ll_layout_restore(struct inode *inode, loff_t start, __u64 length);
 int ll_xattr_init(void);
 void ll_xattr_fini(void);
 
+int ll_page_sync_io(const struct lu_env *env, struct cl_io *io,
+                   struct cl_page *page, enum cl_req_type crt);
+
 #endif /* LLITE_INTERNAL_H */