summaryrefslogtreecommitdiffstats
path: root/xlators/performance/read-ahead
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/read-ahead')
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index 7250a9d59..2b6e2dc88 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -291,7 +291,6 @@ read_ahead (call_frame_t *frame, ra_file_t *file)
trav_offset = ra_offset;
- trav = file->pages.next;
cap = file->size ? file->size : ra_offset + ra_size;
while (trav_offset < min(ra_offset + ra_size, cap)) {
@@ -355,7 +354,6 @@ dispatch_requests (call_frame_t *frame, ra_file_t *file)
rounded_end = roof (local->offset + local->size, file->page_size);
trav_offset = rounded_offset;
- trav = file->pages.next;
while (trav_offset < rounded_end) {
fault = 0;
@@ -440,7 +438,6 @@ ra_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
ra_local_t *local = NULL;
ra_conf_t *conf = NULL;
int op_errno = 0;
- int ret = 0;
char expected_offset = 1;
uint64_t tmp_file = 0;
@@ -450,7 +447,7 @@ ra_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
"NEW REQ at offset=%"PRId64" for size=%"GF_PRI_SIZET"",
offset, size);
- ret = fd_ctx_get (fd, this, &tmp_file);
+ fd_ctx_get (fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (file == NULL) {
@@ -553,11 +550,10 @@ int
ra_flush (call_frame_t *frame, xlator_t *this, fd_t *fd)
{
ra_file_t *file = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
int32_t op_errno = 0;
- ret = fd_ctx_get (fd, this, &tmp_file);
+ fd_ctx_get (fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (file == NULL) {
op_errno = EBADF;
@@ -584,11 +580,10 @@ int
ra_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync)
{
ra_file_t *file = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
int32_t op_errno = 0;
- ret = fd_ctx_get (fd, this, &tmp_file);
+ fd_ctx_get (fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (file == NULL) {
op_errno = EBADF;
@@ -620,12 +615,11 @@ ra_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
{
fd_t *fd = NULL;
ra_file_t *file = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
fd = frame->local;
- ret = fd_ctx_get (fd, this, &tmp_file);
+ fd_ctx_get (fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
flush_region (frame, file, 0, file->pages.prev->offset+1);
@@ -641,11 +635,10 @@ ra_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iovec *vector,
int32_t count, off_t offset, struct iobref *iobref)
{
ra_file_t *file = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
int32_t op_errno = 0;
- ret = fd_ctx_get (fd, this, &tmp_file);
+ fd_ctx_get (fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (file == NULL) {
op_errno = EBADF;
@@ -700,7 +693,6 @@ ra_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset)
ra_file_t *file = NULL;
fd_t *iter_fd = NULL;
inode_t *inode = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
inode = loc->inode;
@@ -708,7 +700,7 @@ ra_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset)
LOCK (&inode->lock);
{
list_for_each_entry (iter_fd, &inode->fd_list, inode_list) {
- ret = fd_ctx_get (iter_fd, this, &tmp_file);
+ fd_ctx_get (iter_fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (!file)
@@ -733,7 +725,6 @@ ra_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd)
ra_file_t *file = NULL;
fd_t *iter_fd = NULL;
inode_t *inode = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
inode = fd->inode;
@@ -741,7 +732,7 @@ ra_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd)
LOCK (&inode->lock);
{
list_for_each_entry (iter_fd, &inode->fd_list, inode_list) {
- ret = fd_ctx_get (iter_fd, this, &tmp_file);
+ fd_ctx_get (iter_fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (!file)
@@ -766,7 +757,6 @@ ra_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset)
ra_file_t *file = NULL;
fd_t *iter_fd = NULL;
inode_t *inode = NULL;
- int ret = 0;
uint64_t tmp_file = 0;
inode = fd->inode;
@@ -774,7 +764,7 @@ ra_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset)
LOCK (&inode->lock);
{
list_for_each_entry (iter_fd, &inode->fd_list, inode_list) {
- ret = fd_ctx_get (iter_fd, this, &tmp_file);
+ fd_ctx_get (iter_fd, this, &tmp_file);
file = (ra_file_t *)(long)tmp_file;
if (!file)
continue;