Deleted Added
full compact
null_subr.c (12594) null_subr.c (12595)
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)null_subr.c 8.4 (Berkeley) 1/21/94
37 *
1/*
2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software donated to Berkeley by
6 * Jan-Simon Pendry.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 21 unchanged lines hidden (view full) ---

30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)null_subr.c 8.4 (Berkeley) 1/21/94
37 *
38 * $Id: null_subr.c,v 1.3 1994/10/02 17:48:14 phk Exp $
38 * $Id: null_subr.c,v 1.4 1995/12/03 14:38:49 bde Exp $
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/time.h>
44#include <sys/types.h>
45#include <sys/vnode.h>
46#include <sys/mount.h>
47#include <sys/namei.h>
48#include <sys/malloc.h>
49#include <miscfs/nullfs/null.h>
50
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/time.h>
44#include <sys/types.h>
45#include <sys/vnode.h>
46#include <sys/mount.h>
47#include <sys/namei.h>
48#include <sys/malloc.h>
49#include <miscfs/nullfs/null.h>
50
51extern int nullfs_init __P((void));
52
51#define LOG2_SIZEVNODE 7 /* log2(sizeof struct vnode) */
52#define NNULLNODECACHE 16
53#define NULL_NHASH(vp) ((((u_long)vp)>>LOG2_SIZEVNODE) & (NNULLNODECACHE-1))
54
55/*
56 * Null layer cache:
57 * Each cache entry holds a reference to the lower vnode
58 * along with a pointer to the alias vnode. When an

--- 6 unchanged lines hidden (view full) ---

65 */
66struct null_node_cache {
67 struct null_node *ac_forw;
68 struct null_node *ac_back;
69};
70
71static struct null_node_cache null_node_cache[NNULLNODECACHE];
72
53#define LOG2_SIZEVNODE 7 /* log2(sizeof struct vnode) */
54#define NNULLNODECACHE 16
55#define NULL_NHASH(vp) ((((u_long)vp)>>LOG2_SIZEVNODE) & (NNULLNODECACHE-1))
56
57/*
58 * Null layer cache:
59 * Each cache entry holds a reference to the lower vnode
60 * along with a pointer to the alias vnode. When an

--- 6 unchanged lines hidden (view full) ---

67 */
68struct null_node_cache {
69 struct null_node *ac_forw;
70 struct null_node *ac_back;
71};
72
73static struct null_node_cache null_node_cache[NNULLNODECACHE];
74
75static int null_node_alloc __P((struct mount *mp, struct vnode *lowervp,
76 struct vnode **vpp));
77static struct vnode *
78 null_node_find __P((struct mount *mp, struct vnode *lowervp));
79static struct null_node_cache *
80 null_node_hash __P((struct vnode *lowervp));
81
73/*
74 * Initialise cache headers
75 */
76int
77nullfs_init()
78{
79 struct null_node_cache *ac;
80#ifdef NULLFS_DIAGNOSTIC

--- 219 unchanged lines hidden ---
82/*
83 * Initialise cache headers
84 */
85int
86nullfs_init()
87{
88 struct null_node_cache *ac;
89#ifdef NULLFS_DIAGNOSTIC

--- 219 unchanged lines hidden ---