diff options
author | John L. Hammond <john.hammond@intel.com> | 2016-03-30 19:48:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-03-30 21:38:13 -0700 |
commit | bc4320a9186ccace8887eac930b574491ae886c0 (patch) | |
tree | b1b690a1952557fd17986d98ba40c03e3e031ebb /drivers/staging/lustre/lustre/llite/rw.c | |
parent | 4a4eee07f3f579e9ebc5b5db35214c3ada5c1378 (diff) | |
download | op-kernel-dev-bc4320a9186ccace8887eac930b574491ae886c0.zip op-kernel-dev-bc4320a9186ccace8887eac930b574491ae886c0.tar.gz |
staging/lustre:llite: remove struct ll_ra_read
Ever since removal of the the unused function ll_ra_read_get(),
the struct ll_ra_read members lrr_reader and lrr_linkage and
the struct ll_readahead_state member ras_read_beads unnecessary
so remove them.
In struct vvp_io replace the struct ll_ra_read cui_bead member with
cui_ra_start and cui_ra_count.
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/13347
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5971
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/llite/rw.c')
-rw-r--r-- | drivers/staging/lustre/lustre/llite/rw.c | 53 |
1 files changed, 13 insertions, 40 deletions
diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index 2c4d4c4..f06d8be 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -258,38 +258,15 @@ static int index_in_window(unsigned long index, unsigned long point, return start <= index && index <= end; } -static struct ll_readahead_state *ll_ras_get(struct file *f) +void ll_ras_enter(struct file *f) { - struct ll_file_data *fd; - - fd = LUSTRE_FPRIVATE(f); - return &fd->fd_ras; -} - -void ll_ra_read_in(struct file *f, struct ll_ra_read *rar) -{ - struct ll_readahead_state *ras; - - ras = ll_ras_get(f); + struct ll_file_data *fd = LUSTRE_FPRIVATE(f); + struct ll_readahead_state *ras = &fd->fd_ras; spin_lock(&ras->ras_lock); ras->ras_requests++; ras->ras_request_index = 0; ras->ras_consecutive_requests++; - rar->lrr_reader = current; - - list_add(&rar->lrr_linkage, &ras->ras_read_beads); - spin_unlock(&ras->ras_lock); -} - -void ll_ra_read_ex(struct file *f, struct ll_ra_read *rar) -{ - struct ll_readahead_state *ras; - - ras = ll_ras_get(f); - - spin_lock(&ras->ras_lock); - list_del_init(&rar->lrr_linkage); spin_unlock(&ras->ras_lock); } @@ -551,7 +528,6 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io, unsigned long start = 0, end = 0, reserved; unsigned long ra_end, len, mlen = 0; struct inode *inode; - struct ll_ra_read *bead; struct ra_io_arg *ria = &vti->vti_ria; struct cl_object *clob; int ret = 0; @@ -575,17 +551,15 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io, } spin_lock(&ras->ras_lock); - if (vio->cui_ra_window_set) - bead = &vio->cui_bead; - else - bead = NULL; /* Enlarge the RA window to encompass the full read */ - if (bead && ras->ras_window_start + ras->ras_window_len < - bead->lrr_start + bead->lrr_count) { - ras->ras_window_len = bead->lrr_start + bead->lrr_count - + if (vio->cui_ra_valid && + ras->ras_window_start + ras->ras_window_len < + vio->cui_ra_start + vio->cui_ra_count) { + ras->ras_window_len = vio->cui_ra_start + vio->cui_ra_count - ras->ras_window_start; } + /* Reserve a part of the read-ahead window that we'll be issuing */ if (ras->ras_window_len) { start = ras->ras_next_readahead; @@ -641,15 +615,15 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io, CDEBUG(D_READA, DFID ": ria: %lu/%lu, bead: %lu/%lu, hit: %d\n", PFID(lu_object_fid(&clob->co_lu)), ria->ria_start, ria->ria_end, - !bead ? 0 : bead->lrr_start, - !bead ? 0 : bead->lrr_count, + vio->cui_ra_valid ? vio->cui_ra_start : 0, + vio->cui_ra_valid ? vio->cui_ra_count : 0, hit); /* at least to extend the readahead window to cover current read */ - if (!hit && bead && - bead->lrr_start + bead->lrr_count > ria->ria_start) { + if (!hit && vio->cui_ra_valid && + vio->cui_ra_start + vio->cui_ra_count > ria->ria_start) { /* to the end of current read window. */ - mlen = bead->lrr_start + bead->lrr_count - ria->ria_start; + mlen = vio->cui_ra_start + vio->cui_ra_count - ria->ria_start; /* trim to RPC boundary */ start = ria->ria_start & (PTLRPC_MAX_BRW_PAGES - 1); mlen = min(mlen, PTLRPC_MAX_BRW_PAGES - start); @@ -730,7 +704,6 @@ void ll_readahead_init(struct inode *inode, struct ll_readahead_state *ras) spin_lock_init(&ras->ras_lock); ras_reset(inode, ras, 0); ras->ras_requests = 0; - INIT_LIST_HEAD(&ras->ras_read_beads); } /* |