Author: ed
Date: Fri Feb 10 12:40:50 2012
New Revision: 231379
URL: http://svn.freebsd.org/changeset/base/231379

Log:
  Merge si_name and __si_namebuf.
  
  The si_name pointer always points to the __si_namebuf member inside the
  same object. Remove it and rename __si_namebuf to si_name.

Modified:
  head/sys/fs/devfs/devfs_devs.c
  head/sys/kern/kern_conf.c
  head/sys/sys/conf.h

Modified: head/sys/fs/devfs/devfs_devs.c
==============================================================================
--- head/sys/fs/devfs/devfs_devs.c      Fri Feb 10 12:35:57 2012        
(r231378)
+++ head/sys/fs/devfs/devfs_devs.c      Fri Feb 10 12:40:50 2012        
(r231379)
@@ -133,7 +133,6 @@ devfs_alloc(int flags)
 
        cdev = &cdp->cdp_c;
 
-       cdev->si_name = cdev->__si_namebuf;
        LIST_INIT(&cdev->si_children);
        vfs_timestamp(&ts);
        cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts;

Modified: head/sys/kern/kern_conf.c
==============================================================================
--- head/sys/kern/kern_conf.c   Fri Feb 10 12:35:57 2012        (r231378)
+++ head/sys/kern/kern_conf.c   Fri Feb 10 12:40:50 2012        (r231379)
@@ -690,16 +690,16 @@ prep_devname(struct cdev *dev, const cha
 
        mtx_assert(&devmtx, MA_OWNED);
 
-       len = vsnrprintf(dev->__si_namebuf, sizeof(dev->__si_namebuf), 32,
+       len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32,
            fmt, ap);
-       if (len > sizeof(dev->__si_namebuf) - 1)
+       if (len > sizeof(dev->si_name) - 1)
                return (ENAMETOOLONG);
 
        /* Strip leading slashes. */
-       for (from = dev->__si_namebuf; *from == '/'; from++)
+       for (from = dev->si_name; *from == '/'; from++)
                ;
 
-       for (to = dev->__si_namebuf; *from != '\0'; from++, to++) {
+       for (to = dev->si_name; *from != '\0'; from++, to++) {
                /* Treat multiple sequential slashes as single. */
                while (from[0] == '/' && from[1] == '/')
                        from++;
@@ -710,11 +710,11 @@ prep_devname(struct cdev *dev, const cha
        }
        *to = '\0';
 
-       if (dev->__si_namebuf[0] == '\0')
+       if (dev->si_name[0] == '\0')
                return (EINVAL);
 
        /* Disallow "." and ".." components. */
-       for (s = dev->__si_namebuf;;) {
+       for (s = dev->si_name;;) {
                for (q = s; *q != '/' && *q != '\0'; q++)
                        ;
                if (q - s == 1 && s[0] == '.')
@@ -726,7 +726,7 @@ prep_devname(struct cdev *dev, const cha
                s = q + 1;
        }
 
-       if (devfs_dev_exists(dev->__si_namebuf) != 0)
+       if (devfs_dev_exists(dev->si_name) != 0)
                return (EEXIST);
 
        return (0);

Modified: head/sys/sys/conf.h
==============================================================================
--- head/sys/sys/conf.h Fri Feb 10 12:35:57 2012        (r231378)
+++ head/sys/sys/conf.h Fri Feb 10 12:40:50 2012        (r231379)
@@ -78,7 +78,7 @@ struct cdev {
        LIST_HEAD(, cdev)       si_children;
        LIST_ENTRY(cdev)        si_siblings;
        struct cdev *si_parent;
-       char            *si_name;
+       void            *si_spare0;
        void            *si_drv1, *si_drv2;
        struct cdevsw   *si_devsw;
        int             si_iosize_max;  /* maximum I/O size (for physio &al) */
@@ -87,7 +87,7 @@ struct cdev {
        union {
                struct snapdata *__sid_snapdata;
        } __si_u;
-       char            __si_namebuf[SPECNAMELEN + 1];
+       char            si_name[SPECNAMELEN + 1];
 };
 
 #define        si_snapdata     __si_u.__sid_snapdata
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to