projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
i_socket is i_un.is_socket; i_un was missing
[unix-history]
/
usr
/
src
/
sys
/
ufs
/
ffs
/
ufs_vnops.c
diff --git
a/usr/src/sys/ufs/ffs/ufs_vnops.c
b/usr/src/sys/ufs/ffs/ufs_vnops.c
index
5c24982
..
bfce703
100644
(file)
--- a/
usr/src/sys/ufs/ffs/ufs_vnops.c
+++ b/
usr/src/sys/ufs/ffs/ufs_vnops.c
@@
-1,21
+1,21
@@
-/* ufs_vnops.c 4.
32 82/08/10
*/
+/* ufs_vnops.c 4.
41 82/10/19
*/
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/dir.h"
#include "../h/user.h"
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/dir.h"
#include "../h/user.h"
+#include "../h/kernel.h"
#include "../h/file.h"
#include "../h/stat.h"
#include "../h/inode.h"
#include "../h/fs.h"
#include "../h/buf.h"
#include "../h/proc.h"
#include "../h/file.h"
#include "../h/stat.h"
#include "../h/inode.h"
#include "../h/fs.h"
#include "../h/buf.h"
#include "../h/proc.h"
-#include "../h/inline.h"
-/* no reason to inline expand these guys here */
-#undef ilock
-#undef iunlock
#include "../h/quota.h"
#include "../h/descrip.h"
#include "../h/quota.h"
#include "../h/descrip.h"
+#include "../h/uio.h"
+#include "../h/socket.h"
+#include "../h/socketvar.h"
chdir()
{
chdir()
{
@@
-161,7
+161,7
@@
open1(ip, mode, checkpermissions)
fp->f_type = DTYPE_FILE;
i = u.u_r.r_val1;
fp->f_inode = ip;
fp->f_type = DTYPE_FILE;
i = u.u_r.r_val1;
fp->f_inode = ip;
- openi(ip, mode);
+
u.u_error =
openi(ip, mode);
if (u.u_error == 0) {
u.u_pofile[i] = flags;
return;
if (u.u_error == 0) {
u.u_pofile[i] = flags;
return;
@@
-256,7
+256,6
@@
out:
ip->i_nlink--;
ip->i_flag |= ICHG;
}
ip->i_nlink--;
ip->i_flag |= ICHG;
}
-out1:
irele(ip);
}
irele(ip);
}
@@
-296,11
+295,7
@@
symlink()
ip = maknode(IFLNK | 0777);
if (ip == NULL)
return;
ip = maknode(IFLNK | 0777);
if (ip == NULL)
return;
- u.u_base = uap->target;
- u.u_count = nc;
- u.u_offset = 0;
- u.u_segflg = 0;
- writei(ip);
+ u.u_error = rdwri(UIO_WRITE, ip, uap->target, nc, 0, 0, (int *)0);
iput(ip);
}
iput(ip);
}
@@
-315,9
+310,6
@@
unlink()
struct a {
char *fname;
};
struct a {
char *fname;
};
- struct fs *fs;
- struct buf *bp;
- int lbn, bn, base;
int unlinkingdot = 0;
pp = namei(uchar, 2, 0);
int unlinkingdot = 0;
pp = namei(uchar, 2, 0);
@@
-363,7
+355,7
@@
out1:
/*
* Seek system call
*/
/*
* Seek system call
*/
-seek()
+
l
seek()
{
register struct file *fp;
register struct a {
{
register struct file *fp;
register struct a {
@@
-525,7
+517,8
@@
readlink()
char *name;
char *buf;
int count;
char *name;
char *buf;
int count;
- } *uap;
+ } *uap = (struct a *)u.u_ap;
+ int resid;
ip = namei(uchar, 0, 0);
if (ip == NULL)
ip = namei(uchar, 0, 0);
if (ip == NULL)
@@
-534,15
+527,10
@@
readlink()
u.u_error = ENXIO;
goto out;
}
u.u_error = ENXIO;
goto out;
}
- uap = (struct a *)u.u_ap;
- u.u_offset = 0;
- u.u_base = uap->buf;
- u.u_count = uap->count;
- u.u_segflg = 0;
- readi(ip);
+ u.u_error = rdwri(UIO_READ, ip, uap->buf, uap->count, 0, 0, &resid);
out:
iput(ip);
out:
iput(ip);
- u.u_r.r_val1 = uap->count -
u.u_count
;
+ u.u_r.r_val1 = uap->count -
resid
;
}
chmod()
}
chmod()
@@
-589,13
+577,17
@@
chmod1(ip, mode)
register struct inode *ip;
register int mode;
{
register struct inode *ip;
register int mode;
{
+ register int *gp;
+
ip->i_mode &= ~07777;
if (u.u_uid) {
mode &= ~ISVTX;
ip->i_mode &= ~07777;
if (u.u_uid) {
mode &= ~ISVTX;
- if (ip->i_gid >= NGRPS ||
- (u.u_grps[ip->i_gid/(sizeof(int)*8)] &
- (1 << ip->i_gid%(sizeof(int)*8))) == 0)
- mode &= ~ISGID;
+ for (gp = u.u_groups; gp < &u.u_groups[NGROUPS]; gp++)
+ if (*gp == ip->i_gid)
+ goto ok;
+ mode &= ~ISGID;
+ok:
+ ;
#ifdef MUSH
if (u.u_quota->q_syflags & QF_UMASK && u.u_uid != 0 &&
(ip->i_mode & IFMT) != IFCHR)
#ifdef MUSH
if (u.u_quota->q_syflags & QF_UMASK && u.u_uid != 0 &&
(ip->i_mode & IFMT) != IFCHR)
@@
-713,7
+705,7
@@
chown1(ip, uid, gid)
* Set IUPD and IACC times on file.
* Can't set ICHG.
*/
* Set IUPD and IACC times on file.
* Can't set ICHG.
*/
-utime()
+
o
utime()
{
register struct a {
char *fname;
{
register struct a {
char *fname;
@@
-721,6
+713,7
@@
utime()
} *uap;
register struct inode *ip;
time_t tv[2];
} *uap;
register struct inode *ip;
time_t tv[2];
+ struct timeval tv0, tv1;
uap = (struct a *)u.u_ap;
if ((ip = owner(1)) == NULL)
uap = (struct a *)u.u_ap;
if ((ip = owner(1)) == NULL)
@@
-729,7
+722,9
@@
utime()
u.u_error = EFAULT;
} else {
ip->i_flag |= IACC|IUPD|ICHG;
u.u_error = EFAULT;
} else {
ip->i_flag |= IACC|IUPD|ICHG;
- iupdat(ip, &tv[0], &tv[1], 0);
+ tv0.tv_sec = tv[0]; tv0.tv_usec = 0;
+ tv1.tv_sec = tv[1]; tv1.tv_usec = 0;
+ iupdat(ip, &tv0, &tv1, 0);
}
iput(ip);
}
}
iput(ip);
}
@@
-737,7
+732,7
@@
utime()
sync()
{
sync()
{
- update(
0
);
+ update();
}
flock()
}
flock()
@@
-783,7
+778,7
@@
truncate()
struct a {
char *fname;
int length;
struct a {
char *fname;
int length;
- } *uap;
+ } *uap
= (struct a *)u.u_ap
;
struct inode *ip;
ip = namei(uchar, 0, 1);
struct inode *ip;
ip = namei(uchar, 0, 1);
@@
-806,7
+801,7
@@
ftruncate()
struct a {
int fd;
int length;
struct a {
int fd;
int length;
- } *uap;
+ } *uap
= (struct a *)u.u_ap
;
struct inode *ip;
struct file *fp;
struct inode *ip;
struct file *fp;
@@
-828,10
+823,12
@@
ftruncate()
rename()
{
rename()
{
+#ifdef notdef
struct a {
char *from;
char *to;
} *uap;
struct a {
char *from;
char *to;
} *uap;
+#endif
}
}