devfs_devs.c (207729) | devfs_devs.c (208951) |
---|---|
1/*- 2 * Copyright (c) 2000,2004 3 * Poul-Henning Kamp. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vfsops.c 1.36 27 * | 1/*- 2 * Copyright (c) 2000,2004 3 * Poul-Henning Kamp. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * From: FreeBSD: src/sys/miscfs/kernfs/kernfs_vfsops.c 1.36 27 * |
28 * $FreeBSD: head/sys/fs/devfs/devfs_devs.c 207729 2010-05-06 19:22:50Z kib $ | 28 * $FreeBSD: head/sys/fs/devfs/devfs_devs.c 208951 2010-06-09 15:29:12Z jh $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/conf.h> 34#include <sys/dirent.h> 35#include <sys/kernel.h> 36#include <sys/limits.h> --- 156 unchanged lines hidden (view full) --- 193 de->de_holdcnt = 1; 194#ifdef MAC 195 mac_devfs_init(de); 196#endif 197 return (de); 198} 199 200struct devfs_dirent * | 29 */ 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/conf.h> 34#include <sys/dirent.h> 35#include <sys/kernel.h> 36#include <sys/limits.h> --- 156 unchanged lines hidden (view full) --- 193 de->de_holdcnt = 1; 194#ifdef MAC 195 mac_devfs_init(de); 196#endif 197 return (de); 198} 199 200struct devfs_dirent * |
201devfs_parent_dirent(struct devfs_dirent *de) 202{ 203 204 if (de->de_dirent->d_type != DT_DIR) 205 return (de->de_dir); 206 207 if (de->de_flags & (DE_DOT | DE_DOTDOT)) 208 return (NULL); 209 210 de = TAILQ_FIRST(&de->de_dlist); /* "." */ 211 if (de == NULL) 212 return (NULL); 213 de = TAILQ_NEXT(de, de_list); /* ".." */ 214 if (de == NULL) 215 return (NULL); 216 217 return (de->de_dir); 218} 219 220struct devfs_dirent * |
|
201devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) 202{ 203 struct devfs_dirent *dd; 204 struct devfs_dirent *de; 205 206 /* Create the new directory */ 207 dd = devfs_newdirent(name, namelen); 208 TAILQ_INIT(&dd->de_dlist); --- 341 unchanged lines hidden --- | 221devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode) 222{ 223 struct devfs_dirent *dd; 224 struct devfs_dirent *de; 225 226 /* Create the new directory */ 227 dd = devfs_newdirent(name, namelen); 228 TAILQ_INIT(&dd->de_dlist); --- 341 unchanged lines hidden --- |