From: Anton Farygin <rider@altlinux.com> To: ALT Linux kernel packages development <devel-kernel@altlinux.ru> Subject: [d-kernel] новая версия патча для sd Date: Fri, 04 Jul 2003 14:29:25 +0400 Message-ID: <3F055705.9040106@altlinux.com> (raw) [-- 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 --]
next reply other threads:[~2003-07-04 10:29 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-07-04 10:29 Anton Farygin [this message] 2003-07-11 11:37 ` [d-kernel] " Sergey Vlasov 2003-07-11 11:05 ` [d-kernel] Re: ÎÏ×ÁÑ ×ÅÒÓÉÑ ÐÁÔÞÁ ÄÌÑ sd Ed V. Bartosh
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=3F055705.9040106@altlinux.com \ --to=rider@altlinux.com \ --cc=devel-kernel@altlinux.ru \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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