diff options
author | Stanislav Kinsbursky <skinsbursky@parallels.com> | 2012-01-10 08:04:24 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-01-31 18:20:27 -0500 |
commit | 9e2e74dba6ddce94da187369b50a27536147d5df (patch) | |
tree | b4c2e7570775f0d9b0477fdf26e5f99c91e61ac4 /fs/nfs/blocklayout/blocklayoutdm.c | |
parent | 332dfab6f4e02d3c5897e9470492bee7d14f29cc (diff) |
NFS: blocklayout pipe creation per network namespace context introduced
This patch implements blocklayout pipe creation and registration per each
existent network namespace.
This was achived by registering NFS per-net operations, responsible for
blocklayout pipe allocation/register and unregister/destruction instead of
initialization and destruction of static "bl_device_pipe" pipe (this one was
removed).
Note, than pointer to network blocklayout pipe is stored in per-net "nfs_net"
structure, because allocating of one more per-net structure for blocklayout
module looks redundant.
This patch also changes dev_remove() function prototype (and all it's callers,
where it' requied) by adding network namespace pointer parameter, which is used
to discover proper blocklayout pipe for rpc_queue_upcall() call.
Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayoutdm.c')
-rw-r--r-- | fs/nfs/blocklayout/blocklayoutdm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/blocklayout/blocklayoutdm.c b/fs/nfs/blocklayout/blocklayoutdm.c index 631f254d12ab..970490f556de 100644 --- a/fs/nfs/blocklayout/blocklayoutdm.c +++ b/fs/nfs/blocklayout/blocklayoutdm.c | |||
@@ -38,7 +38,7 @@ | |||
38 | 38 | ||
39 | #define NFSDBG_FACILITY NFSDBG_PNFS_LD | 39 | #define NFSDBG_FACILITY NFSDBG_PNFS_LD |
40 | 40 | ||
41 | static void dev_remove(dev_t dev) | 41 | static void dev_remove(struct net *net, dev_t dev) |
42 | { | 42 | { |
43 | struct rpc_pipe_msg msg; | 43 | struct rpc_pipe_msg msg; |
44 | struct bl_dev_msg bl_umount_request; | 44 | struct bl_dev_msg bl_umount_request; |
@@ -48,6 +48,7 @@ static void dev_remove(dev_t dev) | |||
48 | }; | 48 | }; |
49 | uint8_t *dataptr; | 49 | uint8_t *dataptr; |
50 | DECLARE_WAITQUEUE(wq, current); | 50 | DECLARE_WAITQUEUE(wq, current); |
51 | struct nfs_net *nn = net_generic(net, nfs_net_id); | ||
51 | 52 | ||
52 | dprintk("Entering %s\n", __func__); | 53 | dprintk("Entering %s\n", __func__); |
53 | 54 | ||
@@ -66,7 +67,7 @@ static void dev_remove(dev_t dev) | |||
66 | msg.len = sizeof(bl_msg) + bl_msg.totallen; | 67 | msg.len = sizeof(bl_msg) + bl_msg.totallen; |
67 | 68 | ||
68 | add_wait_queue(&bl_wq, &wq); | 69 | add_wait_queue(&bl_wq, &wq); |
69 | if (rpc_queue_upcall(bl_device_pipe, &msg) < 0) { | 70 | if (rpc_queue_upcall(nn->bl_device_pipe, &msg) < 0) { |
70 | remove_wait_queue(&bl_wq, &wq); | 71 | remove_wait_queue(&bl_wq, &wq); |
71 | goto out; | 72 | goto out; |
72 | } | 73 | } |
@@ -93,7 +94,7 @@ static void nfs4_blk_metadev_release(struct pnfs_block_dev *bdev) | |||
93 | printk(KERN_ERR "%s nfs4_blkdev_put returns %d\n", | 94 | printk(KERN_ERR "%s nfs4_blkdev_put returns %d\n", |
94 | __func__, rv); | 95 | __func__, rv); |
95 | 96 | ||
96 | dev_remove(bdev->bm_mdev->bd_dev); | 97 | dev_remove(bdev->net, bdev->bm_mdev->bd_dev); |
97 | } | 98 | } |
98 | 99 | ||
99 | void bl_free_block_dev(struct pnfs_block_dev *bdev) | 100 | void bl_free_block_dev(struct pnfs_block_dev *bdev) |