2014-10-16 12:49:45

by Jeff Layton

[permalink] [raw]
Subject: [PATCH] nfsd: clean up comments over nfs4_file definition

They're a bit outdated wrt to some recent changes.

Signed-off-by: Jeff Layton <[email protected]>
---
fs/nfsd/state.h | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 0a47c6a6b301..e3aa37147ea2 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -463,15 +463,19 @@ static inline struct nfs4_lockowner * lockowner(struct nfs4_stateowner *so)
/*
* nfs4_file: a file opened by some number of (open) nfs4_stateowners.
*
- * These objects are global. nfsd only keeps one instance of a nfs4_file per
- * inode (though it may keep multiple file descriptors open per inode). These
- * are tracked in the file_hashtbl which is protected by the state_lock
- * spinlock.
+ * These objects are global. nfsd keeps one instance of a nfs4_file per
+ * filehandle (though it may keep multiple file descriptors for each). Each
+ * inode can have multiple filehandles associated with it, so there is
+ * (potentially) a many to one relationship between this struct and struct
+ * inode.
+ *
+ * These are hashed by filehandle in the file_hashtbl, which is protected by
+ * the global state_lock spinlock.
*/
struct nfs4_file {
atomic_t fi_ref;
spinlock_t fi_lock;
- struct hlist_node fi_hash; /* hash by "struct inode *" */
+ struct hlist_node fi_hash; /* hash on fi_fhandle */
struct list_head fi_stateids;
struct list_head fi_delegations;
/* One each for O_RDONLY, O_WRONLY, O_RDWR: */
--
1.9.3



2014-10-20 20:42:19

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH] nfsd: clean up comments over nfs4_file definition

On Fri, Oct 17, 2014 at 02:40:56AM -0700, Christoph Hellwig wrote:
> On Thu, Oct 16, 2014 at 08:49:37AM -0400, Jeff Layton wrote:
> > They're a bit outdated wrt to some recent changes.
> >
> > Signed-off-by: Jeff Layton <[email protected]>
>
> Looks good,
>
> Reviewed-by: Christoph Hellwig <[email protected]>

Thanks, applying for 3.19.

--b.

2014-10-17 09:40:57

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] nfsd: clean up comments over nfs4_file definition

On Thu, Oct 16, 2014 at 08:49:37AM -0400, Jeff Layton wrote:
> They're a bit outdated wrt to some recent changes.
>
> Signed-off-by: Jeff Layton <[email protected]>

Looks good,

Reviewed-by: Christoph Hellwig <[email protected]>