Deleted Added
full compact
devfs_rule.c (124804) devfs_rule.c (125855)
1/*-
2 * Copyright (c) 2002 Dima Dorfman.
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 *
1/*-
2 * Copyright (c) 2002 Dima Dorfman.
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
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 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 124804 2004-01-21 18:03:54Z cperciva $
26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 125855 2004-02-15 21:43:08Z phk $
27 */
28
29/*
30 * DEVFS ruleset implementation.
31 *
32 * A note on terminology: To "run" a rule on a dirent is to take the
33 * prescribed action; to "apply" a rule is to check whether it matches
34 * a dirent and run if if it does.

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

141 ds = devfs_ruleset_bynum(dm->dm_ruleset);
142 KASSERT(ds != NULL, ("mount-point has NULL ruleset"));
143 devfs_ruleset_applyde(ds, de);
144}
145
146/*
147 * Rule subsystem SYSINIT hook.
148 */
27 */
28
29/*
30 * DEVFS ruleset implementation.
31 *
32 * A note on terminology: To "run" a rule on a dirent is to take the
33 * prescribed action; to "apply" a rule is to check whether it matches
34 * a dirent and run if if it does.

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

141 ds = devfs_ruleset_bynum(dm->dm_ruleset);
142 KASSERT(ds != NULL, ("mount-point has NULL ruleset"));
143 devfs_ruleset_applyde(ds, de);
144}
145
146/*
147 * Rule subsystem SYSINIT hook.
148 */
149void
150devfs_rules_init(void)
149static void
150devfs_rules_init(void *junk __unused)
151{
152 struct devfs_ruleset *ds;
153
154 SLIST_INIT(&devfs_rulesets);
155
156 ds = devfs_ruleset_create(0);
157 ds->ds_flags |= DS_IMMUTABLE;
158 ds->ds_refcount = 1; /* Prevent reaping. */
159}
160
151{
152 struct devfs_ruleset *ds;
153
154 SLIST_INIT(&devfs_rulesets);
155
156 ds = devfs_ruleset_create(0);
157 ds->ds_flags |= DS_IMMUTABLE;
158 ds->ds_refcount = 1; /* Prevent reaping. */
159}
160
161SYSINIT(devfs_rules, SI_SUB_DEVFS, SI_ORDER_FIRST, devfs_rules_init, NULL);
162
161/*
162 * Rule subsystem ioctl hook.
163 */
164int
165devfs_rules_ioctl(struct mount *mp, u_long cmd, caddr_t data, struct thread *td)
166{
167 struct devfs_mount *dm = VFSTODEVFS(mp);
168 struct devfs_ruleset *ds;

--- 663 unchanged lines hidden ---
163/*
164 * Rule subsystem ioctl hook.
165 */
166int
167devfs_rules_ioctl(struct mount *mp, u_long cmd, caddr_t data, struct thread *td)
168{
169 struct devfs_mount *dm = VFSTODEVFS(mp);
170 struct devfs_ruleset *ds;

--- 663 unchanged lines hidden ---