All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fred Isaman <iisaman@netapp.com>
To: linux-nfs@vger.kernel.org
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: [PATCH 07/11] NFSv4.1: alloc and free commit_buckets
Date: Wed, 23 Mar 2011 08:30:08 -0400	[thread overview]
Message-ID: <1300883412-32296-8-git-send-email-iisaman@netapp.com> (raw)
In-Reply-To: <1300883412-32296-1-git-send-email-iisaman@netapp.com>

Create a preallocated list header to hold nfs_pages for each
non-MDS COMMIT destination.  Note this is not necessarily each DS,
but is basically each <DS, fh> pair.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
 fs/nfs/nfs4filelayout.c |   22 ++++++++++++++++++++++
 fs/nfs/nfs4filelayout.h |    2 ++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 9401afd..03ff80c 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -503,6 +503,7 @@ filelayout_free_lseg(struct pnfs_layout_segment *lseg)
 
 	dprintk("--> %s\n", __func__);
 	nfs4_fl_put_deviceid(fl->dsaddr);
+	kfree(fl->commit_buckets);
 	_filelayout_free_lseg(fl);
 }
 
@@ -524,6 +525,27 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
 		_filelayout_free_lseg(fl);
 		return NULL;
 	}
+
+	/* This assumes there is only one IOMODE_RW lseg.  What
+	 * we really want to do is have a layout_hdr level
+	 * dictionary of <multipath_list4, fh> keys, each
+	 * associated with a struct list_head, populated by calls
+	 * to filelayout_write_pagelist().
+	 * */
+	if ((!fl->commit_through_mds) && (lgr->range.iomode == IOMODE_RW)) {
+		int i;
+		int size = (fl->stripe_type == STRIPE_SPARSE) ?
+			fl->dsaddr->ds_num : fl->dsaddr->stripe_count;
+
+		fl->commit_buckets = kcalloc(size, sizeof(struct list_head), GFP_KERNEL);
+		if (!fl->commit_buckets) {
+			filelayout_free_lseg(&fl->generic_hdr);
+			return NULL;
+		}
+		fl->number_of_buckets = size;
+		for (i = 0; i < size; i++)
+			INIT_LIST_HEAD(&fl->commit_buckets[i]);
+	}
 	return &fl->generic_hdr;
 }
 
diff --git a/fs/nfs/nfs4filelayout.h b/fs/nfs/nfs4filelayout.h
index ee0c907..085a354 100644
--- a/fs/nfs/nfs4filelayout.h
+++ b/fs/nfs/nfs4filelayout.h
@@ -79,6 +79,8 @@ struct nfs4_filelayout_segment {
 	struct nfs4_file_layout_dsaddr *dsaddr; /* Point to GETDEVINFO data */
 	unsigned int num_fh;
 	struct nfs_fh **fh_array;
+	struct list_head *commit_buckets; /* Sort commits to ds */
+	int number_of_buckets;
 };
 
 static inline struct nfs4_filelayout_segment *
-- 
1.7.2.1


  parent reply	other threads:[~2011-03-23 12:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-23 12:30 [PATCH 00/11] NFSv4.1 pnfs wave5 submission Fred Isaman
2011-03-23 12:30 ` [PATCH 01/11] NFSv4.1: don't send COMMIT to ds for data sync writes Fred Isaman
2011-03-23 12:30 ` [PATCH 02/11] NFSv4.1: rearrange nfs_commit_rpcsetup Fred Isaman
2011-03-23 12:30 ` [PATCH 03/11] NFSv4.1: add callback to nfs4_commit_done Fred Isaman
2011-03-23 12:30 ` [PATCH 04/11] NFSv4.1: pull error handling out of nfs_commit_list Fred Isaman
2011-03-23 12:30 ` [PATCH 05/11] NFSv4.1: pull out code from nfs_commit_release Fred Isaman
2011-03-23 12:30 ` [PATCH 06/11] NFSv4.1: shift filelayout_free_lseg Fred Isaman
2011-03-23 12:30 ` Fred Isaman [this message]
2011-03-23 12:30 ` [PATCH 08/11] NFSv4.1: add generic layer hooks for pnfs COMMIT Fred Isaman
2011-03-23 12:30 ` [PATCH 09/11] NFSv4.1: remove GETATTR from ds commits Fred Isaman
2011-03-23 12:30 ` [PATCH 10/11] NFSv4.1: filelayout driver specific code for COMMIT Fred Isaman
2011-03-23 12:30 ` [PATCH 11/11] NFSv4.1 remove temp code that prevented ds commits Fred Isaman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300883412-32296-8-git-send-email-iisaman@netapp.com \
    --to=iisaman@netapp.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.