diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2008-03-24 13:12:43 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2008-03-24 13:12:43 +0000 |
| commit | ecd6b4c11d5da4f8ef9e1251e31efacd9ce891c0 (patch) | |
| tree | 0dd5f99e42b71decb56bcd75ec94bf0c7de8291c /sys/fs/devfs | |
| parent | 751270bf6e94fcbd6d5054af97a165a8698579e1 (diff) | |
Notes
Diffstat (limited to 'sys/fs/devfs')
| -rw-r--r-- | sys/fs/devfs/devfs_rule.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/fs/devfs/devfs_rule.c b/sys/fs/devfs/devfs_rule.c index f6aef0370bfd..bb7ebd1200ce 100644 --- a/sys/fs/devfs/devfs_rule.c +++ b/sys/fs/devfs/devfs_rule.c @@ -527,6 +527,7 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) { struct devfs_rule *dr = &dk->dk_rule; struct cdev *dev; + struct cdevsw *dsw; dev = devfs_rule_getdev(de); /* @@ -540,13 +541,19 @@ devfs_rule_match(struct devfs_krule *dk, struct devfs_dirent *de) * They're actually testing to see whether the condition does * *not* match, since the default is to assume the rule should * be run (such as if there are no conditions). - * - * XXX: lacks threadref on dev */ - if (dr->dr_icond & DRC_DSWFLAGS) - if (dev == NULL || - (dev->si_devsw->d_flags & dr->dr_dswflags) == 0) + if (dr->dr_icond & DRC_DSWFLAGS) { + if (dev == NULL) + return (0); + dsw = dev_refthread(dev); + if (dsw == NULL) + return (0); + if ((dsw->d_flags & dr->dr_dswflags) == 0) { + dev_relthread(dev); return (0); + } + dev_relthread(dev); + } if (dr->dr_icond & DRC_PATHPTRN) if (!devfs_rule_matchpath(dk, de)) return (0); |
