linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: andros@netapp.com
To: bhalevy@panasas.com
Cc: linux-nfs@vger.kernel.org, Andy Adamson <andros@netapp.com>
Subject: [PATCH 02/13] SQUASHME pnfs_submit: remove CB_NOTIFY_DEVICEID
Date: Wed, 28 Apr 2010 18:24:14 -0400	[thread overview]
Message-ID: <1272493465-3398-3-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1272493465-3398-2-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

The file layoutdriver submission will not support CB_NOTIFY_DEVICEID

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/callback_proc.c    |   68 --------------------------------
 fs/nfs/callback_xdr.c     |   96 +--------------------------------------------
 include/linux/nfs4_pnfs.h |    1 -
 3 files changed, 1 insertions(+), 164 deletions(-)

diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c
index efdea62..4d315f7 100644
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -324,74 +324,6 @@ out:
 	return res;
 }
 
-/* Remove all devices for each superblock for nfs_client.  This may try
- * to remove the same device multple times if they are
- * shared across superblocks in the layout driver, but the
- * layout drive should be able to handle this */
-static __be32 pnfs_devicenotify_client(struct nfs_client *clp,
-				       struct cb_pnfs_devicenotifyargs *args)
-{
-	struct nfs_server *server;
-	__be32 res = 0, res2 = 0;
-	int i, num_sb = 0;
-	struct layoutdriver_io_operations *ops;
-	uint32_t type;
-
-	dprintk("%s: --> clp %p\n", __func__, clp);
-
-	list_for_each_entry(server, &clp->cl_superblocks, client_link) {
-		ops = server->pnfs_curr_ld->ld_io_ops;
-		num_sb++;
-		for (i = 0; i < args->ndevs; i++) {
-			struct cb_pnfs_devicenotifyitem *dev = &args->devs[i];
-			type = dev->cbd_notify_type;
-			if (type == NOTIFY_DEVICEID4_DELETE &&
-			    PNFS_EXISTS_LDIO_OP(server, device_delete))
-				res = ops->device_delete(server->pnfs_mountid,
-							 &dev->cbd_dev_id);
-			else if (type == NOTIFY_DEVICEID4_CHANGE)
-				printk(KERN_ERR "%s: NOTIFY_DEVICEID4_CHANGE "
-					"not supported\n", __func__);
-			if (res)
-				res2 = res;
-		}
-	}
-	dprintk("%s: exit with status = %d numsb %u\n",
-		__func__, ntohl(res2), num_sb);
-	return res2;
-}
-
-__be32 pnfs_cb_devicenotify(struct cb_pnfs_devicenotifyargs *args,
-			    void *dummy)
-{
-	struct nfs_client *clp;
-	__be32 res = 0;
-	unsigned int num_client = 0;
-
-	dprintk("%s: -->\n", __func__);
-
-	res = __constant_htonl(NFS4ERR_INVAL);
-	clp = nfs_find_client(args->addr, 4);
-	if (clp == NULL) {
-		dprintk("%s: no client for addr %u.%u.%u.%u\n",
-			__func__, NIPQUAD(args->addr));
-		goto out;
-	}
-
-	do {
-		struct nfs_client *prev = clp;
-		num_client++;
-		res = pnfs_devicenotify_client(clp, args);
-		clp = nfs_find_client_next(prev);
-		nfs_put_client(prev);
-	} while (clp != NULL);
-
-out:
-	dprintk("%s: exit with status = %d numclient %u\n",
-		__func__, ntohl(res), num_client);
-	return res;
-}
-
 int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation, const nfs4_stateid *stateid)
 {
 	if (delegation == NULL)
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
index d03a122..4a69882 100644
--- a/fs/nfs/callback_xdr.c
+++ b/fs/nfs/callback_xdr.c
@@ -22,7 +22,6 @@
 
 #if defined(CONFIG_NFS_V4_1)
 #define CB_OP_LAYOUTRECALL_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ)
-#define CB_OP_DEVICENOTIFY_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ)
 #define CB_OP_SEQUENCE_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ + \
 					4 + 1 + 3)
 #define CB_OP_RECALLANY_RES_MAXSZ	(CB_OP_HDR_RES_MAXSZ)
@@ -267,93 +266,6 @@ out:
 	return status;
 }
 
