read.c (bdc7f021f3a1fade77adf3c2d7f65690566fddfe) | read.c (0773769191d943358a8392fa86abd756d004c4b6) |
---|---|
1/* 2 * linux/fs/nfs/read.c 3 * 4 * Block I/O for NFS 5 * 6 * Partial copy of Linus' read cache modifications to fs/nfs/file.c 7 * modified for async RPC by okir@monad.swb.de 8 */ --- 139 unchanged lines hidden (view full) --- 148 req->wb_context->path.dentry->d_inode->i_sb->s_id, 149 (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), 150 req->wb_bytes, 151 (long long)req_offset(req)); 152 nfs_clear_request(req); 153 nfs_release_request(req); 154} 155 | 1/* 2 * linux/fs/nfs/read.c 3 * 4 * Block I/O for NFS 5 * 6 * Partial copy of Linus' read cache modifications to fs/nfs/file.c 7 * modified for async RPC by okir@monad.swb.de 8 */ --- 139 unchanged lines hidden (view full) --- 148 req->wb_context->path.dentry->d_inode->i_sb->s_id, 149 (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), 150 req->wb_bytes, 151 (long long)req_offset(req)); 152 nfs_clear_request(req); 153 nfs_release_request(req); 154} 155 |
156static void nfs_execute_read(struct nfs_read_data *data) 157{ 158 struct rpc_clnt *clnt = NFS_CLIENT(data->inode); 159 sigset_t oldset; 160 161 rpc_clnt_sigmask(clnt, &oldset); 162 rpc_execute(&data->task); 163 rpc_clnt_sigunmask(clnt, &oldset); 164} 165 | |
166/* 167 * Set up the NFS read request struct 168 */ 169static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, 170 const struct rpc_call_ops *call_ops, 171 unsigned int count, unsigned int offset) 172{ 173 struct inode *inode = req->wb_context->path.dentry->d_inode; 174 int swap_flags = IS_SWAPFILE(inode) ? NFS_RPC_SWAPFLAGS : 0; | 156/* 157 * Set up the NFS read request struct 158 */ 159static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, 160 const struct rpc_call_ops *call_ops, 161 unsigned int count, unsigned int offset) 162{ 163 struct inode *inode = req->wb_context->path.dentry->d_inode; 164 int swap_flags = IS_SWAPFILE(inode) ? NFS_RPC_SWAPFLAGS : 0; |
165 struct rpc_task *task; |
|
175 struct rpc_message msg = { 176 .rpc_argp = &data->args, 177 .rpc_resp = &data->res, 178 .rpc_cred = req->wb_context->cred, 179 }; 180 struct rpc_task_setup task_setup_data = { | 166 struct rpc_message msg = { 167 .rpc_argp = &data->args, 168 .rpc_resp = &data->res, 169 .rpc_cred = req->wb_context->cred, 170 }; 171 struct rpc_task_setup task_setup_data = { |
172 .task = &data->task, |
|
181 .rpc_client = NFS_CLIENT(inode), 182 .rpc_message = &msg, 183 .callback_ops = call_ops, 184 .callback_data = data, 185 .flags = RPC_TASK_ASYNC | swap_flags, 186 }; 187 188 data->req = req; --- 9 unchanged lines hidden (view full) --- 198 199 data->res.fattr = &data->fattr; 200 data->res.count = count; 201 data->res.eof = 0; 202 nfs_fattr_init(&data->fattr); 203 204 /* Set up the initial task struct. */ 205 NFS_PROTO(inode)->read_setup(data, &msg); | 173 .rpc_client = NFS_CLIENT(inode), 174 .rpc_message = &msg, 175 .callback_ops = call_ops, 176 .callback_data = data, 177 .flags = RPC_TASK_ASYNC | swap_flags, 178 }; 179 180 data->req = req; --- 9 unchanged lines hidden (view full) --- 190 191 data->res.fattr = &data->fattr; 192 data->res.count = count; 193 data->res.eof = 0; 194 nfs_fattr_init(&data->fattr); 195 196 /* Set up the initial task struct. */ 197 NFS_PROTO(inode)->read_setup(data, &msg); |
206 rpc_init_task(&data->task, &task_setup_data); | |
207 208 dprintk("NFS: %5u initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", 209 data->task.tk_pid, 210 inode->i_sb->s_id, 211 (long long)NFS_FILEID(inode), 212 count, 213 (unsigned long long)data->args.offset); 214 | 198 199 dprintk("NFS: %5u initiated read call (req %s/%Ld, %u bytes @ offset %Lu)\n", 200 data->task.tk_pid, 201 inode->i_sb->s_id, 202 (long long)NFS_FILEID(inode), 203 count, 204 (unsigned long long)data->args.offset); 205 |
215 nfs_execute_read(data); | 206 task = rpc_run_task(&task_setup_data); 207 if (!IS_ERR(task)) 208 rpc_put_task(task); |
216} 217 218static void 219nfs_async_read_error(struct list_head *head) 220{ 221 struct nfs_page *req; 222 223 while (!list_empty(head)) { --- 394 unchanged lines hidden --- | 209} 210 211static void 212nfs_async_read_error(struct list_head *head) 213{ 214 struct nfs_page *req; 215 216 while (!list_empty(head)) { --- 394 unchanged lines hidden --- |