svn commit: r271290 - in stable/8/sys: fs/devfs sys
John Baldwin
jhb at FreeBSD.org
Mon Sep 8 21:46:15 UTC 2014
Author: jhb
Date: Mon Sep 8 21:46:14 2014
New Revision: 271290
URL: http://svnweb.freebsd.org/changeset/base/271290
Log:
MFC 226041:
Export devfs inode number allocator for the kernel consumers.
Modified:
stable/8/sys/fs/devfs/devfs_devs.c
stable/8/sys/sys/conf.h
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/fs/ (props changed)
stable/8/sys/sys/ (props changed)
Modified: stable/8/sys/fs/devfs/devfs_devs.c
==============================================================================
--- stable/8/sys/fs/devfs/devfs_devs.c Mon Sep 8 21:10:51 2014 (r271289)
+++ stable/8/sys/fs/devfs/devfs_devs.c Mon Sep 8 21:46:14 2014 (r271290)
@@ -147,8 +147,7 @@ devfs_free(struct cdev *cdev)
cdp = cdev2priv(cdev);
if (cdev->si_cred != NULL)
crfree(cdev->si_cred);
- if (cdp->cdp_inode > 0)
- free_unr(devfs_inos, cdp->cdp_inode);
+ devfs_free_cdp_inode(cdp->cdp_inode);
if (cdp->cdp_maxdirent > 0)
free(cdp->cdp_dirents, M_DEVFS2);
free(cdp, M_CDEVP);
@@ -304,7 +303,7 @@ devfs_delete(struct devfs_mount *dm, str
mac_devfs_destroy(de);
#endif
if (de->de_inode > DEVFS_ROOTINO) {
- free_unr(devfs_inos, de->de_inode);
+ devfs_free_cdp_inode(de->de_inode);
de->de_inode = 0;
}
if (DEVFS_DE_DROP(de))
@@ -560,6 +559,21 @@ devfs_destroy(struct cdev *dev)
devfs_generation++;
}
+ino_t
+devfs_alloc_cdp_inode(void)
+{
+
+ return (alloc_unr(devfs_inos));
+}
+
+void
+devfs_free_cdp_inode(ino_t ino)
+{
+
+ if (ino > 0)
+ free_unr(devfs_inos, ino);
+}
+
static void
devfs_devs_init(void *junk __unused)
{
Modified: stable/8/sys/sys/conf.h
==============================================================================
--- stable/8/sys/sys/conf.h Mon Sep 8 21:10:51 2014 (r271289)
+++ stable/8/sys/sys/conf.h Mon Sep 8 21:46:14 2014 (r271290)
@@ -304,6 +304,9 @@ int devfs_set_cdevpriv(void *priv, cdevp
void devfs_clear_cdevpriv(void);
void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */
+ino_t devfs_alloc_cdp_inode(void);
+void devfs_free_cdp_inode(ino_t ino);
+
#define UID_ROOT 0
#define UID_BIN 3
#define UID_UUCP 66
More information about the svn-src-all
mailing list