diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-10-10 00:35:22 +0200 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-10-10 00:35:22 +0200 |
commit | f474af7051212b4efc8267583fad9c4ebf33ccff (patch) | |
tree | 1aa46ebc8065a341f247c2a2d9af2f624ad1d4f8 /drivers/scsi/sd_dif.c | |
parent | nfsd4: don't allow reclaims of expired clients (diff) | |
parent | UAPI: (Scripted) Disintegrate include/linux/sunrpc (diff) | |
download | linux-f474af7051212b4efc8267583fad9c4ebf33ccff.tar.xz linux-f474af7051212b4efc8267583fad9c4ebf33ccff.zip |
nfs: disintegrate UAPI for nfs
This is to complete part of the Userspace API (UAPI) disintegration for which
the preparatory patches were pulled recently. After these patches, userspace
headers will be segregated into:
include/uapi/linux/.../foo.h
for the userspace interface stuff, and:
include/linux/.../foo.h
for the strictly kernel internal stuff.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'drivers/scsi/sd_dif.c')
-rw-r--r-- | drivers/scsi/sd_dif.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index e52d5bc42bc4..04998f36e507 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c @@ -366,7 +366,8 @@ void sd_dif_config_host(struct scsi_disk *sdkp) * * Type 3 does not have a reference tag so no remapping is required. */ -int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_sz) +void sd_dif_prepare(struct request *rq, sector_t hw_sector, + unsigned int sector_sz) { const int tuple_sz = sizeof(struct sd_dif_tuple); struct bio *bio; @@ -378,7 +379,7 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s sdkp = rq->bio->bi_bdev->bd_disk->private_data; if (sdkp->protection_type == SD_DIF_TYPE3_PROTECTION) - return 0; + return; phys = hw_sector & 0xffffffff; @@ -397,10 +398,9 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s for (j = 0 ; j < iv->bv_len ; j += tuple_sz, sdt++) { - if (be32_to_cpu(sdt->ref_tag) != virt) - goto error; + if (be32_to_cpu(sdt->ref_tag) == virt) + sdt->ref_tag = cpu_to_be32(phys); - sdt->ref_tag = cpu_to_be32(phys); virt++; phys++; } @@ -410,16 +410,6 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s bio->bi_flags |= (1 << BIO_MAPPED_INTEGRITY); } - - return 0; - -error: - kunmap_atomic(sdt); - sd_printk(KERN_ERR, sdkp, "%s: virt %u, phys %u, ref %u, app %4x\n", - __func__, virt, phys, be32_to_cpu(sdt->ref_tag), - be16_to_cpu(sdt->app_tag)); - - return -EILSEQ; } /* @@ -463,10 +453,7 @@ void sd_dif_complete(struct scsi_cmnd *scmd, unsigned int good_bytes) return; } - if (be32_to_cpu(sdt->ref_tag) != phys && - sdt->app_tag != 0xffff) - sdt->ref_tag = 0xffffffff; /* Bad ref */ - else + if (be32_to_cpu(sdt->ref_tag) == phys) sdt->ref_tag = cpu_to_be32(virt); virt++; |