[BACK]Return to tmpfs_vnops.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / fs / tmpfs

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

Diff for /src/sys/fs/tmpfs/tmpfs_vnops.c between version 1.49 and 1.49.6.2

version 1.49, 2008/02/06 11:22:12 version 1.49.6.2, 2008/06/29 09:33:13
Line 16 
Line 16 
  * 2. Redistributions in binary form must reproduce the above copyright   * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the   *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.   *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software  
  *    must display the following acknowledgement:  
  *        This product includes software developed by the NetBSD  
  *        Foundation, Inc. and its contributors.  
  * 4. Neither the name of The NetBSD Foundation nor the names of its  
  *    contributors may be used to endorse or promote products derived  
  *    from this software without specific prior written permission.  
  *   *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS   * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
Line 334  tmpfs_close(void *v)
Line 327  tmpfs_close(void *v)
         if (node->tn_links > 0) {          if (node->tn_links > 0) {
                 /* Update node times.  No need to do it if the node has                  /* Update node times.  No need to do it if the node has
                  * been deleted, because it will vanish after we return. */                   * been deleted, because it will vanish after we return. */
                 tmpfs_update(vp, NULL, NULL, UPDATE_CLOSE);                  tmpfs_update(vp, NULL, NULL, NULL, UPDATE_CLOSE);
         }          }
   
         return 0;          return 0;
Line 410  tmpfs_getattr(void *v)
Line 403  tmpfs_getattr(void *v)
   
         VATTR_NULL(vap);          VATTR_NULL(vap);
   
         tmpfs_itimes(vp, NULL, NULL);          tmpfs_itimes(vp, NULL, NULL, NULL);
   
         vap->va_type = vp->v_type;          vap->va_type = vp->v_type;
         vap->va_mode = node->tn_mode;          vap->va_mode = node->tn_mode;
Line 439  tmpfs_getattr(void *v)
Line 432  tmpfs_getattr(void *v)
   
 /* --------------------------------------------------------------------- */  /* --------------------------------------------------------------------- */
   
   #define GOODTIME(tv)    ((tv)->tv_sec != VNOVAL || (tv)->tv_nsec != VNOVAL)
 /* XXX Should this operation be atomic?  I think it should, but code in  /* XXX Should this operation be atomic?  I think it should, but code in
  * XXX other places (e.g., ufs) doesn't seem to be... */   * XXX other places (e.g., ufs) doesn't seem to be... */
 int  int
Line 461  tmpfs_setattr(void *v)
Line 455  tmpfs_setattr(void *v)
             vap->va_fsid != VNOVAL ||              vap->va_fsid != VNOVAL ||
             vap->va_fileid != VNOVAL ||              vap->va_fileid != VNOVAL ||
             vap->va_blocksize != VNOVAL ||              vap->va_blocksize != VNOVAL ||
             vap->va_ctime.tv_sec != VNOVAL ||              GOODTIME(&vap->va_ctime) ||
             vap->va_ctime.tv_nsec != VNOVAL ||  
             vap->va_birthtime.tv_sec != VNOVAL ||  
             vap->va_birthtime.tv_nsec != VNOVAL ||  
             vap->va_gen != VNOVAL ||              vap->va_gen != VNOVAL ||
             vap->va_rdev != VNOVAL ||              vap->va_rdev != VNOVAL ||
             vap->va_bytes != VNOVAL)              vap->va_bytes != VNOVAL)
Line 482  tmpfs_setattr(void *v)
Line 473  tmpfs_setattr(void *v)
         if (error == 0 && (vap->va_mode != VNOVAL))          if (error == 0 && (vap->va_mode != VNOVAL))
                 error = tmpfs_chmod(vp, vap->va_mode, cred, l);                  error = tmpfs_chmod(vp, vap->va_mode, cred, l);
   
         if (error == 0 && ((vap->va_atime.tv_sec != VNOVAL &&          if (error == 0 && (GOODTIME(&vap->va_atime) || GOODTIME(&vap->va_mtime)
             vap->va_atime.tv_nsec != VNOVAL) ||              || GOODTIME(&vap->va_birthtime)))
             (vap->va_mtime.tv_sec != VNOVAL &&                  if ((error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime,
             vap->va_mtime.tv_nsec != VNOVAL)))                      &vap->va_birthtime, vap->va_vaflags, cred, l)) == 0)
                 error = tmpfs_chtimes(vp, &vap->va_atime, &vap->va_mtime,                          return 0;
                     vap->va_vaflags, cred, l);  
   
         /* Update the node times.  We give preference to the error codes          /* Update the node times.  We give preference to the error codes
          * generated by this function rather than the ones that may arise           * generated by this function rather than the ones that may arise
          * from tmpfs_update. */           * from tmpfs_update. */
         tmpfs_update(vp, NULL, NULL, 0);          tmpfs_update(vp, NULL, NULL, NULL, 0);
   
         KASSERT(VOP_ISLOCKED(vp));          KASSERT(VOP_ISLOCKED(vp));
   
Line 637  tmpfs_fsync(void *v)
Line 627  tmpfs_fsync(void *v)
   
         KASSERT(VOP_ISLOCKED(vp));          KASSERT(VOP_ISLOCKED(vp));
   
         tmpfs_update(vp, NULL, NULL, 0);          tmpfs_update(vp, NULL, NULL, NULL, 0);
   
         return 0;          return 0;
 }  }
Line 768  tmpfs_link(void *v)
Line 758  tmpfs_link(void *v)
   
         /* vp link count has changed, so update node times. */          /* vp link count has changed, so update node times. */
         node->tn_status |= TMPFS_NODE_CHANGED;          node->tn_status |= TMPFS_NODE_CHANGED;
         tmpfs_update(vp, NULL, NULL, 0);          tmpfs_update(vp, NULL, NULL, NULL, 0);
   
         error = 0;          error = 0;
   

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

CVSweb <webmaster@jp.NetBSD.org>