bsg.c (5a89770daad83df74d77a8d34a1ffaedae565ce9) | bsg.c (a3bce90edd8f6cafe3f63b1a943800792e830178) |
---|---|
1/* 2 * bsg.c - block layer implementation of the sg v4 interface 3 * 4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs 5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com> 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License version 2. See the file "COPYING" in the main directory of this --- 269 unchanged lines hidden (view full) --- 278 if (!next_rq) { 279 ret = -ENOMEM; 280 goto out; 281 } 282 rq->next_rq = next_rq; 283 next_rq->cmd_type = rq->cmd_type; 284 285 dxferp = (void*)(unsigned long)hdr->din_xferp; | 1/* 2 * bsg.c - block layer implementation of the sg v4 interface 3 * 4 * Copyright (C) 2004 Jens Axboe <axboe@suse.de> SUSE Labs 5 * Copyright (C) 2004 Peter M. Jones <pjones@redhat.com> 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License version 2. See the file "COPYING" in the main directory of this --- 269 unchanged lines hidden (view full) --- 278 if (!next_rq) { 279 ret = -ENOMEM; 280 goto out; 281 } 282 rq->next_rq = next_rq; 283 next_rq->cmd_type = rq->cmd_type; 284 285 dxferp = (void*)(unsigned long)hdr->din_xferp; |
286 ret = blk_rq_map_user(q, next_rq, dxferp, hdr->din_xfer_len); | 286 ret = blk_rq_map_user(q, next_rq, dxferp, hdr->din_xfer_len, 287 GFP_KERNEL); |
287 if (ret) 288 goto out; 289 } 290 291 if (hdr->dout_xfer_len) { 292 dxfer_len = hdr->dout_xfer_len; 293 dxferp = (void*)(unsigned long)hdr->dout_xferp; 294 } else if (hdr->din_xfer_len) { 295 dxfer_len = hdr->din_xfer_len; 296 dxferp = (void*)(unsigned long)hdr->din_xferp; 297 } else 298 dxfer_len = 0; 299 300 if (dxfer_len) { | 288 if (ret) 289 goto out; 290 } 291 292 if (hdr->dout_xfer_len) { 293 dxfer_len = hdr->dout_xfer_len; 294 dxferp = (void*)(unsigned long)hdr->dout_xferp; 295 } else if (hdr->din_xfer_len) { 296 dxfer_len = hdr->din_xfer_len; 297 dxferp = (void*)(unsigned long)hdr->din_xferp; 298 } else 299 dxfer_len = 0; 300 301 if (dxfer_len) { |
301 ret = blk_rq_map_user(q, rq, dxferp, dxfer_len); | 302 ret = blk_rq_map_user(q, rq, dxferp, dxfer_len, GFP_KERNEL); |
302 if (ret) 303 goto out; 304 } 305 return rq; 306out: 307 if (rq->cmd != rq->__cmd) 308 kfree(rq->cmd); 309 blk_put_request(rq); --- 795 unchanged lines hidden --- | 303 if (ret) 304 goto out; 305 } 306 return rq; 307out: 308 if (rq->cmd != rq->__cmd) 309 kfree(rq->cmd); 310 blk_put_request(rq); --- 795 unchanged lines hidden --- |