diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-11 08:46:53 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-11 08:46:53 -0400 |
commit | 336879b1da97fffc097f77c6d6f818660f2826f0 (patch) | |
tree | 4ddb4d1c5d2b67fb096c72e41d2a03b01a605041 /fs/nfs/objlayout/objlayout.c | |
parent | 3d3cbd84300e7be1e53083cac0f6f9c12978ecb4 (diff) | |
parent | fdcaa1dbb7c6ed419b10fb8cdb5001ab0a00538f (diff) |
Merge remote-tracking branch 'airlied/drm-next' into topic/vblank-rework
Dave asked me to do the backmerge before sending him the revised pull
request, so here we go. Nothing fancy in the conflicts, just a few
things changed right next to each another.
Conflicts:
drivers/gpu/drm/drm_irq.c
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'fs/nfs/objlayout/objlayout.c')
-rw-r--r-- | fs/nfs/objlayout/objlayout.c | 81 |
1 files changed, 39 insertions, 42 deletions
diff --git a/fs/nfs/objlayout/objlayout.c b/fs/nfs/objlayout/objlayout.c index 765d3f54e986..697a16d11fac 100644 --- a/fs/nfs/objlayout/objlayout.c +++ b/fs/nfs/objlayout/objlayout.c | |||
@@ -229,36 +229,36 @@ objlayout_io_set_result(struct objlayout_io_res *oir, unsigned index, | |||
229 | static void _rpc_read_complete(struct work_struct *work) | 229 | static void _rpc_read_complete(struct work_struct *work) |
230 | { | 230 | { |
231 | struct rpc_task *task; | 231 | struct rpc_task *task; |
232 | struct nfs_pgio_data *rdata; | 232 | struct nfs_pgio_header *hdr; |
233 | 233 | ||
234 | dprintk("%s enter\n", __func__); | 234 | dprintk("%s enter\n", __func__); |
235 | task = container_of(work, struct rpc_task, u.tk_work); | 235 | task = container_of(work, struct rpc_task, u.tk_work); |
236 | rdata = container_of(task, struct nfs_pgio_data, task); | 236 | hdr = container_of(task, struct nfs_pgio_header, task); |
237 | 237 | ||
238 | pnfs_ld_read_done(rdata); | 238 | pnfs_ld_read_done(hdr); |
239 | } | 239 | } |
240 | 240 | ||
241 | void | 241 | void |
242 | objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync) | 242 | objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync) |
243 | { | 243 | { |
244 | struct nfs_pgio_data *rdata = oir->rpcdata; | 244 | struct nfs_pgio_header *hdr = oir->rpcdata; |
245 | 245 | ||
246 | oir->status = rdata->task.tk_status = status; | 246 | oir->status = hdr->task.tk_status = status; |
247 | if (status >= 0) | 247 | if (status >= 0) |
248 | rdata->res.count = status; | 248 | hdr->res.count = status; |
249 | else | 249 | else |
250 | rdata->header->pnfs_error = status; | 250 | hdr->pnfs_error = status; |
251 | objlayout_iodone(oir); | 251 | objlayout_iodone(oir); |
252 | /* must not use oir after this point */ | 252 | /* must not use oir after this point */ |
253 | 253 | ||
254 | dprintk("%s: Return status=%zd eof=%d sync=%d\n", __func__, | 254 | dprintk("%s: Return status=%zd eof=%d sync=%d\n", __func__, |
255 | status, rdata->res.eof, sync); | 255 | status, hdr->res.eof, sync); |
256 | 256 | ||
257 | if (sync) | 257 | if (sync) |
258 | pnfs_ld_read_done(rdata); | 258 | pnfs_ld_read_done(hdr); |
259 | else { | 259 | else { |
260 | INIT_WORK(&rdata->task.u.tk_work, _rpc_read_complete); | 260 | INIT_WORK(&hdr->task.u.tk_work, _rpc_read_complete); |
261 | schedule_work(&rdata->task.u.tk_work); | 261 | schedule_work(&hdr->task.u.tk_work); |
262 | } | 262 | } |
263 | } | 263 | } |
264 | 264 | ||
@@ -266,12 +266,11 @@ objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync) | |||
266 | * Perform sync or async reads. | 266 | * Perform sync or async reads. |
267 | */ | 267 | */ |
268 | enum pnfs_try_status | 268 | enum pnfs_try_status |
269 | objlayout_read_pagelist(struct nfs_pgio_data *rdata) | 269 | objlayout_read_pagelist(struct nfs_pgio_header *hdr) |
270 | { | 270 | { |
271 | struct nfs_pgio_header *hdr = rdata->header; | ||
272 | struct inode *inode = hdr->inode; | 271 | struct inode *inode = hdr->inode; |
273 | loff_t offset = rdata->args.offset; | 272 | loff_t offset = hdr->args.offset; |
274 | size_t count = rdata->args.count; | 273 | size_t count = hdr->args.count; |
275 | int err; | 274 | int err; |
276 | loff_t eof; | 275 | loff_t eof; |
277 | 276 | ||
@@ -279,23 +278,23 @@ objlayout_read_pagelist(struct nfs_pgio_data *rdata) | |||
279 | if (unlikely(offset + count > eof)) { | 278 | if (unlikely(offset + count > eof)) { |
280 | if (offset >= eof) { | 279 | if (offset >= eof) { |
281 | err = 0; | 280 | err = 0; |
282 | rdata->res.count = 0; | 281 | hdr->res.count = 0; |
283 | rdata->res.eof = 1; | 282 | hdr->res.eof = 1; |
284 | /*FIXME: do we need to call pnfs_ld_read_done() */ | 283 | /*FIXME: do we need to call pnfs_ld_read_done() */ |
285 | goto out; | 284 | goto out; |
286 | } | 285 | } |
287 | count = eof - offset; | 286 | count = eof - offset; |
288 | } | 287 | } |
289 | 288 | ||
290 | rdata->res.eof = (offset + count) >= eof; | 289 | hdr->res.eof = (offset + count) >= eof; |
291 | _fix_verify_io_params(hdr->lseg, &rdata->args.pages, | 290 | _fix_verify_io_params(hdr->lseg, &hdr->args.pages, |
292 | &rdata->args.pgbase, | 291 | &hdr->args.pgbase, |
293 | rdata->args.offset, rdata->args.count); | 292 | hdr->args.offset, hdr->args.count); |
294 | 293 | ||
295 | dprintk("%s: inode(%lx) offset 0x%llx count 0x%Zx eof=%d\n", | 294 | dprintk("%s: inode(%lx) offset 0x%llx count 0x%Zx eof=%d\n", |
296 | __func__, inode->i_ino, offset, count, rdata->res.eof); | 295 | __func__, inode->i_ino, offset, count, hdr->res.eof); |
297 | 296 | ||
298 | err = objio_read_pagelist(rdata); | 297 | err = objio_read_pagelist(hdr); |
299 | out: | 298 | out: |
300 | if (unlikely(err)) { | 299 | if (unlikely(err)) { |
301 | hdr->pnfs_error = err; | 300 | hdr->pnfs_error = err; |
@@ -312,38 +311,38 @@ objlayout_read_pagelist(struct nfs_pgio_data *rdata) | |||
312 | static void _rpc_write_complete(struct work_struct *work) | 311 | static void _rpc_write_complete(struct work_struct *work) |
313 | { | 312 | { |
314 | struct rpc_task *task; | 313 | struct rpc_task *task; |
315 | struct nfs_pgio_data *wdata; | 314 | struct nfs_pgio_header *hdr; |
316 | 315 | ||
317 | dprintk("%s enter\n", __func__); | 316 | dprintk("%s enter\n", __func__); |
318 | task = container_of(work, struct rpc_task, u.tk_work); | 317 | task = container_of(work, struct rpc_task, u.tk_work); |
319 | wdata = container_of(task, struct nfs_pgio_data, task); | 318 | hdr = container_of(task, struct nfs_pgio_header, task); |
320 | 319 | ||
321 | pnfs_ld_write_done(wdata); | 320 | pnfs_ld_write_done(hdr); |
322 | } | 321 | } |
323 | 322 | ||
324 | void | 323 | void |
325 | objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) | 324 | objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) |
326 | { | 325 | { |
327 | struct nfs_pgio_data *wdata = oir->rpcdata; | 326 | struct nfs_pgio_header *hdr = oir->rpcdata; |
328 | 327 | ||
329 | oir->status = wdata->task.tk_status = status; | 328 | oir->status = hdr->task.tk_status = status; |
330 | if (status >= 0) { | 329 | if (status >= 0) { |
331 | wdata->res.count = status; | 330 | hdr->res.count = status; |
332 | wdata->verf.committed = oir->committed; | 331 | hdr->verf.committed = oir->committed; |
333 | } else { | 332 | } else { |
334 | wdata->header->pnfs_error = status; | 333 | hdr->pnfs_error = status; |
335 | } | 334 | } |
336 | objlayout_iodone(oir); | 335 | objlayout_iodone(oir); |
337 | /* must not use oir after this point */ | 336 | /* must not use oir after this point */ |
338 | 337 | ||
339 | dprintk("%s: Return status %zd committed %d sync=%d\n", __func__, | 338 | dprintk("%s: Return status %zd committed %d sync=%d\n", __func__, |
340 | status, wdata->verf.committed, sync); | 339 | status, hdr->verf.committed, sync); |
341 | 340 | ||
342 | if (sync) | 341 | if (sync) |
343 | pnfs_ld_write_done(wdata); | 342 | pnfs_ld_write_done(hdr); |
344 | else { | 343 | else { |
345 | INIT_WORK(&wdata->task.u.tk_work, _rpc_write_complete); | 344 | INIT_WORK(&hdr->task.u.tk_work, _rpc_write_complete); |
346 | schedule_work(&wdata->task.u.tk_work); | 345 | schedule_work(&hdr->task.u.tk_work); |
347 | } | 346 | } |
348 | } | 347 | } |
349 | 348 | ||
@@ -351,17 +350,15 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) | |||
351 | * Perform sync or async writes. | 350 | * Perform sync or async writes. |
352 | */ | 351 | */ |
353 | enum pnfs_try_status | 352 | enum pnfs_try_status |
354 | objlayout_write_pagelist(struct nfs_pgio_data *wdata, | 353 | objlayout_write_pagelist(struct nfs_pgio_header *hdr, int how) |
355 | int how) | ||
356 | { | 354 | { |
357 | struct nfs_pgio_header *hdr = wdata->header; | ||
358 | int err; | 355 | int err; |
359 | 356 | ||
360 | _fix_verify_io_params(hdr->lseg, &wdata->args.pages, | 357 | _fix_verify_io_params(hdr->lseg, &hdr->args.pages, |
361 | &wdata->args.pgbase, | 358 | &hdr->args.pgbase, |
362 | wdata->args.offset, wdata->args.count); | 359 | hdr->args.offset, hdr->args.count); |
363 | 360 | ||
364 | err = objio_write_pagelist(wdata, how); | 361 | err = objio_write_pagelist(hdr, how); |
365 | if (unlikely(err)) { | 362 | if (unlikely(err)) { |
366 | hdr->pnfs_error = err; | 363 | hdr->pnfs_error = err; |
367 | dprintk("%s: Returned Error %d\n", __func__, err); | 364 | dprintk("%s: Returned Error %d\n", __func__, err); |