# 2.11BSD#431 - /usr/src/sys/h/namei.h

##### Variables

    namecache         X
    nchsize           X
    nmidesc           X

##### Macros

    CREATE            X
    DELETE            X
    FOLLOW            X
    LOCKPARENT        X
    LOOKUP            X
    NCHNAMLEN         X
    NDINIT            X
    NOCACHE           X
    NOFOLLOW          X
    _NAMEI_           X

##### struct's

    namecache         X
    nameidata         X
    nchstats          X

       1: /*
       2:  * Copyright (c) 1986 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  *
       6:  *	@(#)namei.h	1.3 (2.11BSD) 1997/1/18
       7:  */
       8:
       9: #ifndef _NAMEI_
      10: #define _NAMEI_
      11:
      12: #ifdef KERNEL
      13: #include "uio.h"
      14: #else
      15: #include <sys/uio.h>
      16: #endif
      17:
      18: /*
      19:  * Encapsulation of namei parameters.
      20:  * One of these is located in the u. area to
      21:  * minimize space allocated on the kernel stack.
      22:  */
      23: struct nameidata {
      24:     caddr_t ni_dirp;        /* pathname pointer */
      25:     short   ni_nameiop;     /* see below */
      26:     short   ni_error;       /* error return if any */
      27:     off_t   ni_endoff;      /* end of useful stuff in directory */
      28:     struct  inode *ni_pdir;     /* inode of parent directory of dirp */
      29:     struct  inode *ni_ip;       /* inode of dirp */
      30:     enum    uio_seg ni_segflg;  /* segment flag */
      31:     off_t   ni_offset;      /* offset in directory */
      32:     u_short ni_count;       /* offset of open slot (off_t?) */
      33:     struct  direct ni_dent;     /* current directory entry */
      34: };
      35:
      36: /*
      37:  * namei operations and modifiers
      38:  */
      39: #define LOOKUP      0   /* perform name lookup only */
      40: #define CREATE      1   /* setup for file creation */
      41: #define DELETE      2   /* setup for file deletion */
      42: #define LOCKPARENT  0x10    /* see the top of namei */
      43: #define NOCACHE     0x20    /* name must not be left in cache */
      44: #define FOLLOW      0x40    /* follow symbolic links */
      45: #define NOFOLLOW    0x0 /* don't follow symbolic links (pseudo) */
      46:
      47: #define NDINIT(ndp,op,flags,segflg,namep) {\
      48:     (ndp)->ni_nameiop = op | flags; \
      49:     (ndp)->ni_segflg = segflg; \
      50:     (ndp)->ni_dirp = namep; \
      51:     }
      52:
      53: /*
      54:  * This structure describes the elements in the cache of recent
      55:  * names looked up by namei.
      56:  */
      57: struct  namecache {
      58:     struct  namecache *nc_forw; /* hash chain, MUST BE FIRST */
      59:     struct  namecache *nc_back; /* hash chain, MUST BE FIRST */
      60:     struct  namecache *nc_nxt;  /* LRU chain */
      61:     struct  namecache **nc_prev;    /* LRU chain */
      62:     struct  inode *nc_ip;       /* inode the name refers to */
      63:     ino_t   nc_ino;         /* ino of parent of name */
      64:     dev_t   nc_dev;         /* dev of parent of name */
      65:     dev_t   nc_idev;        /* dev of the name ref'd */
      66:     u_short nc_id;          /* referenced inode's id */
      67:     char    nc_nlen;        /* length of name */
      68: #define NCHNAMLEN   15  /* maximum name segment length we bother with */
      69:     char    nc_name[NCHNAMLEN]; /* segment name */
      70: };
      71: #if defined(KERNEL) && !defined(SUPERVISOR)
      72: struct  namecache *namecache;
      73: int nchsize;
      74: #include <machine/seg.h>
      75: segm    nmidesc;
      76: #endif
      77:
      78: /*
      79:  * Stats on usefulness of namei caches.
      80:  */
      81: struct  nchstats {
      82:     long    ncs_goodhits;       /* hits that we can reall use */
      83:     long    ncs_badhits;        /* hits we must drop */
      84:     long    ncs_falsehits;      /* hits with id mismatch */
      85:     long    ncs_miss;       /* misses */
      86:     long    ncs_long;       /* long names that ignore cache */
      87:     long    ncs_pass2;      /* names found with passes == 2 */
      88:     long    ncs_2passes;        /* number of times we attempt it */
      89: };
      90: #endif

