devfs_devs.c (65132) | devfs_devs.c (65374) |
---|---|
1#define DEBUG 1 2/* 3 * Copyright (c) 2000 4 * Poul-Henning Kamp. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vfsops.c 1.36 28 * | 1#define DEBUG 1 2/* 3 * Copyright (c) 2000 4 * Poul-Henning Kamp. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * 27 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vfsops.c 1.36 28 * |
29 * $FreeBSD: head/sys/fs/devfs/devfs_devs.c 65132 2000-08-27 14:46:36Z phk $ | 29 * $FreeBSD: head/sys/fs/devfs/devfs_devs.c 65374 2000-09-02 19:17:34Z phk $ |
30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/dirent.h> 35#include <sys/conf.h> 36#include <sys/vnode.h> 37#include <sys/malloc.h> --- 195 unchanged lines hidden (view full) --- 233 printf("NDEVINO too small\n"); 234 return; 235 } 236 devfs_inot[dev->si_inode] = dev; 237 devfs_generation++; 238} 239 240static void | 30 */ 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/dirent.h> 35#include <sys/conf.h> 36#include <sys/vnode.h> 37#include <sys/malloc.h> --- 195 unchanged lines hidden (view full) --- 233 printf("NDEVINO too small\n"); 234 return; 235 } 236 devfs_inot[dev->si_inode] = dev; 237 devfs_generation++; 238} 239 240static void |
241devfs_remove(dev_t dev) | 241devfs_destroy(dev_t dev) |
242{ 243 devfs_inot[dev->si_inode] = NULL; 244 devfs_generation++; 245} 246 247devfs_create_t *devfs_create_hook = devfs_create; | 242{ 243 devfs_inot[dev->si_inode] = NULL; 244 devfs_generation++; 245} 246 247devfs_create_t *devfs_create_hook = devfs_create; |
248devfs_remove_t *devfs_remove_hook = devfs_remove; 249 250int 251devfs_stdclone(char *name, char **namep, char *stem, int *unit) 252{ 253 int u, i; 254 255 if (bcmp(stem, name, strlen(stem)) != 0) 256 return (0); 257 i = strlen(stem); 258 if (!isdigit(name[i])) 259 return (0); 260 u = 0; 261 while (isdigit(name[i])) { 262 u *= 10; 263 u += name[i++] - '0'; 264 } 265 *unit = u; 266 if (namep) 267 *namep = &name[i]; 268 if (name[i]) 269 return (2); 270 return (1); 271} | 248devfs_destroy_t *devfs_destroy_hook = devfs_destroy; 249int devfs_present = 1; |