diff options
author | Cong Wang <amwang@redhat.com> | 2011-11-25 10:14:23 -0500 |
---|---|---|
committer | Cong Wang <xiyou.wangcong@gmail.com> | 2012-03-20 09:48:19 -0400 |
commit | 77dfce076cbd76c04e90abff188d058cdbff78dd (patch) | |
tree | c2f1ac2dd386c68e6bf8dee8d996d0b6e36f9c73 /drivers/scsi/libfc | |
parent | 4679026d783eb5ac90247bc466d66b817b213abf (diff) |
scsi: remove the second argument of k[un]map_atomic()
Signed-off-by: Cong Wang <amwang@redhat.com>
Diffstat (limited to 'drivers/scsi/libfc')
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 8 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_libfc.c | 8 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_libfc.h | 2 | ||||
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 2 |
4 files changed, 9 insertions, 11 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index f607314810ac..b577c907b318 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -485,11 +485,11 @@ static void fc_fcp_recv_data(struct fc_fcp_pkt *fsp, struct fc_frame *fp) | |||
485 | 485 | ||
486 | if (!(fr_flags(fp) & FCPHF_CRC_UNCHECKED)) { | 486 | if (!(fr_flags(fp) & FCPHF_CRC_UNCHECKED)) { |
487 | copy_len = fc_copy_buffer_to_sglist(buf, len, sg, &nents, | 487 | copy_len = fc_copy_buffer_to_sglist(buf, len, sg, &nents, |
488 | &offset, KM_SOFTIRQ0, NULL); | 488 | &offset, NULL); |
489 | } else { | 489 | } else { |
490 | crc = crc32(~0, (u8 *) fh, sizeof(*fh)); | 490 | crc = crc32(~0, (u8 *) fh, sizeof(*fh)); |
491 | copy_len = fc_copy_buffer_to_sglist(buf, len, sg, &nents, | 491 | copy_len = fc_copy_buffer_to_sglist(buf, len, sg, &nents, |
492 | &offset, KM_SOFTIRQ0, &crc); | 492 | &offset, &crc); |
493 | buf = fc_frame_payload_get(fp, 0); | 493 | buf = fc_frame_payload_get(fp, 0); |
494 | if (len % 4) | 494 | if (len % 4) |
495 | crc = crc32(crc, buf + len, 4 - (len % 4)); | 495 | crc = crc32(crc, buf + len, 4 - (len % 4)); |
@@ -650,10 +650,10 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq, | |||
650 | * The scatterlist item may be bigger than PAGE_SIZE, | 650 | * The scatterlist item may be bigger than PAGE_SIZE, |
651 | * but we must not cross pages inside the kmap. | 651 | * but we must not cross pages inside the kmap. |
652 | */ | 652 | */ |
653 | page_addr = kmap_atomic(page, KM_SOFTIRQ0); | 653 | page_addr = kmap_atomic(page); |
654 | memcpy(data, (char *)page_addr + (off & ~PAGE_MASK), | 654 | memcpy(data, (char *)page_addr + (off & ~PAGE_MASK), |
655 | sg_bytes); | 655 | sg_bytes); |
656 | kunmap_atomic(page_addr, KM_SOFTIRQ0); | 656 | kunmap_atomic(page_addr); |
657 | data += sg_bytes; | 657 | data += sg_bytes; |
658 | } | 658 | } |
659 | offset += sg_bytes; | 659 | offset += sg_bytes; |
diff --git a/drivers/scsi/libfc/fc_libfc.c b/drivers/scsi/libfc/fc_libfc.c index 1bf9841ef154..8d65a51a7598 100644 --- a/drivers/scsi/libfc/fc_libfc.c +++ b/drivers/scsi/libfc/fc_libfc.c | |||
@@ -105,14 +105,13 @@ module_exit(libfc_exit); | |||
105 | * @sg: pointer to the pointer of the SG list. | 105 | * @sg: pointer to the pointer of the SG list. |
106 | * @nents: pointer to the remaining number of entries in the SG list. | 106 | * @nents: pointer to the remaining number of entries in the SG list. |
107 | * @offset: pointer to the current offset in the SG list. | 107 | * @offset: pointer to the current offset in the SG list. |
108 | * @km_type: dedicated page table slot type for kmap_atomic. | ||
109 | * @crc: pointer to the 32-bit crc value. | 108 | * @crc: pointer to the 32-bit crc value. |
110 | * If crc is NULL, CRC is not calculated. | 109 | * If crc is NULL, CRC is not calculated. |
111 | */ | 110 | */ |
112 | u32 fc_copy_buffer_to_sglist(void *buf, size_t len, | 111 | u32 fc_copy_buffer_to_sglist(void *buf, size_t len, |
113 | struct scatterlist *sg, | 112 | struct scatterlist *sg, |
114 | u32 *nents, size_t *offset, | 113 | u32 *nents, size_t *offset, |
115 | enum km_type km_type, u32 *crc) | 114 | u32 *crc) |
116 | { | 115 | { |
117 | size_t remaining = len; | 116 | size_t remaining = len; |
118 | u32 copy_len = 0; | 117 | u32 copy_len = 0; |
@@ -142,12 +141,11 @@ u32 fc_copy_buffer_to_sglist(void *buf, size_t len, | |||
142 | off = *offset + sg->offset; | 141 | off = *offset + sg->offset; |
143 | sg_bytes = min(sg_bytes, | 142 | sg_bytes = min(sg_bytes, |
144 | (size_t)(PAGE_SIZE - (off & ~PAGE_MASK))); | 143 | (size_t)(PAGE_SIZE - (off & ~PAGE_MASK))); |
145 | page_addr = kmap_atomic(sg_page(sg) + (off >> PAGE_SHIFT), | 144 | page_addr = kmap_atomic(sg_page(sg) + (off >> PAGE_SHIFT)); |
146 | km_type); | ||
147 | if (crc) | 145 | if (crc) |
148 | *crc = crc32(*crc, buf, sg_bytes); | 146 | *crc = crc32(*crc, buf, sg_bytes); |
149 | memcpy((char *)page_addr + (off & ~PAGE_MASK), buf, sg_bytes); | 147 | memcpy((char *)page_addr + (off & ~PAGE_MASK), buf, sg_bytes); |
150 | kunmap_atomic(page_addr, km_type); | 148 | kunmap_atomic(page_addr); |
151 | buf += sg_bytes; | 149 | buf += sg_bytes; |
152 | *offset += sg_bytes; | 150 | *offset += sg_bytes; |
153 | remaining -= sg_bytes; | 151 | remaining -= sg_bytes; |
diff --git a/drivers/scsi/libfc/fc_libfc.h b/drivers/scsi/libfc/fc_libfc.h index c7d071289af5..c2830cc66d6a 100644 --- a/drivers/scsi/libfc/fc_libfc.h +++ b/drivers/scsi/libfc/fc_libfc.h | |||
@@ -134,6 +134,6 @@ extern void fc_fc4_conf_lport_params(struct fc_lport *, enum fc_fh_type); | |||
134 | u32 fc_copy_buffer_to_sglist(void *buf, size_t len, | 134 | u32 fc_copy_buffer_to_sglist(void *buf, size_t len, |
135 | struct scatterlist *sg, | 135 | struct scatterlist *sg, |
136 | u32 *nents, size_t *offset, | 136 | u32 *nents, size_t *offset, |
137 | enum km_type km_type, u32 *crc); | 137 | u32 *crc); |
138 | 138 | ||
139 | #endif /* _FC_LIBFC_H_ */ | 139 | #endif /* _FC_LIBFC_H_ */ |
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 83750ebb527f..c1a808cc5920 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -1698,7 +1698,7 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, | |||
1698 | 1698 | ||
1699 | job->reply->reply_payload_rcv_len += | 1699 | job->reply->reply_payload_rcv_len += |
1700 | fc_copy_buffer_to_sglist(buf, len, info->sg, &info->nents, | 1700 | fc_copy_buffer_to_sglist(buf, len, info->sg, &info->nents, |
1701 | &info->offset, KM_BIO_SRC_IRQ, NULL); | 1701 | &info->offset, NULL); |
1702 | 1702 | ||
1703 | if (fr_eof(fp) == FC_EOF_T && | 1703 | if (fr_eof(fp) == FC_EOF_T && |
1704 | (ntoh24(fh->fh_f_ctl) & (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) == | 1704 | (ntoh24(fh->fh_f_ctl) & (FC_FC_LAST_SEQ | FC_FC_END_SEQ)) == |