subr_disk.c (64880) | subr_disk.c (65374) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * |
9 * $FreeBSD: head/sys/kern/subr_disk.c 64880 2000-08-20 21:34:39Z phk $ | 9 * $FreeBSD: head/sys/kern/subr_disk.c 65374 2000-09-02 19:17:34Z phk $ |
10 * 11 */ 12 | 10 * 11 */ 12 |
13#include "opt_devfs.h" 14 | |
15#include <sys/param.h> 16#include <sys/systm.h> 17#include <sys/kernel.h> 18#include <sys/sysctl.h> 19#include <sys/bio.h> 20#include <sys/conf.h> 21#include <sys/disk.h> 22#include <sys/malloc.h> 23#include <sys/sysctl.h> 24#include <machine/md_var.h> | 13#include <sys/param.h> 14#include <sys/systm.h> 15#include <sys/kernel.h> 16#include <sys/sysctl.h> 17#include <sys/bio.h> 18#include <sys/conf.h> 19#include <sys/disk.h> 20#include <sys/malloc.h> 21#include <sys/sysctl.h> 22#include <machine/md_var.h> |
25 26#ifdef DEVFS 27#include <sys/eventhandler.h> 28#include <fs/devfs/devfs.h> | |
29#include <sys/ctype.h> | 23#include <sys/ctype.h> |
30#endif | |
31 32MALLOC_DEFINE(M_DISK, "disk", "disk data"); 33 34static d_strategy_t diskstrategy; 35static d_open_t diskopen; 36static d_close_t diskclose; 37static d_ioctl_t diskioctl; 38static d_psize_t diskpsize; 39 40static LIST_HEAD(, disk) disklist = LIST_HEAD_INITIALIZER(&disklist); 41 | 24 25MALLOC_DEFINE(M_DISK, "disk", "disk data"); 26 27static d_strategy_t diskstrategy; 28static d_open_t diskopen; 29static d_close_t diskclose; 30static d_ioctl_t diskioctl; 31static d_psize_t diskpsize; 32 33static LIST_HEAD(, disk) disklist = LIST_HEAD_INITIALIZER(&disklist); 34 |
42#ifdef DEVFS | |
43static void 44disk_clone(void *arg, char *name, int namelen, dev_t *dev) 45{ 46 struct disk *dp; 47 char const *d; 48 int i, u, s, p; 49 dev_t pdev; 50 --- 39 unchanged lines hidden (view full) --- 90 p = name[i] - 'a'; 91 } 92 93 *dev = make_dev(pdev->si_devsw, dkmakeminor(u, s, p), 94 UID_ROOT, GID_OPERATOR, 0640, name); 95 return; 96 } 97} | 35static void 36disk_clone(void *arg, char *name, int namelen, dev_t *dev) 37{ 38 struct disk *dp; 39 char const *d; 40 int i, u, s, p; 41 dev_t pdev; 42 --- 39 unchanged lines hidden (view full) --- 82 p = name[i] - 'a'; 83 } 84 85 *dev = make_dev(pdev->si_devsw, dkmakeminor(u, s, p), 86 UID_ROOT, GID_OPERATOR, 0640, name); 87 return; 88 } 89} |
98#endif | |
99 100static void 101inherit_raw(dev_t pdev, dev_t dev) 102{ 103 dev->si_disk = pdev->si_disk; 104 dev->si_drv1 = pdev->si_drv1; 105 dev->si_drv2 = pdev->si_drv2; 106 dev->si_iosize_max = pdev->si_iosize_max; --- 26 unchanged lines hidden (view full) --- 133 UID_ROOT, GID_OPERATOR, 0640, "%s%d", cdevsw->d_name, unit); 134 135 dev->si_disk = dp; 136 dp->d_dev = dev; 137 dp->d_dsflags = flags; 138 dp->d_devsw = cdevsw; 139 LIST_INSERT_HEAD(&disklist, dp, d_list); 140 if (!once) { | 90 91static void 92inherit_raw(dev_t pdev, dev_t dev) 93{ 94 dev->si_disk = pdev->si_disk; 95 dev->si_drv1 = pdev->si_drv1; 96 dev->si_drv2 = pdev->si_drv2; 97 dev->si_iosize_max = pdev->si_iosize_max; --- 26 unchanged lines hidden (view full) --- 124 UID_ROOT, GID_OPERATOR, 0640, "%s%d", cdevsw->d_name, unit); 125 126 dev->si_disk = dp; 127 dp->d_dev = dev; 128 dp->d_dsflags = flags; 129 dp->d_devsw = cdevsw; 130 LIST_INSERT_HEAD(&disklist, dp, d_list); 131 if (!once) { |
141#ifdef DEVFS 142 EVENTHANDLER_REGISTER(devfs_clone, disk_clone, 0, 1000); 143#endif | 132 EVENTHANDLER_REGISTER(dev_clone, disk_clone, 0, 1000); |
144 once++; 145 } 146 return (dev); 147} 148 149int 150disk_dumpcheck(dev_t dev, u_int *count, u_int *blkno, u_int *secsize) 151{ --- 220 unchanged lines hidden --- | 133 once++; 134 } 135 return (dev); 136} 137 138int 139disk_dumpcheck(dev_t dev, u_int *count, u_int *blkno, u_int *secsize) 140{ --- 220 unchanged lines hidden --- |