Commit b184b5c3 authored by NeilBrown's avatar NeilBrown Committed by Trond Myklebust

NFS: remove l_pid field from nfs_lockowner

this field is not used in any important way and probably should
have been removed by

Commit: 8003d3c4 ("nfs4: treat lock owners as opaque values")

which removed the pid argument from nfs4_get_lock_state.

Except in unusual and uninteresting cases, two threads with the same
->tgid will have the same ->files pointer, so keeping them both
for comparison brings no benefit.
Acked-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 4d3b55d3
...@@ -703,7 +703,6 @@ static void nfs_init_lock_context(struct nfs_lock_context *l_ctx) ...@@ -703,7 +703,6 @@ static void nfs_init_lock_context(struct nfs_lock_context *l_ctx)
{ {
atomic_set(&l_ctx->count, 1); atomic_set(&l_ctx->count, 1);
l_ctx->lockowner.l_owner = current->files; l_ctx->lockowner.l_owner = current->files;
l_ctx->lockowner.l_pid = current->tgid;
INIT_LIST_HEAD(&l_ctx->list); INIT_LIST_HEAD(&l_ctx->list);
atomic_set(&l_ctx->io_count, 0); atomic_set(&l_ctx->io_count, 0);
} }
...@@ -716,8 +715,6 @@ static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context ...@@ -716,8 +715,6 @@ static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context
do { do {
if (pos->lockowner.l_owner != current->files) if (pos->lockowner.l_owner != current->files)
continue; continue;
if (pos->lockowner.l_pid != current->tgid)
continue;
atomic_inc(&pos->count); atomic_inc(&pos->count);
return pos; return pos;
} while ((pos = list_entry(pos->list.next, typeof(*pos), list)) != head); } while ((pos = list_entry(pos->list.next, typeof(*pos), list)) != head);
......
...@@ -2947,7 +2947,6 @@ static int _nfs4_do_setattr(struct inode *inode, ...@@ -2947,7 +2947,6 @@ static int _nfs4_do_setattr(struct inode *inode,
} else if (truncate && state != NULL) { } else if (truncate && state != NULL) {
struct nfs_lockowner lockowner = { struct nfs_lockowner lockowner = {
.l_owner = current->files, .l_owner = current->files,
.l_pid = current->tgid,
}; };
if (!nfs4_valid_open_stateid(state)) if (!nfs4_valid_open_stateid(state))
return -EBADF; return -EBADF;
......
...@@ -867,8 +867,7 @@ static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio) ...@@ -867,8 +867,7 @@ static void nfs_pageio_cleanup_mirroring(struct nfs_pageio_descriptor *pgio)
static bool nfs_match_lock_context(const struct nfs_lock_context *l1, static bool nfs_match_lock_context(const struct nfs_lock_context *l1,
const struct nfs_lock_context *l2) const struct nfs_lock_context *l2)
{ {
return l1->lockowner.l_owner == l2->lockowner.l_owner return l1->lockowner.l_owner == l2->lockowner.l_owner;
&& l1->lockowner.l_pid == l2->lockowner.l_pid;
} }
/** /**
......
...@@ -1151,8 +1151,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page) ...@@ -1151,8 +1151,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
if (l_ctx && flctx && if (l_ctx && flctx &&
!(list_empty_careful(&flctx->flc_posix) && !(list_empty_careful(&flctx->flc_posix) &&
list_empty_careful(&flctx->flc_flock))) { list_empty_careful(&flctx->flc_flock))) {
do_flush |= l_ctx->lockowner.l_owner != current->files do_flush |= l_ctx->lockowner.l_owner != current->files;
|| l_ctx->lockowner.l_pid != current->tgid;
} }
nfs_release_request(req); nfs_release_request(req);
if (!do_flush) if (!do_flush)
......
...@@ -57,7 +57,6 @@ struct nfs_access_entry { ...@@ -57,7 +57,6 @@ struct nfs_access_entry {
struct nfs_lockowner { struct nfs_lockowner {
fl_owner_t l_owner; fl_owner_t l_owner;
pid_t l_pid;
}; };
struct nfs_lock_context { struct nfs_lock_context {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment