flexfilelayoutdev.c (8d58b66ed2b000f27658c88a4ed70e8042e86a58) flexfilelayoutdev.c (d13549074cf066d6d5bb29903d044beffea342d3)
1/*
2 * Device operations for the pnfs nfs4 file layout driver.
3 *
4 * Copyright (c) 2014, Primary Data, Inc. All rights reserved.
5 *
6 * Tao Peng <bergwolf@primarydata.com>
7 */
8

--- 486 unchanged lines hidden (view full) ---

495 struct nfs4_ff_layout_ds_err *err, *n;
496 __be32 *p;
497
498 list_for_each_entry_safe(err, n, &flo->error_list, list) {
499 if (!is_range_intersecting(err->offset, err->length,
500 range->offset, range->length))
501 continue;
502 /* offset(8) + length(8) + stateid(NFS4_STATEID_SIZE)
1/*
2 * Device operations for the pnfs nfs4 file layout driver.
3 *
4 * Copyright (c) 2014, Primary Data, Inc. All rights reserved.
5 *
6 * Tao Peng <bergwolf@primarydata.com>
7 */
8

--- 486 unchanged lines hidden (view full) ---

495 struct nfs4_ff_layout_ds_err *err, *n;
496 __be32 *p;
497
498 list_for_each_entry_safe(err, n, &flo->error_list, list) {
499 if (!is_range_intersecting(err->offset, err->length,
500 range->offset, range->length))
501 continue;
502 /* offset(8) + length(8) + stateid(NFS4_STATEID_SIZE)
503 * + deviceid(NFS4_DEVICEID4_SIZE) + status(4) + opnum(4)
503 * + array length + deviceid(NFS4_DEVICEID4_SIZE)
504 * + status(4) + opnum(4)
504 */
505 p = xdr_reserve_space(xdr,
505 */
506 p = xdr_reserve_space(xdr,
506 24 + NFS4_STATEID_SIZE + NFS4_DEVICEID4_SIZE);
507 28 + NFS4_STATEID_SIZE + NFS4_DEVICEID4_SIZE);
507 if (unlikely(!p))
508 return -ENOBUFS;
509 p = xdr_encode_hyper(p, err->offset);
510 p = xdr_encode_hyper(p, err->length);
511 p = xdr_encode_opaque_fixed(p, &err->stateid,
512 NFS4_STATEID_SIZE);
508 if (unlikely(!p))
509 return -ENOBUFS;
510 p = xdr_encode_hyper(p, err->offset);
511 p = xdr_encode_hyper(p, err->length);
512 p = xdr_encode_opaque_fixed(p, &err->stateid,
513 NFS4_STATEID_SIZE);
514 /* Encode 1 error */
515 *p++ = cpu_to_be32(1);
513 p = xdr_encode_opaque_fixed(p, &err->deviceid,
514 NFS4_DEVICEID4_SIZE);
515 *p++ = cpu_to_be32(err->status);
516 *p++ = cpu_to_be32(err->opnum);
517 *count += 1;
518 list_del(&err->list);
519 dprintk("%s: offset %llu length %llu status %d op %d count %d\n",
520 __func__, err->offset, err->length, err->status,

--- 33 unchanged lines hidden ---
516 p = xdr_encode_opaque_fixed(p, &err->deviceid,
517 NFS4_DEVICEID4_SIZE);
518 *p++ = cpu_to_be32(err->status);
519 *p++ = cpu_to_be32(err->opnum);
520 *count += 1;
521 list_del(&err->list);
522 dprintk("%s: offset %llu length %llu status %d op %d count %d\n",
523 __func__, err->offset, err->length, err->status,

--- 33 unchanged lines hidden ---