-static __be32 decode_pnfs_devicenotify_args(struct svc_rqst *rqstp,
-					    struct xdr_stream *xdr,
-					    struct cb_pnfs_devicenotifyargs *args)
-{
-	__be32 *p;
-	__be32 status = 0;
-	u32 tmp;
-	int n, i;
-	args->ndevs = 0;
-
-	args->addr = svc_addr(rqstp);
-
-	/* Num of device notifications */
-	p = read_buf(xdr, sizeof(uint32_t));
-	if (unlikely(p == NULL)) {
-		status = htonl(NFS4ERR_RESOURCE);
-		goto out;
-	}
-	n = ntohl(*p++);
-	if (n <= 0)
-		goto out;
-
-	/* XXX: need to possibly return error in this case */
-	if (n > NFS4_DEV_NOTIFY_MAXENTRIES) {
-		dprintk("%s: Processing (%d) notifications out of (%d)\n",
-			__func__, NFS4_DEV_NOTIFY_MAXENTRIES, n);
-		n = NFS4_DEV_NOTIFY_MAXENTRIES;
-	}
-
-	/* Decode each dev notification */
-	for (i = 0; i < n; i++) {
-		struct cb_pnfs_devicenotifyitem *dev = &args->devs[i];
-
-		p = read_buf(xdr, (4 * sizeof(uint32_t))
-			     + NFS4_PNFS_DEVICEID4_SIZE);
-		if (unlikely(p == NULL)) {
-			status = htonl(NFS4ERR_RESOURCE);
-			goto out;
-		}
-
-		tmp = ntohl(*p++);	/* bitmap size */
-		if (tmp != 1) {
-			status = htonl(NFS4ERR_INVAL);
-			goto out;
-		}
-		dev->cbd_notify_type = ntohl(*p++);
-		if (dev->cbd_notify_type != NOTIFY_DEVICEID4_CHANGE &&
-		    dev->cbd_notify_type != NOTIFY_DEVICEID4_DELETE) {
-			status = htonl(NFS4ERR_INVAL);
-			goto out;
-		}
-
-		tmp = ntohl(*p++);	/* opaque size */
-		if (((dev->cbd_notify_type == NOTIFY_DEVICEID4_CHANGE) &&
-		     (tmp != NFS4_PNFS_DEVICEID4_SIZE + 8)) ||
-		    ((dev->cbd_notify_type == NOTIFY_DEVICEID4_DELETE) &&
-		     (tmp != NFS4_PNFS_DEVICEID4_SIZE + 4))) {
-			status = htonl(NFS4ERR_INVAL);
-			goto out;
-		}
-		dev->cbd_layout_type = ntohl(*p++);
-		memcpy(dev->cbd_dev_id.data, p, NFS4_PNFS_DEVICEID4_SIZE);
-		p += XDR_QUADLEN(NFS4_PNFS_DEVICEID4_SIZE);
-
-		if (dev->cbd_layout_type == NOTIFY_DEVICEID4_CHANGE) {
-			p = read_buf(xdr, sizeof(uint32_t));
-			if (unlikely(p == NULL)) {
-				status = htonl(NFS4ERR_DELAY);
-				goto out;
-			}
-			dev->cbd_immediate = ntohl(*p++);
-		} else {
-			dev->cbd_immediate = 0;
-		}
-
-		args->ndevs++;
-
-		dprintk("%s: type %d layout 0x%x immediate %d\n",
-			__func__, dev->cbd_notify_type, dev->cbd_layout_type,
-			dev->cbd_immediate);
-	}
-out:
-	dprintk("%s: status %d ndevs %d\n",
-		__func__, ntohl(status), args->ndevs);
-	return status;
-}
-
 static __be32 decode_sessionid(struct xdr_stream *xdr,
 				 struct nfs4_sessionid *sid)
 {
@@ -709,11 +621,11 @@ preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op)
 	case OP_CB_RECALL_ANY:
 	case OP_CB_RECALL_SLOT:
 	case OP_CB_LAYOUTRECALL:
-	case OP_CB_NOTIFY_DEVICEID:
 		*op = &callback_ops[op_nr];
 		break;
 
 	case OP_CB_NOTIFY:
+	case OP_CB_NOTIFY_DEVICEID:
 	case OP_CB_PUSH_DELEG:
 	case OP_CB_RECALLABLE_OBJ_AVAIL:
 	case OP_CB_WANTS_CANCELLED:
@@ -879,12 +791,6 @@ static struct callback_op callback_ops[] = {
 			(callback_decode_arg_t)decode_pnfs_layoutrecall_args,
 		.res_maxsize = CB_OP_LAYOUTRECALL_RES_MAXSZ,
 	},
-	[OP_CB_NOTIFY_DEVICEID] = {
-		.process_op = (callback_process_op_t)pnfs_cb_devicenotify,
-		.decode_args =
-			(callback_decode_arg_t)decode_pnfs_devicenotify_args,
-		.res_maxsize = CB_OP_DEVICENOTIFY_RES_MAXSZ,
-	},
 	[OP_CB_SEQUENCE] = {
 		.process_op = (callback_process_op_t)nfs4_callback_sequence,
 		.decode_args = (callback_decode_arg_t)decode_cb_sequence_args,
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index ae2f7ed..b2bec02 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -183,7 +183,6 @@ struct layoutdriver_io_operations {
 	 */
 	struct pnfs_mount_type * (*initialize_mountpoint) (struct super_block *, struct nfs_fh *fh);
 	int (*uninitialize_mountpoint) (struct pnfs_mount_type *mountid);
-	int (*device_delete) (struct pnfs_mount_type *mountid, struct pnfs_deviceid *dev_id);
 };
 
 enum layoutdriver_policy_flags {
-- 
1.6.6


  reply	other threads:[~2010-04-28 21:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28 22:24 [PATCH 0/13] Remove non-file layout code from submit tree andros
2010-04-28 22:24 ` [PATCH 01/13] SQUASHME pnfs_submit: remove GETDEVICELIST andros
2010-04-28 22:24   ` andros [this message]
2010-04-28 22:24     ` [PATCH 03/13] SQUASHME pnfs_submit: remove pnfs_mount_type from alloc_layout andros
2010-04-28 22:24       ` [PATCH 04/13] SQUASHME pnfs_submit: remove get_blocksize policy operation andros
2010-04-28 22:24         ` [PATCH 05/13] SQUASHME pnfs_submit: remove ds_wsize, ds_rsize, ds_wpages and ds_rpages andros
2010-04-28 22:24           ` [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint andros
2010-04-28 22:24             ` [PATCH 07/13] SQUASHME pnfs_submit: remove struct pnfs_mount_type andros
2010-04-28 22:24               ` [PATCH 08/13] SQUASHME pnfs_submit: change initialize_mountpoint parameters andros
2010-04-28 22:24                 ` [PATCH 09/13] SQUASHME pnfs_submit: change nfs_fsino layoutclass name andros
2010-04-28 22:24                   ` [PATCH 10/13] SQUASHME pnfs_submit: remove pnfs_fs_ltype andros
2010-04-28 22:24                     ` [PATCH 11/13] SQUASHME pnfs_submit: remove layout_name andros
2010-04-28 22:24                       ` [PATCH 12/13] SQUASHME pnfs_submit: fall back to MDS on filelayout_commit error andros
2010-04-28 22:24                         ` [PATCH 13/13] SQUASHME pnfs_submit: cleanup nfs4_pnfs_ds_add andros
2010-04-29 16:28               ` [PATCH 07/13] SQUASHME pnfs_submit: remove struct pnfs_mount_type Boaz Harrosh
2010-04-29 16:27             ` [PATCH 06/13] SQUASHME pnfs_submit: remove uninitialize_mountpoint Boaz Harrosh
2010-04-29 17:03               ` Boaz Harrosh
2010-04-29 17:14                 ` Andy Adamson
2010-04-29 17:15                   ` Boaz Harrosh
  -- strict thread matches above, loose matches on Subject: below --
2010-04-29 20:34 [PATCH 0/13] Remove non-file layout code from submit tree version 2 andros
2010-04-29 20:34 ` [PATCH 01/13] SQUASHME pnfs_submit: remove GETDEVICELIST andros
2010-04-29 20:34   ` [PATCH 02/13] SQUASHME pnfs_submit: remove CB_NOTIFY_DEVICEID andros

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=1272493465-3398-3-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=bhalevy@panasas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).