#### Defined variables

namecache defined in line 72; used 5 times

- in /usr/src/sys/pdp/machdep2.c line 211
- in /usr/src/sys/sys/ufs_namei.c line 1220(2), 1288-1293(2)

nchsize defined in line 73; used 6 times

- in /usr/src/sys/pdp/machdep2.c line 204-207(4)
- in /usr/src/sys/sys/ufs_namei.c line 1220, 1288

nmidesc defined in line 75; used 18 times

- in /usr/src/sys/pdp/machdep2.c line 208-210(2)
- in /usr/src/sys/sys/ufs_namei.c line 249(2), 305-310(4), 322(2), 734(2), 1217(2), 1251(2), 1292(2)

#### Defined struct's

namecache defined in line 57; used 34 times

- in line 58-61(8), 72(2)
- in /usr/src/sys/conf/checksys.c line 232(2)
- in /usr/src/sys/pdp/machdep2.c line 204-211(6)
- in /usr/src/sys/sys/ufs_namei.c line 36-41(4), 118(2), 255(2), 264(2), 1213(2), 1247(2), 1288(2)

nameidata defined in line 23; used 116 times

- in /usr/src/sys/sys/init_main.c line 348-349(4)
- in /usr/src/sys/sys/kern_exec.c line 63-64(4)
- in /usr/src/sys/sys/kern_sig.c line 621-622(4)
- in /usr/src/sys/sys/quota_kern.c line 702-703(4)
- in /usr/src/sys/sys/sys_kern.c line 103-104(4), 135-136(4)
- in /usr/src/sys/sys/ufs_mount.c line 38-39(4), 328-329(4)
- in /usr/src/sys/sys/ufs_namei.c line 113(2), 891(2), 1010(2), 1047(2)
- in /usr/src/sys/sys/ufs_syscalls.c line 79-80(4), 128-129(4), 202-203(4), 247-248(4), 303-304(4), 345-346(4), 392-393(4), 442-443(4), 465-466(4), 494-495(4), 544-545(4), 614-615(4), 717-718(4), 797-798(4), 1087(2), 1158-1159(4), 1270-1271(4)
- in /usr/src/sys/sys/ufs_syscalls2.c line 27-28(4), 268-269(4)
- in /usr/src/sys/sys/vfs_vnops.c line 66(2)

nchstats defined in line 81; used 6 times

- in /usr/src/sys/sys/ufs_namei.c line 42(2)
- in /usr/src/ucb/PORT/systat/vmstat.c line 110(2)
- in /usr/src/ucb/vmstat.c line 506(2)

#### Defined macros

CREATE defined in line 40; used 12 times

- in /usr/src/sys/sys/kern_sig.c line 646
- in /usr/src/sys/sys/sys_kern.c line 107
- in /usr/src/sys/sys/ufs_namei.c line 366, 505, 668
- in /usr/src/sys/sys/ufs_syscalls.c line 207, 267, 316, 859, 1164
- in /usr/src/sys/sys/vfs_vnops.c line 75-77(2)

DELETE defined in line 41; used 7 times

- in /usr/src/sys/sys/ufs_namei.c line 151, 210, 589
- in /usr/src/sys/sys/ufs_syscalls.c line 348, 801, 1002, 1273

FOLLOW defined in line 44; used 23 times

