ALT Linux kernel packages development
 help / color / mirror / Atom feed
* [d-kernel]  новая версия патча для sd
@ 2003-07-04 10:29 Anton Farygin
    0 siblings, 1 reply; 3+ messages in thread
From: Anton Farygin @ 2003-07-04 10:29 UTC (permalink / raw)
  To: ALT Linux kernel packages development


[-- Attachment #1.1: Type: text/plain, Size: 106 bytes --]

Собственно новая версия патча с исправлением небольшой ошибки.

Просьба включить в std ядра.

Rgds,
Rider

[-- Attachment #1.2: linux-2.4.21-altlinux-scsi-addproc-sd-0.1.patch --]
[-- Type: text/plain, Size: 1573 bytes --]

diff -ur kernel-source-2.4.21.orig/drivers/scsi/sd.c kernel-source-2.4.21/drivers/scsi/sd.c
--- kernel-source-2.4.21.orig/drivers/scsi/sd.c	2003-06-13 18:51:36 +0400
+++ kernel-source-2.4.21/drivers/scsi/sd.c	2003-07-04 12:22:22 +0400
@@ -1421,8 +1421,45 @@
 	return;
 }
 
+#ifdef CONFIG_PROC_FS
+static int scsi_proc_hostno(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+	Scsi_Disk *dpnt;
+	Scsi_Device *sdp;
+	int i, size = 0, len = 0;
+	char nbuff[6];
+
+	for (dpnt = rscsi_disks, i=0; i < sd_template.nr_dev; i++, dpnt++) {
+		if (!dpnt->device)
+			continue;
+		sdp = dpnt->device;
+		sd_devname(i, nbuff);
+		size = sprintf(page + len, "%s: scsi%02d(%d,%d,%d)\n", nbuff, sdp->host->host_no, sdp->channel, sdp->id, sdp->lun);
+		len += size;
+	}
+	if (len <= off+count)
+		*eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len > count)
+		len = count;
+	if (len < 0)
+		len = 0;
+	return (len);
+}
+#endif
+
 static int __init init_sd(void)
 {
+#ifdef CONFIG_PROC_FS
+	struct proc_dir_entry *hostno;
+
+	hostno = create_proc_read_entry ("scsi/scsi_sd", 0, NULL, scsi_proc_hostno, NULL);
+	if (!hostno) {
+		printk (KERN_ERR "cannot init /proc/scsi/scsi_sd\n");
+		return -ENOMEM;
+	}
+#endif
 	sd_template.module = THIS_MODULE;
 	return scsi_register_module(MODULE_SCSI_DEV, &sd_template);
 }
@@ -1457,6 +1494,9 @@
 	sd_template.dev_max = 0;
 	if (sd_gendisks != NULL)    /* kfree tests for 0, but leave explicit */
 		kfree(sd_gendisks);
+#ifdef CONFIG_PROC_FS
+	remove_proc_entry("scsi/scsi_sd", 0);
+#endif
 }
 
 module_init(init_sd);

[-- Attachment #2: Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-07-11 11:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-04 10:29 [d-kernel] новая версия патча для sd Anton Farygin
2003-07-11 11:37   ` [d-kernel] " Sergey Vlasov
2003-07-11 11:05     ` [d-kernel] Re: ÎÏ×ÁÑ ×ÅÒÓÉÑ ÐÁÔÞÁ ÄÌÑ sd Ed V. Bartosh

ALT Linux kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git