diff mbox

[RFC,v0,27/49] pnfsd: hash layouts on layout state

Message ID 1380220901-13918-1-git-send-email-bhalevy@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benny Halevy Sept. 26, 2013, 6:41 p.m. UTC
Signed-off-by: Benny Halevy <bhalevy@primarydata.com>
---
 fs/nfsd/nfs4pnfsd.c | 2 ++
 fs/nfsd/pnfsd.h     | 1 +
 2 files changed, 3 insertions(+)
diff mbox

Patch

diff --git a/fs/nfsd/nfs4pnfsd.c b/fs/nfsd/nfs4pnfsd.c
index 2c5d30d..386afa3 100644
--- a/fs/nfsd/nfs4pnfsd.c
+++ b/fs/nfsd/nfs4pnfsd.c
@@ -133,6 +133,7 @@  struct sbid_tracker {
 	new->ls_stid.sc_type = NFS4_LAYOUT_STID;
 	INIT_LIST_HEAD(&new->ls_perclnt);
 	INIT_LIST_HEAD(&new->ls_perfile);
+	INIT_LIST_HEAD(&new->ls_layouts);
 	new->ls_client = clp;
 	get_nfs4_file(fp);	/* released on destroy_layout_state */
 	new->ls_file = fp;
@@ -281,6 +282,7 @@  static void update_layout_stateid_locked(struct nfs4_layout_state *ls, stateid_t
 	lp->lo_state = ls;
 	spin_lock(&layout_lock);
 	update_layout_stateid_locked(ls, stateid);
+	list_add_tail(&lp->lo_perstate, &ls->ls_layouts);
 	spin_unlock(&layout_lock);
 	dprintk("pNFS %s end\n", __func__);
 }
diff --git a/fs/nfsd/pnfsd.h b/fs/nfsd/pnfsd.h
index 852c250..1cd7a87 100644
--- a/fs/nfsd/pnfsd.h
+++ b/fs/nfsd/pnfsd.h
@@ -48,6 +48,7 @@  struct nfs4_layout_state {
 	struct nfs4_client	*ls_client;
 	struct list_head	ls_perfile;
 	struct nfs4_file	*ls_file;
+	struct list_head	ls_layouts;
 };
 
 /* outstanding layout */