scsi_proc.c (859d22f9c3924ab87b05ded8ba922abc298c1d43) | scsi_proc.c (d9dda78bad879595d8c4220a067fc029d6484a16) |
---|---|
1/* 2 * linux/drivers/scsi/scsi_proc.c 3 * 4 * The functions in this file provide an interface between 5 * the PROC file system and the SCSI device drivers 6 * It is mainly used for debugging, statistics and to pass 7 * information directly to the lowlevel driver. 8 * --- 34 unchanged lines hidden (view full) --- 43static struct proc_dir_entry *proc_scsi; 44 45/* Protect sht->present and sht->proc_dir */ 46static DEFINE_MUTEX(global_host_template_mutex); 47 48static ssize_t proc_scsi_host_write(struct file *file, const char __user *buf, 49 size_t count, loff_t *ppos) 50{ | 1/* 2 * linux/drivers/scsi/scsi_proc.c 3 * 4 * The functions in this file provide an interface between 5 * the PROC file system and the SCSI device drivers 6 * It is mainly used for debugging, statistics and to pass 7 * information directly to the lowlevel driver. 8 * --- 34 unchanged lines hidden (view full) --- 43static struct proc_dir_entry *proc_scsi; 44 45/* Protect sht->present and sht->proc_dir */ 46static DEFINE_MUTEX(global_host_template_mutex); 47 48static ssize_t proc_scsi_host_write(struct file *file, const char __user *buf, 49 size_t count, loff_t *ppos) 50{ |
51 struct Scsi_Host *shost = PDE(file_inode(file))->data; | 51 struct Scsi_Host *shost = PDE_DATA(file_inode(file)); |
52 ssize_t ret = -ENOMEM; 53 char *page; 54 55 if (count > PROC_BLOCK_SIZE) 56 return -EOVERFLOW; 57 58 if (!shost->hostt->write_info) 59 return -EINVAL; --- 13 unchanged lines hidden (view full) --- 73static int proc_scsi_show(struct seq_file *m, void *v) 74{ 75 struct Scsi_Host *shost = m->private; 76 return shost->hostt->show_info(m, shost); 77} 78 79static int proc_scsi_host_open(struct inode *inode, struct file *file) 80{ | 52 ssize_t ret = -ENOMEM; 53 char *page; 54 55 if (count > PROC_BLOCK_SIZE) 56 return -EOVERFLOW; 57 58 if (!shost->hostt->write_info) 59 return -EINVAL; --- 13 unchanged lines hidden (view full) --- 73static int proc_scsi_show(struct seq_file *m, void *v) 74{ 75 struct Scsi_Host *shost = m->private; 76 return shost->hostt->show_info(m, shost); 77} 78 79static int proc_scsi_host_open(struct inode *inode, struct file *file) 80{ |
81 return single_open_size(file, proc_scsi_show, PDE(inode)->data, | 81 return single_open_size(file, proc_scsi_show, PDE_DATA(inode), |
82 4 * PAGE_SIZE); 83} 84 85static const struct file_operations proc_scsi_fops = { 86 .open = proc_scsi_host_open, 87 .read = seq_read, 88 .llseek = seq_lseek, 89 .write = proc_scsi_host_write --- 391 unchanged lines hidden --- | 82 4 * PAGE_SIZE); 83} 84 85static const struct file_operations proc_scsi_fops = { 86 .open = proc_scsi_host_open, 87 .read = seq_read, 88 .llseek = seq_lseek, 89 .write = proc_scsi_host_write --- 391 unchanged lines hidden --- |