aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/blocklayout
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2012-09-25 02:55:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-08 19:32:40 -0400
commitaf283885b70248268617955a5ea5476647bd556b (patch)
tree61503850058bac6687f7dcf00b0b0e60ced32cf2 /fs/nfs/blocklayout
parent1fd937bd7583e618df0528f0268b210f265d6910 (diff)
pnfsblock: cleanup nfs4_blkdev_get
It is not needed at all and it is messing with return values... Reported-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout')
-rw-r--r--fs/nfs/blocklayout/blocklayout.h1
-rw-r--r--fs/nfs/blocklayout/blocklayoutdev.c25
2 files changed, 5 insertions, 21 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h
index 39bb51a8dd18..f4891bde8851 100644
--- a/fs/nfs/blocklayout/blocklayout.h
+++ b/fs/nfs/blocklayout/blocklayout.h
@@ -173,7 +173,6 @@ struct bl_msg_hdr {
173/* blocklayoutdev.c */ 173/* blocklayoutdev.c */
174ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t); 174ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t);
175void bl_pipe_destroy_msg(struct rpc_pipe_msg *); 175void bl_pipe_destroy_msg(struct rpc_pipe_msg *);
176struct block_device *nfs4_blkdev_get(dev_t dev);
177int nfs4_blkdev_put(struct block_device *bdev); 176int nfs4_blkdev_put(struct block_device *bdev);
178struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server, 177struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server,
179 struct pnfs_device *dev); 178 struct pnfs_device *dev);
diff --git a/fs/nfs/blocklayout/blocklayoutdev.c b/fs/nfs/blocklayout/blocklayoutdev.c
index c96554245ccf..a86c5bdad9e3 100644
--- a/fs/nfs/blocklayout/blocklayoutdev.c
+++ b/fs/nfs/blocklayout/blocklayoutdev.c
@@ -53,22 +53,6 @@ static int decode_sector_number(__be32 **rp, sector_t *sp)
53 return 0; 53 return 0;
54} 54}
55 55
56/* Open a block_device by device number. */
57struct block_device *nfs4_blkdev_get(dev_t dev)
58{
59 struct block_device *bd;
60
61 dprintk("%s enter\n", __func__);
62 bd = blkdev_get_by_dev(dev, FMODE_READ, NULL);
63 if (IS_ERR(bd))
64 goto fail;
65 return bd;
66fail:
67 dprintk("%s failed to open device : %ld\n",
68 __func__, PTR_ERR(bd));
69 return NULL;
70}
71
72/* 56/*
73 * Release the block device 57 * Release the block device
74 */ 58 */
@@ -172,11 +156,12 @@ nfs4_blk_decode_device(struct nfs_server *server,
172 goto out; 156 goto out;
173 } 157 }
174 158
175 bd = nfs4_blkdev_get(MKDEV(reply->major, reply->minor)); 159 bd = blkdev_get_by_dev(MKDEV(reply->major, reply->minor),
160 FMODE_READ, NULL);
176 if (IS_ERR(bd)) { 161 if (IS_ERR(bd)) {
177 rc = PTR_ERR(bd); 162 dprintk("%s failed to open device : %ld\n", __func__,
178 dprintk("%s failed to open device : %d\n", __func__, rc); 163 PTR_ERR(bd));
179 rv = ERR_PTR(rc); 164 rv = ERR_CAST(bd);
180 goto out; 165 goto out;
181 } 166 }
182 167