Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused code from posix #4455

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions xlators/storage/posix/src/posix-aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,12 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res)
struct iovec iov;
int ret = 0;
off_t offset = 0;
struct posix_private *priv = NULL;
fd_t *fd = NULL;

GF_ASSERT(paiocb);

frame = paiocb->frame;
this = frame->this;
priv = this->private;
iobuf = paiocb->iobuf;
fd = paiocb->fd;
_fd = paiocb->_fd;
Expand Down Expand Up @@ -162,8 +160,6 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res)
if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size)
op_errno = ENOENT;

GF_ATOMIC_ADD(priv->read_value, op_ret);

out:
STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, &iov, 1, &postbuf,
paiocb->iobref, NULL);
Expand Down Expand Up @@ -269,14 +265,12 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res)
int op_ret = -1;
int op_errno = 0;
int ret = 0;
struct posix_private *priv = NULL;
fd_t *fd = NULL;

GF_ASSERT(paiocb);

frame = paiocb->frame;
this = frame->this;
priv = this->private;
prebuf = paiocb->prebuf;
fd = paiocb->fd;
_fd = paiocb->_fd;
Expand All @@ -303,8 +297,6 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res)
op_ret = res;
op_errno = 0;

GF_ATOMIC_ADD(priv->write_value, op_ret);

out:
STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, &prebuf, &postbuf,
NULL);
Expand Down
5 changes: 0 additions & 5 deletions xlators/storage/posix/src/posix-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ posix_priv(xlator_t *this)

gf_proc_dump_write("base_path", "%s", priv->base_path);
gf_proc_dump_write("base_path_length", "%d", priv->base_path_length);
gf_proc_dump_write("max_read", "%" PRId64, GF_ATOMIC_GET(priv->read_value));
gf_proc_dump_write("max_write", "%" PRId64,
GF_ATOMIC_GET(priv->write_value));

return 0;
}
Expand Down Expand Up @@ -894,8 +891,6 @@ posix_init(xlator_t *this)
}

LOCK_INIT(&_private->lock);
GF_ATOMIC_INIT(_private->read_value, 0);
GF_ATOMIC_INIT(_private->write_value, 0);

_private->export_statfs = 1;
tmp_data = dict_get(this->options, "export-statfs-size");
Expand Down
15 changes: 2 additions & 13 deletions xlators/storage/posix/src/posix-inode-fd-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1809,8 +1809,6 @@ posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
goto out;
}

GF_ATOMIC_ADD(priv->read_value, op_ret);

vec.iov_base = iobuf->ptr;
vec.iov_len = op_ret;

Expand Down Expand Up @@ -2166,8 +2164,6 @@ posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
}
}

GF_ATOMIC_ADD(priv->write_value, op_ret);

out:

if (locked) {
Expand Down Expand Up @@ -2467,14 +2463,6 @@ posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in,
locked = _gf_false;
}

/*
* Record copy_file_range in priv->write_value for now.
* If not needed, remove below section of code along with
* this comment (or add comment to explain why it is not
* needed).
*/
GF_ATOMIC_ADD(priv->write_value, op_ret);

out:

if (locked) {
Expand Down Expand Up @@ -5888,7 +5876,8 @@ posix_readdirp_fill(xlator_t *this, fd_t *fd, gf_dirent_t *entries,
ret = posix_pstat(this, inode, inode->gfid, hpath, &stbuf,
_gf_false, _gf_true);
else
ret = posix_pstat(this, inode, zero_gfid, hpath, &stbuf, _gf_false, _gf_true);
ret = posix_pstat(this, inode, zero_gfid, hpath, &stbuf, _gf_false,
_gf_true);

if (ret == -1) {
if (inode)
Expand Down
3 changes: 0 additions & 3 deletions xlators/storage/posix/src/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ struct posix_private {

time_t last_landfill_check;

gf_atomic_t read_value; /* Total read, from init */
gf_atomic_t write_value; /* Total write, from init */

/* janitor task which cleans up /.trash (created by replicate) */
struct gf_tw_timer_list *janitor;

Expand Down