* 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
*
*
*/
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;
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;
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
#else
*ppos = pos;
#endif
- ll_dir_chain_fini(&chain);
RETURN(rc);
}
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
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);
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;
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;
}
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)) {
break;
}
}
- ll_dir_chain_fini(&chain);
ll_finish_md_op_data(op_data);
if (rc < 0) {
/* 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;
*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;
*/
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;