Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cciss: switch to ->show_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro e88b7bb0 25daa96f

+46 -52
+46 -52
drivers/block/cciss_scsi.c
··· 54 54 static void cmd_free(ctlr_info_t *h, CommandList_struct *c); 55 55 static void cmd_special_free(ctlr_info_t *h, CommandList_struct *c); 56 56 57 - static int cciss_scsi_proc_info( 58 - struct Scsi_Host *sh, 57 + static int cciss_scsi_write_info(struct Scsi_Host *sh, 59 58 char *buffer, /* data buffer */ 60 - char **start, /* where data in buffer starts */ 61 - off_t offset, /* offset from start of imaginary file */ 62 - int length, /* length of data in buffer */ 63 - int func); /* 0 == read, 1 == write */ 59 + int length); /* length of data in buffer */ 60 + static int cciss_scsi_show_info(struct seq_file *m, 61 + struct Scsi_Host *sh); 64 62 65 63 static int cciss_scsi_queue_command (struct Scsi_Host *h, 66 64 struct scsi_cmnd *cmd); ··· 80 82 .module = THIS_MODULE, 81 83 .name = "cciss", 82 84 .proc_name = "cciss", 83 - .proc_info = cciss_scsi_proc_info, 85 + .write_info = cciss_scsi_write_info, 86 + .show_info = cciss_scsi_show_info, 84 87 .queuecommand = cciss_scsi_queue_command, 85 88 .this_id = 7, 86 89 .cmd_per_lun = 1, ··· 1301 1302 return length; 1302 1303 } 1303 1304 1304 - 1305 1305 static int 1306 - cciss_scsi_proc_info(struct Scsi_Host *sh, 1306 + cciss_scsi_write_info(struct Scsi_Host *sh, 1307 1307 char *buffer, /* data buffer */ 1308 - char **start, /* where data in buffer starts */ 1309 - off_t offset, /* offset from start of imaginary file */ 1310 - int length, /* length of data in buffer */ 1311 - int func) /* 0 == read, 1 == write */ 1308 + int length) /* length of data in buffer */ 1312 1309 { 1313 - 1314 - int buflen, datalen; 1315 - ctlr_info_t *h; 1316 - int i; 1317 - 1318 - h = (ctlr_info_t *) sh->hostdata[0]; 1310 + ctlr_info_t *h = (ctlr_info_t *) sh->hostdata[0]; 1319 1311 if (h == NULL) /* This really shouldn't ever happen. */ 1320 1312 return -EINVAL; 1321 1313 1322 - if (func == 0) { /* User is reading from /proc/scsi/ciss*?/?* */ 1323 - buflen = sprintf(buffer, "cciss%d: SCSI host: %d\n", 1324 - h->ctlr, sh->host_no); 1325 - 1326 - /* this information is needed by apps to know which cciss 1327 - device corresponds to which scsi host number without 1328 - having to open a scsi target device node. The device 1329 - information is not a duplicate of /proc/scsi/scsi because 1330 - the two may be out of sync due to scsi hotplug, rather 1331 - this info is for an app to be able to use to know how to 1332 - get them back in sync. */ 1333 - 1334 - for (i = 0; i < ccissscsi[h->ctlr].ndevices; i++) { 1335 - struct cciss_scsi_dev_t *sd = 1336 - &ccissscsi[h->ctlr].dev[i]; 1337 - buflen += sprintf(&buffer[buflen], "c%db%dt%dl%d %02d " 1338 - "0x%02x%02x%02x%02x%02x%02x%02x%02x\n", 1339 - sh->host_no, sd->bus, sd->target, sd->lun, 1340 - sd->devtype, 1341 - sd->scsi3addr[0], sd->scsi3addr[1], 1342 - sd->scsi3addr[2], sd->scsi3addr[3], 1343 - sd->scsi3addr[4], sd->scsi3addr[5], 1344 - sd->scsi3addr[6], sd->scsi3addr[7]); 1345 - } 1346 - datalen = buflen - offset; 1347 - if (datalen < 0) { /* they're reading past EOF. */ 1348 - datalen = 0; 1349 - *start = buffer+buflen; 1350 - } else 1351 - *start = buffer + offset; 1352 - return(datalen); 1353 - } else /* User is writing to /proc/scsi/cciss*?/?* ... */ 1354 - return cciss_scsi_user_command(h, sh->host_no, 1314 + return cciss_scsi_user_command(h, sh->host_no, 1355 1315 buffer, length); 1356 1316 } 1317 + 1318 + static int 1319 + cciss_scsi_show_info(struct seq_file *m, struct Scsi_Host *sh) 1320 + { 1321 + 1322 + ctlr_info_t *h = (ctlr_info_t *) sh->hostdata[0]; 1323 + int i; 1324 + 1325 + if (h == NULL) /* This really shouldn't ever happen. */ 1326 + return -EINVAL; 1327 + 1328 + seq_printf(m, "cciss%d: SCSI host: %d\n", 1329 + h->ctlr, sh->host_no); 1330 + 1331 + /* this information is needed by apps to know which cciss 1332 + device corresponds to which scsi host number without 1333 + having to open a scsi target device node. The device 1334 + information is not a duplicate of /proc/scsi/scsi because 1335 + the two may be out of sync due to scsi hotplug, rather 1336 + this info is for an app to be able to use to know how to 1337 + get them back in sync. */ 1338 + 1339 + for (i = 0; i < ccissscsi[h->ctlr].ndevices; i++) { 1340 + struct cciss_scsi_dev_t *sd = 1341 + &ccissscsi[h->ctlr].dev[i]; 1342 + seq_printf(m, "c%db%dt%dl%d %02d " 1343 + "0x%02x%02x%02x%02x%02x%02x%02x%02x\n", 1344 + sh->host_no, sd->bus, sd->target, sd->lun, 1345 + sd->devtype, 1346 + sd->scsi3addr[0], sd->scsi3addr[1], 1347 + sd->scsi3addr[2], sd->scsi3addr[3], 1348 + sd->scsi3addr[4], sd->scsi3addr[5], 1349 + sd->scsi3addr[6], sd->scsi3addr[7]); 1350 + } 1351 + return 0; 1352 + } 1357 1353 1358 1354 /* cciss_scatter_gather takes a struct scsi_cmnd, (cmd), and does the pci 1359 1355 dma mapping and fills in the scatter gather entries of the