All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: NFS list <linux-nfs@vger.kernel.org>,
	Benny Halevy <bhalevy@panasas.com>,
	Andy Adamson <andros@netapp.com>,
	Fred Isaman <iisaman@netapp.com>
Subject: [RFC 1/3] SQUASHME: Generalize the device cache so it can be used by all layouts
Date: Sun, 12 Sep 2010 19:03:17 +0200	[thread overview]
Message-ID: <4C8D07D5.6010006@panasas.com> (raw)
In-Reply-To: <4C8D0759.6090201@panasas.com>


Current code thinks that there can be a single device_id per
layout segment. Change that to assume no relations between segments
and device_ids. It's now up to the layout-driver to make any relations.

Files layout driver is fixed in next patch.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/pnfs.c             |   20 +++++---------------
 include/linux/nfs4_pnfs.h |    6 +-----
 2 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index eb4e092..f26abc0 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1892,26 +1892,16 @@ nfs4_init_deviceid_node(struct nfs4_deviceid *d)
 }
 EXPORT_SYMBOL(nfs4_init_deviceid_node);
 
-/* Called from layoutdriver_io_operations->alloc_lseg */
-void
-nfs4_set_layout_deviceid(struct pnfs_layout_segment *l, struct nfs4_deviceid *d)
-{
-	dprintk("%s [%d]\n", __func__, atomic_read(&d->de_kref.refcount));
-	l->deviceid = d;
-}
-EXPORT_SYMBOL(nfs4_set_layout_deviceid);
-
 /* Called from layoutdriver_io_operations->free_lseg */
 void
-nfs4_put_unset_layout_deviceid(struct pnfs_layout_segment *l,
-			   struct nfs4_deviceid *d,
-			   void (*free_callback)(struct kref *))
+nfs4_put_deviceid(struct nfs4_deviceid_cache *c,
+			   struct nfs4_deviceid *d)
 {
 	dprintk("%s [%d]\n", __func__, atomic_read(&d->de_kref.refcount));
-	l->deviceid = NULL;
-	kref_put(&d->de_kref, free_callback);
+	kref_put(&d->de_kref, c->dc_free_callback);
+	/* Do we need to return the deviceid_cache ref */
 }
-EXPORT_SYMBOL(nfs4_put_unset_layout_deviceid);
+EXPORT_SYMBOL(nfs4_put_deviceid);
 
 /* Find and reference a deviceid */
 struct nfs4_deviceid *
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 577cd2b..dc3410e 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -111,7 +111,6 @@ struct pnfs_layout_segment {
 	struct kref kref;
 	bool valid;
 	struct pnfs_layout_hdr *layout;
-	struct nfs4_deviceid *deviceid;
 	u8 ld_data[];			/* layout driver private data */
 };
 
@@ -287,11 +286,8 @@ extern struct nfs4_deviceid *nfs4_find_get_deviceid(
 				struct pnfs_deviceid *);
 extern struct nfs4_deviceid *nfs4_add_get_deviceid(struct nfs4_deviceid_cache *,
 				struct nfs4_deviceid *);
-extern void nfs4_set_layout_deviceid(struct pnfs_layout_segment *,
+extern void nfs4_put_deviceid(struct nfs4_deviceid_cache *,
 				struct nfs4_deviceid *);
-extern void nfs4_put_unset_layout_deviceid(struct pnfs_layout_segment *,
-				struct nfs4_deviceid *,
-				void (*free_callback)(struct kref *));
 extern void nfs4_delete_device(struct nfs4_deviceid_cache *,
 				struct pnfs_deviceid *);
 
-- 
1.7.2.2



  reply	other threads:[~2010-09-12 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-12 17:01 [RFC 0/3] Ugliness in struct pnfs_layout_segment and possible uselessness of the device cache Boaz Harrosh
2010-09-12 17:03 ` Boaz Harrosh [this message]
2010-09-12 19:42   ` [RFC 1/3] SQUASHME: Generalize the device cache so it can be used by all layouts Trond Myklebust
2010-09-13  9:50     ` Boaz Harrosh
2010-09-13 12:16       ` Fred Isaman
2010-09-13 12:45         ` Boaz Harrosh
2010-09-12 17:05 ` [RFC 2/3] SQUASHME: fileslayout: Adjust to device_cache API changes Boaz Harrosh
2010-09-12 17:06 ` [RFC 3/3] SQUASHME: pnfs-obj: Use the generic device cache Boaz Harrosh
2010-09-12 17:31   ` Boaz Harrosh

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=4C8D07D5.6010006@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=andros@netapp.com \
    --cc=bhalevy@panasas.com \
    --cc=iisaman@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.