- in /usr/src/sys/sys/init_main.c line 352
- in /usr/src/sys/sys/kern_exec.c line 67, 177
- in /usr/src/sys/sys/kern_sig.c line 646
- in /usr/src/sys/sys/quota_kern.c line 709
- in /usr/src/sys/sys/sys_kern.c line 107, 141
- in /usr/src/sys/sys/ufs_mount.c line 47, 333
- in /usr/src/sys/sys/ufs_namei.c line 150, 770
- in /usr/src/sys/sys/ufs_syscalls.c line 82, 141, 250, 399, 421, 497, 547, 721
- in /usr/src/sys/sys/ufs_syscalls2.c line 31, 279
- in /usr/src/sys/sys/vfs_vnops.c line 75, 100

LOCKPARENT defined in line 42; used 7 times

- in /usr/src/sys/sys/ufs_namei.c line 148-150(2)
- in /usr/src/sys/sys/ufs_syscalls.c line 348, 801, 859, 1002, 1273

LOOKUP defined in line 39; used 24 times

- in /usr/src/sys/sys/init_main.c line 352
- in /usr/src/sys/sys/kern_exec.c line 67, 177
- in /usr/src/sys/sys/quota_kern.c line 709
- in /usr/src/sys/sys/sys_kern.c line 141
- in /usr/src/sys/sys/ufs_mount.c line 47, 333
- in /usr/src/sys/sys/ufs_namei.c line 231, 381, 567
- in /usr/src/sys/sys/ufs_syscalls.c line 82, 141, 250, 399, 445, 469, 497, 547, 618, 721, 1239
- in /usr/src/sys/sys/ufs_syscalls2.c line 31, 279
- in /usr/src/sys/sys/vfs_vnops.c line 100

NCHNAMLEN defined in line 68; used 2 times

- in line 69
- in /usr/src/sys/sys/ufs_namei.c line 250

NDINIT defined in line 47; used 28 times

- in /usr/src/sys/sys/init_main.c line 352
- in /usr/src/sys/sys/kern_exec.c line 67
- in /usr/src/sys/sys/kern_sig.c line 646
- in /usr/src/sys/sys/quota_kern.c line 709
- in /usr/src/sys/sys/sys_kern.c line 107, 141
- in /usr/src/sys/sys/ufs_mount.c line 47, 333
- in /usr/src/sys/sys/ufs_syscalls.c line 82, 141, 207, 250, 316, 348, 399, 445, 469, 497, 547, 618, 721, 801, 1002, 1164, 1239, 1273
- in /usr/src/sys/sys/ufs_syscalls2.c line 31, 279

NOCACHE defined in line 43; used 5 times

- in /usr/src/sys/sys/ufs_namei.c line 149-150(3)
- in /usr/src/sys/sys/ufs_syscalls.c line 859, 1239

NOFOLLOW defined in line 45; used 6 times

- in /usr/src/sys/sys/ufs_syscalls.c line 207, 316, 430, 469, 618, 1164

_NAMEI_ defined in line 10; used 1 times

- in line 9

#### Usage of this include

namei.h used 16 times

- in /usr/src/sys/conf/checksys.c line 21
- in /usr/src/sys/pdp/machdep2.c line 29
- in /usr/src/sys/sys/init_main.c line 28
- in /usr/src/sys/sys/kern_exec.c line 20
- in /usr/src/sys/sys/kern_sig.c line 16
- in /usr/src/sys/sys/kern_sig2.c line 54
- in /usr/src/sys/sys/quota_kern.c line 34
- in /usr/src/sys/sys/sys_kern.c line 17
- in /usr/src/sys/sys/ufs_fio.c line 14
- in /usr/src/sys/sys/ufs_mount.c line 19
- in /usr/src/sys/sys/ufs_namei.c line 18
- in /usr/src/sys/sys/ufs_syscalls.c line 13
- in /usr/src/sys/sys/ufs_syscalls2.c line 15
- in /usr/src/sys/sys/vfs_vnops.c line 44
- in /usr/src/ucb/PORT/systat/vmstat.c line 26
- in /usr/src/ucb/vmstat.c line 26

Last modified: 1997-01-19 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 742 |