Skip to content

Commit

Permalink
locks: cleanup data structures
Browse files Browse the repository at this point in the history
Drop unused (assigned-only) 'xlator_t' pointer from
'struct __posix_lock' and 'struct __pl_inode_lock',
adjust related code.

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Updates: #1000
  • Loading branch information
dmantipov authored and xhernandez committed Sep 12, 2022
1 parent b6d87c3 commit e8f2bd8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion xlators/features/locks/src/inodelk.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,6 @@ new_inode_lock(struct gf_flock *flock, client_t *client, pid_t client_pid,
lock->volume = volume;
lk_owner_copy(&lock->owner, &frame->root->lk_owner);
lock->frame = frame;
lock->this = this;

if (conn_id) {
lock->connection_id = gf_strdup(conn_id);
Expand Down
2 changes: 0 additions & 2 deletions xlators/features/locks/src/locks.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ struct __posix_lock {
short fl_type;
short blocked; /* waiting to acquire */
struct gf_flock user_flock; /* the flock supplied by the user */
xlator_t *this; /* required for blocked locks */
unsigned long fd_num;

fd_t *fd;
Expand Down Expand Up @@ -75,7 +74,6 @@ struct __pl_inode_lock {
const char *volume;

struct gf_flock user_flock; /* the flock supplied by the user */
xlator_t *this; /* required for blocked locks */
struct __pl_inode *pl_inode;

call_frame_t *frame;
Expand Down
5 changes: 0 additions & 5 deletions xlators/features/locks/src/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,7 +2683,6 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
/* fall through */
case F_RESLK_LCK:
reqlock->frame = frame;
reqlock->this = this;

ret = pl_reserve_setlk(this, pl_inode, reqlock, can_block);
if (ret < 0) {
Expand All @@ -2703,7 +2702,6 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,

case F_RESLK_UNLCK:
reqlock->frame = frame;
reqlock->this = this;
ret = pl_reserve_unlock(this, pl_inode, reqlock);
if (ret < 0) {
op_ret = -1;
Expand All @@ -2716,7 +2714,6 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,

case F_GETLK_FD:
reqlock->frame = frame;
reqlock->this = this;
ret = pl_verify_reservelk(this, pl_inode, reqlock, can_block);
GF_ASSERT(ret >= 0);

Expand Down Expand Up @@ -2752,7 +2749,6 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
case F_SETLKW:
can_block = 1;
reqlock->frame = frame;
reqlock->this = this;
reqlock->blocking = can_block;
/* fall through */

Expand All @@ -2761,7 +2757,6 @@ pl_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
#endif
case F_SETLK:
reqlock->frame = frame;
reqlock->this = this;
lock_type = flock->l_type;

pthread_mutex_lock(&pl_inode->mutex);
Expand Down

0 comments on commit e8f2bd8

Please sign in to comment.