diff options
author | Jim Rees <rees@umich.edu> | 2011-07-30 20:52:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-31 12:18:16 -0400 |
commit | fe0a9b740881d181e3c96c1f6f6043e252692ffe (patch) | |
tree | 11dff7e25a2a9d922fba32d331530d671769c550 /fs/nfs/blocklayout/blocklayout.h | |
parent | 9e69296999362c4e4b2821b64389b47e86e4821b (diff) |
pnfsblock: add device operations
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
[upcall bugfixes]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/blocklayout/blocklayout.h')
-rw-r--r-- | fs/nfs/blocklayout/blocklayout.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h index 98e2f60c2143..dd25f1b3fe1e 100644 --- a/fs/nfs/blocklayout/blocklayout.h +++ b/fs/nfs/blocklayout/blocklayout.h | |||
@@ -34,8 +34,16 @@ | |||
34 | 34 | ||
35 | #include <linux/device-mapper.h> | 35 | #include <linux/device-mapper.h> |
36 | #include <linux/nfs_fs.h> | 36 | #include <linux/nfs_fs.h> |
37 | #include <linux/sunrpc/rpc_pipe_fs.h> | ||
38 | |||
37 | #include "../pnfs.h" | 39 | #include "../pnfs.h" |
38 | 40 | ||
41 | struct pnfs_block_dev { | ||
42 | struct list_head bm_node; | ||
43 | struct nfs4_deviceid bm_mdevid; /* associated devid */ | ||
44 | struct block_device *bm_mdev; /* meta device itself */ | ||
45 | }; | ||
46 | |||
39 | enum exstate4 { | 47 | enum exstate4 { |
40 | PNFS_BLOCK_READWRITE_DATA = 0, | 48 | PNFS_BLOCK_READWRITE_DATA = 0, |
41 | PNFS_BLOCK_READ_DATA = 1, | 49 | PNFS_BLOCK_READ_DATA = 1, |
@@ -88,5 +96,37 @@ static inline struct pnfs_block_layout *BLK_LO2EXT(struct pnfs_layout_hdr *lo) | |||
88 | return container_of(lo, struct pnfs_block_layout, bl_layout); | 96 | return container_of(lo, struct pnfs_block_layout, bl_layout); |
89 | } | 97 | } |
90 | 98 | ||
99 | struct bl_dev_msg { | ||
100 | int status; | ||
101 | uint32_t major, minor; | ||
102 | }; | ||
103 | |||
104 | struct bl_msg_hdr { | ||
105 | u8 type; | ||
106 | u16 totallen; /* length of entire message, including hdr itself */ | ||
107 | }; | ||
108 | |||
109 | extern struct dentry *bl_device_pipe; | ||
110 | extern wait_queue_head_t bl_wq; | ||
111 | |||
112 | #define BL_DEVICE_UMOUNT 0x0 /* Umount--delete devices */ | ||
113 | #define BL_DEVICE_MOUNT 0x1 /* Mount--create devices*/ | ||
114 | #define BL_DEVICE_REQUEST_INIT 0x0 /* Start request */ | ||
115 | #define BL_DEVICE_REQUEST_PROC 0x1 /* User level process succeeds */ | ||
116 | #define BL_DEVICE_REQUEST_ERR 0x2 /* User level process fails */ | ||
117 | |||
118 | /* blocklayoutdev.c */ | ||
119 | ssize_t bl_pipe_upcall(struct file *, struct rpc_pipe_msg *, | ||
120 | char __user *, size_t); | ||
121 | ssize_t bl_pipe_downcall(struct file *, const char __user *, size_t); | ||
122 | void bl_pipe_destroy_msg(struct rpc_pipe_msg *); | ||
123 | struct block_device *nfs4_blkdev_get(dev_t dev); | ||
124 | int nfs4_blkdev_put(struct block_device *bdev); | ||
125 | struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server, | ||
126 | struct pnfs_device *dev, | ||
127 | struct list_head *sdlist); | ||
128 | int nfs4_blk_process_layoutget(struct pnfs_layout_hdr *lo, | ||
129 | struct nfs4_layoutget_res *lgr, gfp_t gfp_flags); | ||
130 | |||
91 | void bl_put_extent(struct pnfs_block_extent *be); | 131 | void bl_put_extent(struct pnfs_block_extent *be); |
92 | #endif /* FS_NFS_NFS4BLOCKLAYOUT_H */ | 132 | #endif /* FS_NFS_NFS4BLOCKLAYOUT_H */ |