[BACK]Return to kernfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / miscfs / kernfs

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/miscfs/kernfs/kernfs_vnops.c between version 1.49 and 1.52

version 1.49, 1997/05/08 16:20:17 version 1.52, 1997/09/19 19:14:20
Line 69 
Line 69 
 #define WRITE_MODE      (S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH)  #define WRITE_MODE      (S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH)
 #define DIR_MODE        (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)  #define DIR_MODE        (S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
   
 struct kern_target {  struct kern_target kern_targets[] = {
         u_char kt_type;  
         u_char kt_namlen;  
         char *kt_name;  
         void *kt_data;  
 #define KTT_NULL         1  
 #define KTT_TIME         5  
 #define KTT_INT         17  
 #define KTT_STRING      31  
 #define KTT_HOSTNAME    47  
 #define KTT_AVENRUN     53  
 #define KTT_DEVICE      71  
 #define KTT_MSGBUF      89  
         u_char kt_tag;  
         u_char kt_vtype;  
         mode_t kt_mode;  
 } kern_targets[] = {  
 /* NOTE: The name must be less than UIO_MX-16 chars in length */  /* NOTE: The name must be less than UIO_MX-16 chars in length */
 #define N(s) sizeof(s)-1, s  #define N(s) sizeof(s)-1, s
      /*        name            data          tag           type  ro/rw */       /*        name            data          tag           type  ro/rw */
Line 234  kernfs_xread(kt, off, bufp, len)
Line 218  kernfs_xread(kt, off, bufp, len)
         }          }
   
         case KTT_MSGBUF: {          case KTT_MSGBUF: {
                 extern struct msgbuf *msgbufp;  
                 long n;                  long n;
   
                 if (off >= MSG_BSIZE)                  /*
                    * deal with cases where the message buffer has
                    * become corrupted.
                    */
                   if (!msgbufenabled || msgbufp->msg_magic != MSG_MAGIC) {
                           msgbufenabled = 0;
                           return (ENXIO);
                   }
   
                   /*
                    * Note that reads of /kern/msgbuf won't necessarily yield
                    * consistent results, if the message buffer is modified
                    * while the read is in progress.  The worst that can happen
                    * is that incorrect data will be read.  There's no way
                    * that this can crash the system unless the values in the
                    * message buffer header are corrupted, but that'll cause
                    * the system to die anyway.
                    */
                   if (off >= msgbufp->msg_bufs)
                         return (0);                          return (0);
                 n = msgbufp->msg_bufx + off;                  n = msgbufp->msg_bufx + off;
                 if (n >= MSG_BSIZE)                  if (n >= msgbufp->msg_bufs)
                         n -= MSG_BSIZE;                          n -= msgbufp->msg_bufs;
                 len = min(MSG_BSIZE - n, MSG_BSIZE - off);                  len = min(msgbufp->msg_bufs - n, msgbufp->msg_bufs - off);
                 *bufp = msgbufp->msg_bufc + n;                  *bufp = msgbufp->msg_bufc + n;
                 return (len);                  return (len);
         }          }
Line 322  kernfs_lookup(v)
Line 323  kernfs_lookup(v)
         int error, i;          int error, i;
   
 #ifdef KERNFS_DIAGNOSTIC  #ifdef KERNFS_DIAGNOSTIC
         printf("kernfs_lookup(%x)\n", ap);          printf("kernfs_lookup(%p)\n", ap);
         printf("kernfs_lookup(dp = %x, vpp = %x, cnp = %x)\n", dvp, vpp, ap->a_cnp);          printf("kernfs_lookup(dp = %p, vpp = %p, cnp = %p)\n", dvp, vpp, ap->a_cnp);
         printf("kernfs_lookup(%s)\n", pname);          printf("kernfs_lookup(%s)\n", pname);
 #endif  #endif
   
Line 386  found:
Line 387  found:
         *vpp = fvp;          *vpp = fvp;
   
 #ifdef KERNFS_DIAGNOSTIC  #ifdef KERNFS_DIAGNOSTIC
         printf("kernfs_lookup: newvp = %x\n", fvp);          printf("kernfs_lookup: newvp = %p\n", fvp);
 #endif  #endif
         return (0);          return (0);
 }  }
Line 641  kernfs_inactive(v)
Line 642  kernfs_inactive(v)
         struct vnode *vp = ap->a_vp;          struct vnode *vp = ap->a_vp;
   
 #ifdef KERNFS_DIAGNOSTIC  #ifdef KERNFS_DIAGNOSTIC
         printf("kernfs_inactive(%x)\n", vp);          printf("kernfs_inactive(%p)\n", vp);
 #endif  #endif
         /*          /*
          * Clear out the v_type field to avoid           * Clear out the v_type field to avoid
Line 661  kernfs_reclaim(v)
Line 662  kernfs_reclaim(v)
         struct vnode *vp = ap->a_vp;          struct vnode *vp = ap->a_vp;
   
 #ifdef KERNFS_DIAGNOSTIC  #ifdef KERNFS_DIAGNOSTIC
         printf("kernfs_reclaim(%x)\n", vp);          printf("kernfs_reclaim(%p)\n", vp);
 #endif  #endif
         if (vp->v_data) {          if (vp->v_data) {
                 FREE(vp->v_data, M_TEMP);                  FREE(vp->v_data, M_TEMP);

Legend:
Removed from v.1.49  
changed lines
  Added in v.1.52

CVSweb <webmaster@jp.NetBSD.org>