devfs_rule.c (210923) | devfs_rule.c (216391) |
---|---|
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 210923 2010-08-06 09:42:15Z kib $ | 26 * $FreeBSD: head/sys/fs/devfs/devfs_rule.c 216391 2010-12-12 08:52:13Z jh $ |
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. --- 702 unchanged lines hidden (view full) --- 737 struct devfs_ruleset *cds, *ds; 738 739 if (dm->dm_ruleset != 0) { 740 cds = devfs_ruleset_bynum(dm->dm_ruleset); 741 --cds->ds_refcount; 742 devfs_ruleset_reap(cds); 743 } 744 | 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. --- 702 unchanged lines hidden (view full) --- 737 struct devfs_ruleset *cds, *ds; 738 739 if (dm->dm_ruleset != 0) { 740 cds = devfs_ruleset_bynum(dm->dm_ruleset); 741 --cds->ds_refcount; 742 devfs_ruleset_reap(cds); 743 } 744 |
745 if (rsnum == 0) { 746 dm->dm_ruleset = 0; 747 return (0); 748 } 749 |
|
745 ds = devfs_ruleset_bynum(rsnum); 746 if (ds == NULL) 747 ds = devfs_ruleset_create(rsnum); 748 /* These should probably be made atomic somehow. */ 749 ++ds->ds_refcount; 750 dm->dm_ruleset = rsnum; 751 752 return (0); --- 14 unchanged lines hidden --- | 750 ds = devfs_ruleset_bynum(rsnum); 751 if (ds == NULL) 752 ds = devfs_ruleset_create(rsnum); 753 /* These should probably be made atomic somehow. */ 754 ++ds->ds_refcount; 755 dm->dm_ruleset = rsnum; 756 757 return (0); --- 14 unchanged lines hidden --- |