diff options
author | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
commit | 9cbc1cb8cd46ce1f7645b9de249b2ce8460129bb (patch) | |
tree | 8d104ec2a459346b99413b0b77421ca7b9936c1a /drivers/s390/block/dasd_fba.c | |
parent | ca44d6e60f9de26281fda203f58b570e1748c015 (diff) | |
parent | 45e3e1935e2857c54783291107d33323b3ef33c8 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/scsi/fcoe/fcoe.c
net/core/drop_monitor.c
net/core/net-traces.c
Diffstat (limited to 'drivers/s390/block/dasd_fba.c')
-rw-r--r-- | drivers/s390/block/dasd_fba.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index a3eb6fd14673..597c6ffdb9f2 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c | |||
@@ -122,20 +122,20 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
122 | struct dasd_block *block; | 122 | struct dasd_block *block; |
123 | struct dasd_fba_private *private; | 123 | struct dasd_fba_private *private; |
124 | struct ccw_device *cdev = device->cdev; | 124 | struct ccw_device *cdev = device->cdev; |
125 | void *rdc_data; | ||
126 | int rc; | 125 | int rc; |
127 | 126 | ||
128 | private = (struct dasd_fba_private *) device->private; | 127 | private = (struct dasd_fba_private *) device->private; |
129 | if (private == NULL) { | 128 | if (!private) { |
130 | private = kzalloc(sizeof(struct dasd_fba_private), | 129 | private = kzalloc(sizeof(*private), GFP_KERNEL | GFP_DMA); |
131 | GFP_KERNEL | GFP_DMA); | 130 | if (!private) { |
132 | if (private == NULL) { | ||
133 | dev_warn(&device->cdev->dev, | 131 | dev_warn(&device->cdev->dev, |
134 | "Allocating memory for private DASD " | 132 | "Allocating memory for private DASD " |
135 | "data failed\n"); | 133 | "data failed\n"); |
136 | return -ENOMEM; | 134 | return -ENOMEM; |
137 | } | 135 | } |
138 | device->private = (void *) private; | 136 | device->private = (void *) private; |
137 | } else { | ||
138 | memset(private, 0, sizeof(*private)); | ||
139 | } | 139 | } |
140 | block = dasd_alloc_block(); | 140 | block = dasd_alloc_block(); |
141 | if (IS_ERR(block)) { | 141 | if (IS_ERR(block)) { |
@@ -150,8 +150,8 @@ dasd_fba_check_characteristics(struct dasd_device *device) | |||
150 | block->base = device; | 150 | block->base = device; |
151 | 151 | ||
152 | /* Read Device Characteristics */ | 152 | /* Read Device Characteristics */ |
153 | rdc_data = (void *) &(private->rdc_data); | 153 | rc = dasd_generic_read_dev_chars(device, "FBA ", &private->rdc_data, |
154 | rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); | 154 | 32); |
155 | if (rc) { | 155 | if (rc) { |
156 | DBF_EVENT(DBF_WARNING, "Read device characteristics returned " | 156 | DBF_EVENT(DBF_WARNING, "Read device characteristics returned " |
157 | "error %d for device: %s", | 157 | "error %d for device: %s", |
@@ -270,8 +270,9 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev, | |||
270 | return ERR_PTR(-EINVAL); | 270 | return ERR_PTR(-EINVAL); |
271 | blksize = block->bp_block; | 271 | blksize = block->bp_block; |
272 | /* Calculate record id of first and last block. */ | 272 | /* Calculate record id of first and last block. */ |
273 | first_rec = req->sector >> block->s2b_shift; | 273 | first_rec = blk_rq_pos(req) >> block->s2b_shift; |
274 | last_rec = (req->sector + req->nr_sectors - 1) >> block->s2b_shift; | 274 | last_rec = |
275 | (blk_rq_pos(req) + blk_rq_sectors(req) - 1) >> block->s2b_shift; | ||
275 | /* Check struct bio and count the number of blocks for the request. */ | 276 | /* Check struct bio and count the number of blocks for the request. */ |
276 | count = 0; | 277 | count = 0; |
277 | cidaw = 0; | 278 | cidaw = 0; |
@@ -309,7 +310,7 @@ static struct dasd_ccw_req *dasd_fba_build_cp(struct dasd_device * memdev, | |||
309 | ccw = cqr->cpaddr; | 310 | ccw = cqr->cpaddr; |
310 | /* First ccw is define extent. */ | 311 | /* First ccw is define extent. */ |
311 | define_extent(ccw++, cqr->data, rq_data_dir(req), | 312 | define_extent(ccw++, cqr->data, rq_data_dir(req), |
312 | block->bp_block, req->sector, req->nr_sectors); | 313 | block->bp_block, blk_rq_pos(req), blk_rq_sectors(req)); |
313 | /* Build locate_record + read/write ccws. */ | 314 | /* Build locate_record + read/write ccws. */ |
314 | idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data)); | 315 | idaws = (unsigned long *) (cqr->data + sizeof(struct DE_fba_data)); |
315 | LO_data = (struct LO_fba_data *) (idaws + cidaw); | 316 | LO_data = (struct LO_fba_data *) (idaws + cidaw); |
@@ -603,8 +604,14 @@ static struct dasd_discipline dasd_fba_discipline = { | |||
603 | static int __init | 604 | static int __init |
604 | dasd_fba_init(void) | 605 | dasd_fba_init(void) |
605 | { | 606 | { |
607 | int ret; | ||
608 | |||
606 | ASCEBC(dasd_fba_discipline.ebcname, 4); | 609 | ASCEBC(dasd_fba_discipline.ebcname, 4); |
607 | return ccw_driver_register(&dasd_fba_driver); | 610 | ret = ccw_driver_register(&dasd_fba_driver); |
611 | if (!ret) | ||
612 | wait_for_device_probe(); | ||
613 | |||
614 | return ret; | ||
608 | } | 615 | } |
609 | 616 | ||
610 | static void __exit | 617 | static void __exit |