[PATCH] SQUASHME: pnfs-submit: reduce nesting level in set_pnfs_layoutdriver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simplify the code a bit.

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfs/pnfs.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 5f91763..393855e 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -214,23 +214,25 @@ set_pnfs_layoutdriver(struct nfs_server *server, u32 id)
 		find_pnfs(id, &mod);
 	}
 
-	if (mod) {
-		server->pnfs_curr_ld = mod->pnfs_ld_type;
-		if (mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint(
-			server->nfs_client)) {
-			printk(KERN_ERR "%s: Error initializing mount point "
-			       "for layout driver %u. ", __func__, id);
-			goto out_err;
-		}
-		dprintk("%s: pNFS module for %u set\n", __func__, id);
-		return;
+	if (!mod) {
+		dprintk("%s: No pNFS module found for %u. ", __func__, id);
+		goto out_err;
+	}
+
+	server->pnfs_curr_ld = mod->pnfs_ld_type;
+	if (mod->pnfs_ld_type->ld_io_ops->initialize_mountpoint(
+							server->nfs_client)) {
+		printk(KERN_ERR "%s: Error initializing mount point "
+		       "for layout driver %u. ", __func__, id);
+		goto out_err;
 	}
 
-	dprintk("%s: No pNFS module found for %u. ", __func__, id);
+	dprintk("%s: pNFS module for %u set\n", __func__, id);
+	return;
+
 out_err:
 	dprintk("Using NFSv4 I/O\n");
 	server->pnfs_curr_ld = NULL;
-	return;
 }
 
 /* Allow I/O module to set its functions structure */
-- 
1.7.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux