Deleted Added
sdiff udiff text old ( 34901 ) new ( 34961 )
full compact
1/*
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)ffs_inode.c 8.13 (Berkeley) 4/21/95
34 * $Id: ffs_inode.c,v 1.39 1998/03/26 20:53:49 phk Exp $
35 */
36
37#include "opt_quota.h"
38
39#include <sys/param.h>
40#include <sys/systm.h>
41#include <sys/mount.h>
42#include <sys/proc.h>

--- 31 unchanged lines hidden (view full) ---

74 struct timeval *access;
75 struct timeval *modify;
76 int waitfor;
77{
78 register struct fs *fs;
79 struct buf *bp;
80 struct inode *ip;
81 int error;
82
83 ip = VTOI(vp);
84 if (vp->v_mount->mnt_flag & MNT_RDONLY) {
85 ip->i_flag &=
86 ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
87 return (0);
88 }
89 if (((ip->i_flag &
90 (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) == 0) &&
91 (waitfor != MNT_WAIT))
92 return (0);
93 /*
94 * XXX: Some callers make a copy too early (before the i/o has
95 * completed)...
96 */
97 if (ip->i_flag & IN_ACCESS)
98 ip->i_atime = access->tv_sec;
99 if (ip->i_flag & IN_UPDATE) {
100 ip->i_mtime = modify->tv_sec;
101 ip->i_modrev++;
102 }
103 if (ip->i_flag & IN_CHANGE)
104 ip->i_ctime = time_second;
105 ip->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE);
106 fs = ip->i_fs;
107 /*
108 * Ensure that uid and gid are correct. This is a temporary
109 * fix until fsck has been changed to do the update.
110 */
111 if (fs->fs_inodefmt < FS_44INODEFMT) { /* XXX */
112 ip->i_din.di_ouid = ip->i_uid; /* XXX */

--- 53 unchanged lines hidden (view full) ---

166 oip = VTOI(ovp);
167 if (oip->i_size == length)
168 return (0);
169 fs = oip->i_fs;
170 if (length < 0)
171 return (EINVAL);
172 if (length > fs->fs_maxfilesize)
173 return (EFBIG);
174 getmicrotime(&tv);
175 if (ovp->v_type == VLNK &&
176 (oip->i_size < ovp->v_mount->mnt_maxsymlinklen || oip->i_din.di_blocks == 0)) {
177#ifdef DIAGNOSTIC
178 if (length != 0)
179 panic("ffs_truncate: partial truncate of symlink");
180#endif
181 bzero((char *)&oip->i_shortlink, (u_int)oip->i_size);
182 oip->i_size = 0;

--- 357 unchanged lines hidden ---