Skip to content

Commit d61b577

Browse files
committed
Remove unused code from posix
These two variables were helpful before io-stats was available. Now these are not as useful as io-stats. So removing this unnecessary code. Change-Id: Iddc0ad51a77da84bca0f66040e3bf2f58c5b8339 Signed-off-by: Pranith Kumar Karampuri <[email protected]>
1 parent 7663679 commit d61b577

File tree

4 files changed

+2
-29
lines changed

4 files changed

+2
-29
lines changed

xlators/storage/posix/src/posix-aio.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,12 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res)
111111
struct iovec iov;
112112
int ret = 0;
113113
off_t offset = 0;
114-
struct posix_private *priv = NULL;
115114
fd_t *fd = NULL;
116115

117116
GF_ASSERT(paiocb);
118117

119118
frame = paiocb->frame;
120119
this = frame->this;
121-
priv = this->private;
122120
iobuf = paiocb->iobuf;
123121
fd = paiocb->fd;
124122
_fd = paiocb->_fd;
@@ -162,8 +160,6 @@ posix_aio_readv_complete(struct posix_aio_cb *paiocb, int res)
162160
if (!postbuf.ia_size || (offset + iov.iov_len) >= postbuf.ia_size)
163161
op_errno = ENOENT;
164162

165-
GF_ATOMIC_ADD(priv->read_value, op_ret);
166-
167163
out:
168164
STACK_UNWIND_STRICT(readv, frame, op_ret, op_errno, &iov, 1, &postbuf,
169165
paiocb->iobref, NULL);
@@ -269,14 +265,12 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res)
269265
int op_ret = -1;
270266
int op_errno = 0;
271267
int ret = 0;
272-
struct posix_private *priv = NULL;
273268
fd_t *fd = NULL;
274269

275270
GF_ASSERT(paiocb);
276271

277272
frame = paiocb->frame;
278273
this = frame->this;
279-
priv = this->private;
280274
prebuf = paiocb->prebuf;
281275
fd = paiocb->fd;
282276
_fd = paiocb->_fd;
@@ -303,8 +297,6 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res)
303297
op_ret = res;
304298
op_errno = 0;
305299

306-
GF_ATOMIC_ADD(priv->write_value, op_ret);
307-
308300
out:
309301
STACK_UNWIND_STRICT(writev, frame, op_ret, op_errno, &prebuf, &postbuf,
310302
NULL);

xlators/storage/posix/src/posix-common.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ posix_priv(xlator_t *this)
113113

114114
gf_proc_dump_write("base_path", "%s", priv->base_path);
115115
gf_proc_dump_write("base_path_length", "%d", priv->base_path_length);
116-
gf_proc_dump_write("max_read", "%" PRId64, GF_ATOMIC_GET(priv->read_value));
117-
gf_proc_dump_write("max_write", "%" PRId64,
118-
GF_ATOMIC_GET(priv->write_value));
119116

120117
return 0;
121118
}
@@ -894,8 +891,6 @@ posix_init(xlator_t *this)
894891
}
895892

896893
LOCK_INIT(&_private->lock);
897-
GF_ATOMIC_INIT(_private->read_value, 0);
898-
GF_ATOMIC_INIT(_private->write_value, 0);
899894

900895
_private->export_statfs = 1;
901896
tmp_data = dict_get(this->options, "export-statfs-size");

xlators/storage/posix/src/posix-inode-fd-ops.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,8 +1809,6 @@ posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
18091809
goto out;
18101810
}
18111811

1812-
GF_ATOMIC_ADD(priv->read_value, op_ret);
1813-
18141812
vec.iov_base = iobuf->ptr;
18151813
vec.iov_len = op_ret;
18161814

@@ -2166,8 +2164,6 @@ posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
21662164
}
21672165
}
21682166

2169-
GF_ATOMIC_ADD(priv->write_value, op_ret);
2170-
21712167
out:
21722168

21732169
if (locked) {
@@ -2467,14 +2463,6 @@ posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in,
24672463
locked = _gf_false;
24682464
}
24692465

2470-
/*
2471-
* Record copy_file_range in priv->write_value for now.
2472-
* If not needed, remove below section of code along with
2473-
* this comment (or add comment to explain why it is not
2474-
* needed).
2475-
*/
2476-
GF_ATOMIC_ADD(priv->write_value, op_ret);
2477-
24782466
out:
24792467

24802468
if (locked) {
@@ -5888,7 +5876,8 @@ posix_readdirp_fill(xlator_t *this, fd_t *fd, gf_dirent_t *entries,
58885876
ret = posix_pstat(this, inode, inode->gfid, hpath, &stbuf,
58895877
_gf_false, _gf_true);
58905878
else
5891-
ret = posix_pstat(this, inode, zero_gfid, hpath, &stbuf, _gf_false, _gf_true);
5879+
ret = posix_pstat(this, inode, zero_gfid, hpath, &stbuf, _gf_false,
5880+
_gf_true);
58925881

58935882
if (ret == -1) {
58945883
if (inode)

xlators/storage/posix/src/posix.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ struct posix_private {
167167

168168
time_t last_landfill_check;
169169

170-
gf_atomic_t read_value; /* Total read, from init */
171-
gf_atomic_t write_value; /* Total write, from init */
172-
173170
/* janitor task which cleans up /.trash (created by replicate) */
174171
struct gf_tw_timer_list *janitor;
175172

0 commit comments

Comments
 (0)