diff options
author | Joe Perches <joe@perches.com> | 2013-09-11 17:25:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:59:32 -0400 |
commit | 844aa7974395df1f0c7a866007e900e5f979fc7b (patch) | |
tree | f77f9d6452629da40c9aefdda603327109ca489a /drivers/block | |
parent | cd3f2cd05cf1066f3975ed3223f12c799bc553c6 (diff) |
pktcdvd: add struct pktcdvd_device * to pkt_dbg
Add pd->name to output for these debugging messages.
Remove normally compiled out pkt_dbg(2, ...) function entry tracing
equivalents as it's better done via the function tracer.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/pktcdvd.c | 90 |
1 files changed, 42 insertions, 48 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index aaa5da2b3d66..5050c7abb6ee 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -71,12 +71,13 @@ | |||
71 | 71 | ||
72 | #define DRIVER_NAME "pktcdvd" | 72 | #define DRIVER_NAME "pktcdvd" |
73 | 73 | ||
74 | #define pkt_dbg(level, fmt, ...) \ | 74 | #define pkt_dbg(level, pd, fmt, ...) \ |
75 | do { \ | 75 | do { \ |
76 | if (level == 2 && PACKET_DEBUG >= 2) \ | 76 | if (level == 2 && PACKET_DEBUG >= 2) \ |
77 | pr_notice("%s: " fmt, __func__, ##__VA_ARGS__); \ | 77 | pr_notice("%s: %s():" fmt, \ |
78 | else if (level == 1 && PACKET_DEBUG >= 1) \ | 78 | pd->name, __func__, ##__VA_ARGS__); \ |
79 | pr_notice(fmt, ##__VA_ARGS__); \ | 79 | else if (level == 1 && PACKET_DEBUG >= 1) \ |
80 | pr_notice("%s: " fmt, pd->name, ##__VA_ARGS__); \ | ||
80 | } while (0) | 81 | } while (0) |
81 | 82 | ||
82 | #define MAX_SPEED 0xffff | 83 | #define MAX_SPEED 0xffff |
@@ -515,7 +516,7 @@ static void pkt_bio_finished(struct pktcdvd_device *pd) | |||
515 | { | 516 | { |
516 | BUG_ON(atomic_read(&pd->cdrw.pending_bios) <= 0); | 517 | BUG_ON(atomic_read(&pd->cdrw.pending_bios) <= 0); |
517 | if (atomic_dec_and_test(&pd->cdrw.pending_bios)) { | 518 | if (atomic_dec_and_test(&pd->cdrw.pending_bios)) { |
518 | pkt_dbg(2, "queue empty\n"); | 519 | pkt_dbg(2, pd, "queue empty\n"); |
519 | atomic_set(&pd->iosched.attention, 1); | 520 | atomic_set(&pd->iosched.attention, 1); |
520 | wake_up(&pd->wqueue); | 521 | wake_up(&pd->wqueue); |
521 | } | 522 | } |
@@ -866,7 +867,7 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd) | |||
866 | need_write_seek = 0; | 867 | need_write_seek = 0; |
867 | if (need_write_seek && reads_queued) { | 868 | if (need_write_seek && reads_queued) { |
868 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { | 869 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { |
869 | pkt_dbg(2, "write, waiting\n"); | 870 | pkt_dbg(2, pd, "write, waiting\n"); |
870 | break; | 871 | break; |
871 | } | 872 | } |
872 | pkt_flush_cache(pd); | 873 | pkt_flush_cache(pd); |
@@ -875,7 +876,7 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd) | |||
875 | } else { | 876 | } else { |
876 | if (!reads_queued && writes_queued) { | 877 | if (!reads_queued && writes_queued) { |
877 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { | 878 | if (atomic_read(&pd->cdrw.pending_bios) > 0) { |
878 | pkt_dbg(2, "read, waiting\n"); | 879 | pkt_dbg(2, pd, "read, waiting\n"); |
879 | break; | 880 | break; |
880 | } | 881 | } |
881 | pd->iosched.writing = 1; | 882 | pd->iosched.writing = 1; |
@@ -981,7 +982,7 @@ static void pkt_end_io_read(struct bio *bio, int err) | |||
981 | struct pktcdvd_device *pd = pkt->pd; | 982 | struct pktcdvd_device *pd = pkt->pd; |
982 | BUG_ON(!pd); | 983 | BUG_ON(!pd); |
983 | 984 | ||
984 | pkt_dbg(2, "bio=%p sec0=%llx sec=%llx err=%d\n", | 985 | pkt_dbg(2, pd, "bio=%p sec0=%llx sec=%llx err=%d\n", |
985 | bio, (unsigned long long)pkt->sector, | 986 | bio, (unsigned long long)pkt->sector, |
986 | (unsigned long long)bio->bi_sector, err); | 987 | (unsigned long long)bio->bi_sector, err); |
987 | 988 | ||
@@ -1000,7 +1001,7 @@ static void pkt_end_io_packet_write(struct bio *bio, int err) | |||
1000 | struct pktcdvd_device *pd = pkt->pd; | 1001 | struct pktcdvd_device *pd = pkt->pd; |
1001 | BUG_ON(!pd); | 1002 | BUG_ON(!pd); |
1002 | 1003 | ||
1003 | pkt_dbg(2, "id=%d, err=%d\n", pkt->id, err); | 1004 | pkt_dbg(2, pd, "id=%d, err=%d\n", pkt->id, err); |
1004 | 1005 | ||
1005 | pd->stats.pkt_ended++; | 1006 | pd->stats.pkt_ended++; |
1006 | 1007 | ||
@@ -1042,7 +1043,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1042 | spin_unlock(&pkt->lock); | 1043 | spin_unlock(&pkt->lock); |
1043 | 1044 | ||
1044 | if (pkt->cache_valid) { | 1045 | if (pkt->cache_valid) { |
1045 | pkt_dbg(2, "zone %llx cached\n", | 1046 | pkt_dbg(2, pd, "zone %llx cached\n", |
1046 | (unsigned long long)pkt->sector); | 1047 | (unsigned long long)pkt->sector); |
1047 | goto out_account; | 1048 | goto out_account; |
1048 | } | 1049 | } |
@@ -1065,7 +1066,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1065 | 1066 | ||
1066 | p = (f * CD_FRAMESIZE) / PAGE_SIZE; | 1067 | p = (f * CD_FRAMESIZE) / PAGE_SIZE; |
1067 | offset = (f * CD_FRAMESIZE) % PAGE_SIZE; | 1068 | offset = (f * CD_FRAMESIZE) % PAGE_SIZE; |
1068 | pkt_dbg(2, "Adding frame %d, page:%p offs:%d\n", | 1069 | pkt_dbg(2, pd, "Adding frame %d, page:%p offs:%d\n", |
1069 | f, pkt->pages[p], offset); | 1070 | f, pkt->pages[p], offset); |
1070 | if (!bio_add_page(bio, pkt->pages[p], CD_FRAMESIZE, offset)) | 1071 | if (!bio_add_page(bio, pkt->pages[p], CD_FRAMESIZE, offset)) |
1071 | BUG(); | 1072 | BUG(); |
@@ -1077,7 +1078,7 @@ static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1077 | } | 1078 | } |
1078 | 1079 | ||
1079 | out_account: | 1080 | out_account: |
1080 | pkt_dbg(2, "need %d frames for zone %llx\n", | 1081 | pkt_dbg(2, pd, "need %d frames for zone %llx\n", |
1081 | frames_read, (unsigned long long)pkt->sector); | 1082 | frames_read, (unsigned long long)pkt->sector); |
1082 | pd->stats.pkt_started++; | 1083 | pd->stats.pkt_started++; |
1083 | pd->stats.secs_rg += frames_read * (CD_FRAMESIZE >> 9); | 1084 | pd->stats.secs_rg += frames_read * (CD_FRAMESIZE >> 9); |
@@ -1178,7 +1179,7 @@ static inline void pkt_set_state(struct packet_data *pkt, enum packet_data_state | |||
1178 | "IDLE", "WAITING", "READ_WAIT", "WRITE_WAIT", "RECOVERY", "FINISHED" | 1179 | "IDLE", "WAITING", "READ_WAIT", "WRITE_WAIT", "RECOVERY", "FINISHED" |
1179 | }; | 1180 | }; |
1180 | enum packet_data_state old_state = pkt->state; | 1181 | enum packet_data_state old_state = pkt->state; |
1181 | pkt_dbg(2, "pkt %2d : s=%6llx %s -> %s\n", | 1182 | pkt_dbg(2, pd, "pkt %2d : s=%6llx %s -> %s\n", |
1182 | pkt->id, (unsigned long long)pkt->sector, | 1183 | pkt->id, (unsigned long long)pkt->sector, |
1183 | state_name[old_state], state_name[state]); | 1184 | state_name[old_state], state_name[state]); |
1184 | #endif | 1185 | #endif |
@@ -1198,12 +1199,10 @@ static int pkt_handle_queue(struct pktcdvd_device *pd) | |||
1198 | struct rb_node *n; | 1199 | struct rb_node *n; |
1199 | int wakeup; | 1200 | int wakeup; |
1200 | 1201 | ||
1201 | pkt_dbg(2, "\n"); | ||
1202 | |||
1203 | atomic_set(&pd->scan_queue, 0); | 1202 | atomic_set(&pd->scan_queue, 0); |
1204 | 1203 | ||
1205 | if (list_empty(&pd->cdrw.pkt_free_list)) { | 1204 | if (list_empty(&pd->cdrw.pkt_free_list)) { |
1206 | pkt_dbg(2, "no pkt\n"); | 1205 | pkt_dbg(2, pd, "no pkt\n"); |
1207 | return 0; | 1206 | return 0; |
1208 | } | 1207 | } |
1209 | 1208 | ||
@@ -1240,7 +1239,7 @@ try_next_bio: | |||
1240 | } | 1239 | } |
1241 | spin_unlock(&pd->lock); | 1240 | spin_unlock(&pd->lock); |
1242 | if (!bio) { | 1241 | if (!bio) { |
1243 | pkt_dbg(2, "no bio\n"); | 1242 | pkt_dbg(2, pd, "no bio\n"); |
1244 | return 0; | 1243 | return 0; |
1245 | } | 1244 | } |
1246 | 1245 | ||
@@ -1256,10 +1255,10 @@ try_next_bio: | |||
1256 | * to this packet. | 1255 | * to this packet. |
1257 | */ | 1256 | */ |
1258 | spin_lock(&pd->lock); | 1257 | spin_lock(&pd->lock); |
1259 | pkt_dbg(2, "looking for zone %llx\n", (unsigned long long)zone); | 1258 | pkt_dbg(2, pd, "looking for zone %llx\n", (unsigned long long)zone); |
1260 | while ((node = pkt_rbtree_find(pd, zone)) != NULL) { | 1259 | while ((node = pkt_rbtree_find(pd, zone)) != NULL) { |
1261 | bio = node->bio; | 1260 | bio = node->bio; |
1262 | pkt_dbg(2, "found zone=%llx\n", | 1261 | pkt_dbg(2, pd, "found zone=%llx\n", |
1263 | (unsigned long long)get_zone(bio->bi_sector, pd)); | 1262 | (unsigned long long)get_zone(bio->bi_sector, pd)); |
1264 | if (get_zone(bio->bi_sector, pd) != zone) | 1263 | if (get_zone(bio->bi_sector, pd) != zone) |
1265 | break; | 1264 | break; |
@@ -1312,7 +1311,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1312 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) | 1311 | if (!bio_add_page(pkt->w_bio, bvec[f].bv_page, CD_FRAMESIZE, bvec[f].bv_offset)) |
1313 | BUG(); | 1312 | BUG(); |
1314 | } | 1313 | } |
1315 | pkt_dbg(2, "vcnt=%d\n", pkt->w_bio->bi_vcnt); | 1314 | pkt_dbg(2, pd, "vcnt=%d\n", pkt->w_bio->bi_vcnt); |
1316 | 1315 | ||
1317 | /* | 1316 | /* |
1318 | * Fill-in bvec with data from orig_bios. | 1317 | * Fill-in bvec with data from orig_bios. |
@@ -1323,7 +1322,7 @@ static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt) | |||
1323 | pkt_set_state(pkt, PACKET_WRITE_WAIT_STATE); | 1322 | pkt_set_state(pkt, PACKET_WRITE_WAIT_STATE); |
1324 | spin_unlock(&pkt->lock); | 1323 | spin_unlock(&pkt->lock); |
1325 | 1324 | ||
1326 | pkt_dbg(2, "Writing %d frames for zone %llx\n", | 1325 | pkt_dbg(2, pd, "Writing %d frames for zone %llx\n", |
1327 | pkt->write_size, (unsigned long long)pkt->sector); | 1326 | pkt->write_size, (unsigned long long)pkt->sector); |
1328 | 1327 | ||
1329 | if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) { | 1328 | if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) { |
@@ -1355,7 +1354,7 @@ static void pkt_run_state_machine(struct pktcdvd_device *pd, struct packet_data | |||
1355 | { | 1354 | { |
1356 | int uptodate; | 1355 | int uptodate; |
1357 | 1356 | ||
1358 | pkt_dbg(2, "pkt %d\n", pkt->id); | 1357 | pkt_dbg(2, pd, "pkt %d\n", pkt->id); |
1359 | 1358 | ||
1360 | for (;;) { | 1359 | for (;;) { |
1361 | switch (pkt->state) { | 1360 | switch (pkt->state) { |
@@ -1394,7 +1393,7 @@ static void pkt_run_state_machine(struct pktcdvd_device *pd, struct packet_data | |||
1394 | if (pkt_start_recovery(pkt)) { | 1393 | if (pkt_start_recovery(pkt)) { |
1395 | pkt_start_write(pd, pkt); | 1394 | pkt_start_write(pd, pkt); |
1396 | } else { | 1395 | } else { |
1397 | pkt_dbg(2, "No recovery possible\n"); | 1396 | pkt_dbg(2, pd, "No recovery possible\n"); |
1398 | pkt_set_state(pkt, PACKET_FINISHED_STATE); | 1397 | pkt_set_state(pkt, PACKET_FINISHED_STATE); |
1399 | } | 1398 | } |
1400 | break; | 1399 | break; |
@@ -1415,8 +1414,6 @@ static void pkt_handle_packets(struct pktcdvd_device *pd) | |||
1415 | { | 1414 | { |
1416 | struct packet_data *pkt, *next; | 1415 | struct packet_data *pkt, *next; |
1417 | 1416 | ||
1418 | pkt_dbg(2, "\n"); | ||
1419 | |||
1420 | /* | 1417 | /* |
1421 | * Run state machine for active packets | 1418 | * Run state machine for active packets |
1422 | */ | 1419 | */ |
@@ -1498,7 +1495,7 @@ static int kcdrwd(void *foobar) | |||
1498 | if (PACKET_DEBUG > 1) { | 1495 | if (PACKET_DEBUG > 1) { |
1499 | int states[PACKET_NUM_STATES]; | 1496 | int states[PACKET_NUM_STATES]; |
1500 | pkt_count_states(pd, states); | 1497 | pkt_count_states(pd, states); |
1501 | pkt_dbg(2, "i:%d ow:%d rw:%d ww:%d rec:%d fin:%d\n", | 1498 | pkt_dbg(2, pd, "i:%d ow:%d rw:%d ww:%d rec:%d fin:%d\n", |
1502 | states[0], states[1], states[2], | 1499 | states[0], states[1], states[2], |
1503 | states[3], states[4], states[5]); | 1500 | states[3], states[4], states[5]); |
1504 | } | 1501 | } |
@@ -1509,9 +1506,9 @@ static int kcdrwd(void *foobar) | |||
1509 | min_sleep_time = pkt->sleep_time; | 1506 | min_sleep_time = pkt->sleep_time; |
1510 | } | 1507 | } |
1511 | 1508 | ||
1512 | pkt_dbg(2, "sleeping\n"); | 1509 | pkt_dbg(2, pd, "sleeping\n"); |
1513 | residue = schedule_timeout(min_sleep_time); | 1510 | residue = schedule_timeout(min_sleep_time); |
1514 | pkt_dbg(2, "wake up\n"); | 1511 | pkt_dbg(2, pd, "wake up\n"); |
1515 | 1512 | ||
1516 | /* make swsusp happy with our thread */ | 1513 | /* make swsusp happy with our thread */ |
1517 | try_to_freeze(); | 1514 | try_to_freeze(); |
@@ -1808,7 +1805,7 @@ static int pkt_writable_disc(struct pktcdvd_device *pd, disc_information *di) | |||
1808 | case 0x12: /* DVD-RAM */ | 1805 | case 0x12: /* DVD-RAM */ |
1809 | return 1; | 1806 | return 1; |
1810 | default: | 1807 | default: |
1811 | pkt_dbg(2, "Wrong disc profile (%x)\n", | 1808 | pkt_dbg(2, pd, "Wrong disc profile (%x)\n", |
1812 | pd->mmc3_profile); | 1809 | pd->mmc3_profile); |
1813 | return 0; | 1810 | return 0; |
1814 | } | 1811 | } |
@@ -2124,7 +2121,7 @@ static noinline_for_stack int pkt_perform_opc(struct pktcdvd_device *pd) | |||
2124 | struct request_sense sense; | 2121 | struct request_sense sense; |
2125 | int ret; | 2122 | int ret; |
2126 | 2123 | ||
2127 | pkt_dbg(2, "Performing OPC\n"); | 2124 | pkt_dbg(2, pd, "Performing OPC\n"); |
2128 | 2125 | ||
2129 | init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); | 2126 | init_cdrom_command(&cgc, NULL, 0, CGC_DATA_NONE); |
2130 | cgc.sense = &sense; | 2127 | cgc.sense = &sense; |
@@ -2142,12 +2139,12 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
2142 | unsigned int write_speed, media_write_speed, read_speed; | 2139 | unsigned int write_speed, media_write_speed, read_speed; |
2143 | 2140 | ||
2144 | if ((ret = pkt_probe_settings(pd))) { | 2141 | if ((ret = pkt_probe_settings(pd))) { |
2145 | pkt_dbg(2, "%s failed probe\n", pd->name); | 2142 | pkt_dbg(2, pd, "failed probe\n"); |
2146 | return ret; | 2143 | return ret; |
2147 | } | 2144 | } |
2148 | 2145 | ||
2149 | if ((ret = pkt_set_write_settings(pd))) { | 2146 | if ((ret = pkt_set_write_settings(pd))) { |
2150 | pkt_dbg(1, "%s failed saving write settings\n", pd->name); | 2147 | pkt_dbg(1, pd, "failed saving write settings\n"); |
2151 | return -EIO; | 2148 | return -EIO; |
2152 | } | 2149 | } |
2153 | 2150 | ||
@@ -2159,26 +2156,26 @@ static int pkt_open_write(struct pktcdvd_device *pd) | |||
2159 | case 0x13: /* DVD-RW */ | 2156 | case 0x13: /* DVD-RW */ |
2160 | case 0x1a: /* DVD+RW */ | 2157 | case 0x1a: /* DVD+RW */ |
2161 | case 0x12: /* DVD-RAM */ | 2158 | case 0x12: /* DVD-RAM */ |
2162 | pkt_dbg(1, "write speed %ukB/s\n", write_speed); | 2159 | pkt_dbg(1, pd, "write speed %ukB/s\n", write_speed); |
2163 | break; | 2160 | break; |
2164 | default: | 2161 | default: |
2165 | if ((ret = pkt_media_speed(pd, &media_write_speed))) | 2162 | if ((ret = pkt_media_speed(pd, &media_write_speed))) |
2166 | media_write_speed = 16; | 2163 | media_write_speed = 16; |
2167 | write_speed = min(write_speed, media_write_speed * 177); | 2164 | write_speed = min(write_speed, media_write_speed * 177); |
2168 | pkt_dbg(1, "write speed %ux\n", write_speed / 176); | 2165 | pkt_dbg(1, pd, "write speed %ux\n", write_speed / 176); |
2169 | break; | 2166 | break; |
2170 | } | 2167 | } |
2171 | read_speed = write_speed; | 2168 | read_speed = write_speed; |
2172 | 2169 | ||
2173 | if ((ret = pkt_set_speed(pd, write_speed, read_speed))) { | 2170 | if ((ret = pkt_set_speed(pd, write_speed, read_speed))) { |
2174 | pkt_dbg(1, "%s couldn't set write speed\n", pd->name); | 2171 | pkt_dbg(1, pd, "couldn't set write speed\n"); |
2175 | return -EIO; | 2172 | return -EIO; |
2176 | } | 2173 | } |
2177 | pd->write_speed = write_speed; | 2174 | pd->write_speed = write_speed; |
2178 | pd->read_speed = read_speed; | 2175 | pd->read_speed = read_speed; |
2179 | 2176 | ||
2180 | if ((ret = pkt_perform_opc(pd))) { | 2177 | if ((ret = pkt_perform_opc(pd))) { |
2181 | pkt_dbg(1, "%s Optimum Power Calibration failed\n", pd->name); | 2178 | pkt_dbg(1, pd, "Optimum Power Calibration failed\n"); |
2182 | } | 2179 | } |
2183 | 2180 | ||
2184 | return 0; | 2181 | return 0; |
@@ -2255,7 +2252,7 @@ out: | |||
2255 | static void pkt_release_dev(struct pktcdvd_device *pd, int flush) | 2252 | static void pkt_release_dev(struct pktcdvd_device *pd, int flush) |
2256 | { | 2253 | { |
2257 | if (flush && pkt_flush_cache(pd)) | 2254 | if (flush && pkt_flush_cache(pd)) |
2258 | pkt_dbg(1, "%s not flushing cache\n", pd->name); | 2255 | pkt_dbg(1, pd, "not flushing cache\n"); |
2259 | 2256 | ||
2260 | pkt_lock_door(pd, 0); | 2257 | pkt_lock_door(pd, 0); |
2261 | 2258 | ||
@@ -2277,8 +2274,6 @@ static int pkt_open(struct block_device *bdev, fmode_t mode) | |||
2277 | struct pktcdvd_device *pd = NULL; | 2274 | struct pktcdvd_device *pd = NULL; |
2278 | int ret; | 2275 | int ret; |
2279 | 2276 | ||
2280 | pkt_dbg(2, "entering\n"); | ||
2281 | |||
2282 | mutex_lock(&pktcdvd_mutex); | 2277 | mutex_lock(&pktcdvd_mutex); |
2283 | mutex_lock(&ctl_mutex); | 2278 | mutex_lock(&ctl_mutex); |
2284 | pd = pkt_find_dev_from_minor(MINOR(bdev->bd_dev)); | 2279 | pd = pkt_find_dev_from_minor(MINOR(bdev->bd_dev)); |
@@ -2313,7 +2308,6 @@ static int pkt_open(struct block_device *bdev, fmode_t mode) | |||
2313 | out_dec: | 2308 | out_dec: |
2314 | pd->refcnt--; | 2309 | pd->refcnt--; |
2315 | out: | 2310 | out: |
2316 | pkt_dbg(2, "failed (%d)\n", ret); | ||
2317 | mutex_unlock(&ctl_mutex); | 2311 | mutex_unlock(&ctl_mutex); |
2318 | mutex_unlock(&pktcdvd_mutex); | 2312 | mutex_unlock(&pktcdvd_mutex); |
2319 | return ret; | 2313 | return ret; |
@@ -2394,7 +2388,7 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio) | |||
2394 | blk_queue_bounce(q, &bio); | 2388 | blk_queue_bounce(q, &bio); |
2395 | 2389 | ||
2396 | zone = get_zone(bio->bi_sector, pd); | 2390 | zone = get_zone(bio->bi_sector, pd); |
2397 | pkt_dbg(2, "start = %6llx stop = %6llx\n", | 2391 | pkt_dbg(2, pd, "start = %6llx stop = %6llx\n", |
2398 | (unsigned long long)bio->bi_sector, | 2392 | (unsigned long long)bio->bi_sector, |
2399 | (unsigned long long)bio_end_sector(bio)); | 2393 | (unsigned long long)bio_end_sector(bio)); |
2400 | 2394 | ||
@@ -2649,7 +2643,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev) | |||
2649 | } | 2643 | } |
2650 | 2644 | ||
2651 | proc_create_data(pd->name, 0, pkt_proc, &pkt_proc_fops, pd); | 2645 | proc_create_data(pd->name, 0, pkt_proc, &pkt_proc_fops, pd); |
2652 | pkt_dbg(1, "writer %s mapped to %s\n", pd->name, bdevname(bdev, b)); | 2646 | pkt_dbg(1, pd, "writer mapped to %s\n", bdevname(bdev, b)); |
2653 | return 0; | 2647 | return 0; |
2654 | 2648 | ||
2655 | out_mem: | 2649 | out_mem: |
@@ -2664,7 +2658,7 @@ static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
2664 | struct pktcdvd_device *pd = bdev->bd_disk->private_data; | 2658 | struct pktcdvd_device *pd = bdev->bd_disk->private_data; |
2665 | int ret; | 2659 | int ret; |
2666 | 2660 | ||
2667 | pkt_dbg(2, "cmd %x, dev %d:%d\n", | 2661 | pkt_dbg(2, pd, "cmd %x, dev %d:%d\n", |
2668 | cmd, MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev)); | 2662 | cmd, MAJOR(bdev->bd_dev), MINOR(bdev->bd_dev)); |
2669 | 2663 | ||
2670 | mutex_lock(&pktcdvd_mutex); | 2664 | mutex_lock(&pktcdvd_mutex); |
@@ -2689,7 +2683,7 @@ static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
2689 | break; | 2683 | break; |
2690 | 2684 | ||
2691 | default: | 2685 | default: |
2692 | pkt_dbg(2, "Unknown ioctl for %s (%x)\n", pd->name, cmd); | 2686 | pkt_dbg(2, pd, "Unknown ioctl (%x)\n", cmd); |
2693 | ret = -ENOTTY; | 2687 | ret = -ENOTTY; |
2694 | } | 2688 | } |
2695 | mutex_unlock(&pktcdvd_mutex); | 2689 | mutex_unlock(&pktcdvd_mutex); |
@@ -2838,7 +2832,7 @@ static int pkt_remove_dev(dev_t pkt_dev) | |||
2838 | break; | 2832 | break; |
2839 | } | 2833 | } |
2840 | if (idx == MAX_WRITERS) { | 2834 | if (idx == MAX_WRITERS) { |
2841 | pkt_dbg(1, "dev not setup\n"); | 2835 | pkt_dbg(1, pd, "dev not setup\n"); |
2842 | ret = -ENXIO; | 2836 | ret = -ENXIO; |
2843 | goto out; | 2837 | goto out; |
2844 | } | 2838 | } |
@@ -2858,7 +2852,7 @@ static int pkt_remove_dev(dev_t pkt_dev) | |||
2858 | blkdev_put(pd->bdev, FMODE_READ | FMODE_NDELAY); | 2852 | blkdev_put(pd->bdev, FMODE_READ | FMODE_NDELAY); |
2859 | 2853 | ||
2860 | remove_proc_entry(pd->name, pkt_proc); | 2854 | remove_proc_entry(pd->name, pkt_proc); |
2861 | pkt_dbg(1, "writer %s unmapped\n", pd->name); | 2855 | pkt_dbg(1, pd, "writer unmapped\n"); |
2862 | 2856 | ||
2863 | del_gendisk(pd->disk); | 2857 | del_gendisk(pd->disk); |
2864 | blk_cleanup_queue(pd->disk->queue); | 2858 | blk_cleanup_queue(pd->disk->queue); |