From: Mr NeilBrown Date: Thu, 15 Oct 2020 22:10:04 +0000 (+1100) Subject: LU-6142 llite: remove ll_dir_chain X-Git-Tag: 2.14.51~105 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=aaf0eb86969b41464093d36f1c0a2f128a1d9851 LU-6142 llite: remove ll_dir_chain ll_dir_chain is an empty structure that was introduced 13 years ago and never used. As such it is clutter. Remove it an all references to it. If the need which proposed it ever does get addresses, having a clean slate in which to create a suitable implementation is probably preferred. Signed-off-by: Mr NeilBrown Change-Id: I1eff80add8851ea11fff979f9b2d25916d6d3eed Reviewed-on: https://review.whamcloud.com/40290 Tested-by: jenkins Reviewed-by: Aurelien Degremont Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 5dc4e95..2082c85 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -103,16 +103,18 @@ * returned page, page hash collision has to be handled. Pages in the * hash chain, except first one, are termed "overflow pages". * - * Solution to index uniqueness problem is to not cache overflow - * pages. Instead, when page hash collision is detected, all overflow pages - * from emerging chain are immediately requested from the server and placed in - * a special data structure (struct ll_dir_chain). This data structure is used - * by ll_readdir() to process entries from overflow pages. When readdir - * invocation finishes, overflow pages are discarded. If page hash collision - * chain weren't completely processed, next call to readdir will again detect - * page hash collision, again read overflow pages in, process next portion of - * entries and again discard the pages. This is not as wasteful as it looks, - * because, given reasonable hash, page hash collisions are extremely rare. + * Proposed (unimplimented) solution to index uniqueness problem is to + * not cache overflow pages. Instead, when page hash collision is + * detected, all overflow pages from emerging chain should be + * immediately requested from the server and placed in a special data + * structure. This data structure can be used by ll_readdir() to + * process entries from overflow pages. When readdir invocation + * finishes, overflow pages are discarded. If page hash collision chain + * weren't completely processed, next call to readdir will again detect + * page hash collision, again read overflow pages in, process next + * portion of entries and again discard the pages. This is not as + * wasteful as it looks, because, given reasonable hash, page hash + * collisions are extremely rare. * * 1. directory positioning * @@ -141,7 +143,7 @@ * */ struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data, - __u64 offset, struct ll_dir_chain *chain) + __u64 offset) { struct md_callback cb_op; struct page *page; @@ -190,14 +192,11 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data, bool is_api32 = ll_need_32bit_api(sbi); bool is_hash64 = sbi->ll_flags & LL_SBI_64BIT_HASH; struct page *page; - struct ll_dir_chain chain; bool done = false; int rc = 0; ENTRY; - ll_dir_chain_init(&chain); - - page = ll_get_dir_page(inode, op_data, pos, &chain); + page = ll_get_dir_page(inode, op_data, pos); while (rc == 0 && !done) { struct lu_dirpage *dp; @@ -271,8 +270,7 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data, le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE); next = pos; - page = ll_get_dir_page(inode, op_data, pos, - &chain); + page = ll_get_dir_page(inode, op_data, pos); } } #ifdef HAVE_DIR_CONTEXT @@ -280,7 +278,6 @@ int ll_dir_read(struct inode *inode, __u64 *ppos, struct md_op_data *op_data, #else *ppos = pos; #endif - ll_dir_chain_fini(&chain); RETURN(rc); } diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 480d55e..c64b95f 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -1047,17 +1047,6 @@ enum get_default_layout_type { GET_DEFAULT_LAYOUT_ROOT = 1, }; -struct ll_dir_chain { -}; - -static inline void ll_dir_chain_init(struct ll_dir_chain *chain) -{ -} - -static inline void ll_dir_chain_fini(struct ll_dir_chain *chain) -{ -} - extern const struct file_operations ll_dir_operations; extern const struct inode_operations ll_dir_inode_operations; #ifdef HAVE_DIR_CONTEXT @@ -1070,7 +1059,7 @@ int ll_dir_read(struct inode *inode, __u64 *pos, struct md_op_data *op_data, int ll_get_mdt_idx(struct inode *inode); int ll_get_mdt_idx_by_fid(struct ll_sb_info *sbi, const struct lu_fid *fid); struct page *ll_get_dir_page(struct inode *dir, struct md_op_data *op_data, - __u64 offset, struct ll_dir_chain *chain); + __u64 offset); void ll_release_page(struct inode *inode, struct page *page, bool remove); int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl); diff --git a/lustre/llite/statahead.c b/lustre/llite/statahead.c index e0e008b..6745d08 100644 --- a/lustre/llite/statahead.c +++ b/lustre/llite/statahead.c @@ -1011,7 +1011,6 @@ static int ll_statahead_thread(void *arg) struct ll_statahead_info *sai = lli->lli_sai; int first = 0; struct md_op_data *op_data; - struct ll_dir_chain chain; struct page *page = NULL; __u64 pos = 0; int rc = 0; @@ -1025,7 +1024,6 @@ static int ll_statahead_thread(void *arg) if (!op_data) GOTO(out, rc = -ENOMEM); - ll_dir_chain_init(&chain); while (pos != MDS_DIR_END_OFF && sai->sai_task) { struct lu_dirpage *dp; struct lu_dirent *ent; @@ -1038,7 +1036,7 @@ static int ll_statahead_thread(void *arg) } sai->sai_in_readpage = 1; - page = ll_get_dir_page(dir, op_data, pos, &chain); + page = ll_get_dir_page(dir, op_data, pos); ll_unlock_md_op_lsm(op_data); sai->sai_in_readpage = 0; if (IS_ERR(page)) { @@ -1151,7 +1149,6 @@ static int ll_statahead_thread(void *arg) break; } } - ll_dir_chain_fini(&chain); ll_finish_md_op_data(op_data); if (rc < 0) { @@ -1277,7 +1274,6 @@ enum { /* file is first dirent under @dir */ static int is_first_dirent(struct inode *dir, struct dentry *dentry) { - struct ll_dir_chain chain; struct qstr *target = &dentry->d_name; struct md_op_data *op_data; int dot_de; @@ -1295,8 +1291,7 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) *FIXME choose the start offset of the readdir */ - ll_dir_chain_init(&chain); - page = ll_get_dir_page(dir, op_data, 0, &chain); + page = ll_get_dir_page(dir, op_data, 0); while (1) { struct lu_dirpage *dp; @@ -1385,12 +1380,11 @@ static int is_first_dirent(struct inode *dir, struct dentry *dentry) */ ll_release_page(dir, page, le32_to_cpu(dp->ldp_flags) & LDF_COLLIDE); - page = ll_get_dir_page(dir, op_data, pos, &chain); + page = ll_get_dir_page(dir, op_data, pos); } } EXIT; out: - ll_dir_chain_fini(&chain); ll_finish_md_op_data(op_data); return rc;