SCCS-vsn: sys/ufs/ffs/ufs_vnops.c 7.86
SCCS-vsn: sys/ufs/ufs/ufs_vnops.c 7.86
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.85 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.86 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
#include <sys/fifo.h>
#include <sys/malloc.h>
#include <sys/fifo.h>
#include <sys/malloc.h>
#include <ufs/ufs/lockf.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/lockf.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *));
int ufs_chown
int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *));
int ufs_chown
- __P((struct vnode *, u_int, u_int, struct ucred *, struct proc *));
+ __P((struct vnode *, uid_t, gid_t, struct ucred *, struct proc *));
#ifdef _NOQUAD
#define SETHIGH(q, h) (q).val[_QUAD_HIGHWORD] = (h)
#ifdef _NOQUAD
#define SETHIGH(q, h) (q).val[_QUAD_HIGHWORD] = (h)
#else
vap->va_qsize = ip->i_din.di_qsize;
#endif
#else
vap->va_qsize = ip->i_din.di_qsize;
#endif
- vap->va_atime.tv_sec = ip->i_atime;
- vap->va_atime.tv_usec = 0;
- vap->va_mtime.tv_sec = ip->i_mtime;
- vap->va_mtime.tv_usec = 0;
- vap->va_ctime.tv_sec = ip->i_ctime;
- vap->va_ctime.tv_usec = 0;
+ vap->va_atime = ip->i_atime;
+ vap->va_mtime = ip->i_mtime;
+ vap->va_ctime = ip->i_ctime;
vap->va_flags = ip->i_flags;
vap->va_gen = ip->i_gen;
/* this doesn't belong here */
vap->va_flags = ip->i_flags;
vap->va_gen = ip->i_gen;
/* this doesn't belong here */
/*
* Go through the fields and update iff not VNOVAL.
*/
/*
* Go through the fields and update iff not VNOVAL.
*/
- if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
+ if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL)
if (error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, p))
return (error);
if (vap->va_size != VNOVAL) {
if (error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, p))
return (error);
if (vap->va_size != VNOVAL) {
return (error);
}
error = 0;
return (error);
}
error = 0;
- if (vap->va_mode != (u_short)VNOVAL)
+ if (vap->va_mode != (mode_t)VNOVAL)
error = ufs_chmod(vp, (int)vap->va_mode, cred, p);
if (vap->va_flags != VNOVAL) {
if (cred->cr_uid != ip->i_uid &&
error = ufs_chmod(vp, (int)vap->va_mode, cred, p);
if (vap->va_flags != VNOVAL) {
if (cred->cr_uid != ip->i_uid &&
static int
ufs_chown(vp, uid, gid, cred, p)
register struct vnode *vp;
static int
ufs_chown(vp, uid, gid, cred, p)
register struct vnode *vp;
- u_int uid;
- u_int gid;
+ uid_t uid;
+ gid_t gid;
struct ucred *cred;
struct proc *p;
{
struct ucred *cred;
struct proc *p;
{
- if (uid == (u_short)VNOVAL)
+ if (uid == (uid_t)VNOVAL)
- if (gid == (u_short)VNOVAL)
+ if (gid == (gid_t)VNOVAL)
gid = ip->i_gid;
/*
* If we don't own the file, are trying to change the owner
gid = ip->i_gid;
/*
* If we don't own the file, are trying to change the owner
register struct inode *ip;
int error;
register struct inode *ip;
int error;
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_link: no name");
#endif
ip = VTOI(vp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_link: no name");
#endif
ip = VTOI(vp);
- if ((unsigned short)ip->i_nlink >= LINK_MAX) {
+ if ((nlink_t)ip->i_nlink >= LINK_MAX) {
free(cnp->cn_pnbuf, M_NAMEI);
return (EMLINK);
}
free(cnp->cn_pnbuf, M_NAMEI);
return (EMLINK);
}
int error = 0;
int fdvpneedsrele = 1, tdvpneedsrele = 1;
int error = 0;
int fdvpneedsrele = 1, tdvpneedsrele = 1;
if ((tcnp->cn_flags & HASBUF) == 0 ||
(fcnp->cn_flags & HASBUF) == 0)
panic("ufs_rename: no name");
if ((tcnp->cn_flags & HASBUF) == 0 ||
(fcnp->cn_flags & HASBUF) == 0)
panic("ufs_rename: no name");
* parent we don't fool with the link count.
*/
if (doingdirectory && newparent) {
* parent we don't fool with the link count.
*/
if (doingdirectory && newparent) {
- if ((unsigned short)dp->i_nlink >= LINK_MAX) {
+ if ((nlink_t)dp->i_nlink >= LINK_MAX) {
error = EMLINK;
goto bad;
}
error = EMLINK;
goto bad;
}
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_mkdir: no name");
#endif
dp = VTOI(dvp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_mkdir: no name");
#endif
dp = VTOI(dvp);
- if ((unsigned short)dp->i_nlink >= LINK_MAX) {
+ if ((nlink_t)dp->i_nlink >= LINK_MAX) {
free(cnp->cn_pnbuf, M_NAMEI);
ufs_iput(dp);
return (EMLINK);
free(cnp->cn_pnbuf, M_NAMEI);
ufs_iput(dp);
return (EMLINK);
int error;
pdir = VTOI(dvp);
int error;
pdir = VTOI(dvp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_makeinode: no name");
#endif
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_makeinode: no name");
#endif
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ufs_vnops.c 7.85 (Berkeley) %G%
+ * @(#)ufs_vnops.c 7.86 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
#include <sys/fifo.h>
#include <sys/malloc.h>
#include <sys/fifo.h>
#include <sys/malloc.h>
#include <ufs/ufs/lockf.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
#include <ufs/ufs/lockf.h>
#include <ufs/ufs/quota.h>
#include <ufs/ufs/inode.h>
int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *));
int ufs_chown
int ufs_chmod __P((struct vnode *, int, struct ucred *, struct proc *));
int ufs_chown
- __P((struct vnode *, u_int, u_int, struct ucred *, struct proc *));
+ __P((struct vnode *, uid_t, gid_t, struct ucred *, struct proc *));
#ifdef _NOQUAD
#define SETHIGH(q, h) (q).val[_QUAD_HIGHWORD] = (h)
#ifdef _NOQUAD
#define SETHIGH(q, h) (q).val[_QUAD_HIGHWORD] = (h)
#else
vap->va_qsize = ip->i_din.di_qsize;
#endif
#else
vap->va_qsize = ip->i_din.di_qsize;
#endif
- vap->va_atime.tv_sec = ip->i_atime;
- vap->va_atime.tv_usec = 0;
- vap->va_mtime.tv_sec = ip->i_mtime;
- vap->va_mtime.tv_usec = 0;
- vap->va_ctime.tv_sec = ip->i_ctime;
- vap->va_ctime.tv_usec = 0;
+ vap->va_atime = ip->i_atime;
+ vap->va_mtime = ip->i_mtime;
+ vap->va_ctime = ip->i_ctime;
vap->va_flags = ip->i_flags;
vap->va_gen = ip->i_gen;
/* this doesn't belong here */
vap->va_flags = ip->i_flags;
vap->va_gen = ip->i_gen;
/* this doesn't belong here */
/*
* Go through the fields and update iff not VNOVAL.
*/
/*
* Go through the fields and update iff not VNOVAL.
*/
- if (vap->va_uid != (u_short)VNOVAL || vap->va_gid != (u_short)VNOVAL)
+ if (vap->va_uid != (uid_t)VNOVAL || vap->va_gid != (gid_t)VNOVAL)
if (error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, p))
return (error);
if (vap->va_size != VNOVAL) {
if (error = ufs_chown(vp, vap->va_uid, vap->va_gid, cred, p))
return (error);
if (vap->va_size != VNOVAL) {
return (error);
}
error = 0;
return (error);
}
error = 0;
- if (vap->va_mode != (u_short)VNOVAL)
+ if (vap->va_mode != (mode_t)VNOVAL)
error = ufs_chmod(vp, (int)vap->va_mode, cred, p);
if (vap->va_flags != VNOVAL) {
if (cred->cr_uid != ip->i_uid &&
error = ufs_chmod(vp, (int)vap->va_mode, cred, p);
if (vap->va_flags != VNOVAL) {
if (cred->cr_uid != ip->i_uid &&
static int
ufs_chown(vp, uid, gid, cred, p)
register struct vnode *vp;
static int
ufs_chown(vp, uid, gid, cred, p)
register struct vnode *vp;
- u_int uid;
- u_int gid;
+ uid_t uid;
+ gid_t gid;
struct ucred *cred;
struct proc *p;
{
struct ucred *cred;
struct proc *p;
{
- if (uid == (u_short)VNOVAL)
+ if (uid == (uid_t)VNOVAL)
- if (gid == (u_short)VNOVAL)
+ if (gid == (gid_t)VNOVAL)
gid = ip->i_gid;
/*
* If we don't own the file, are trying to change the owner
gid = ip->i_gid;
/*
* If we don't own the file, are trying to change the owner
register struct inode *ip;
int error;
register struct inode *ip;
int error;
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_link: no name");
#endif
ip = VTOI(vp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_link: no name");
#endif
ip = VTOI(vp);
- if ((unsigned short)ip->i_nlink >= LINK_MAX) {
+ if ((nlink_t)ip->i_nlink >= LINK_MAX) {
free(cnp->cn_pnbuf, M_NAMEI);
return (EMLINK);
}
free(cnp->cn_pnbuf, M_NAMEI);
return (EMLINK);
}
int error = 0;
int fdvpneedsrele = 1, tdvpneedsrele = 1;
int error = 0;
int fdvpneedsrele = 1, tdvpneedsrele = 1;
if ((tcnp->cn_flags & HASBUF) == 0 ||
(fcnp->cn_flags & HASBUF) == 0)
panic("ufs_rename: no name");
if ((tcnp->cn_flags & HASBUF) == 0 ||
(fcnp->cn_flags & HASBUF) == 0)
panic("ufs_rename: no name");
* parent we don't fool with the link count.
*/
if (doingdirectory && newparent) {
* parent we don't fool with the link count.
*/
if (doingdirectory && newparent) {
- if ((unsigned short)dp->i_nlink >= LINK_MAX) {
+ if ((nlink_t)dp->i_nlink >= LINK_MAX) {
error = EMLINK;
goto bad;
}
error = EMLINK;
goto bad;
}
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_mkdir: no name");
#endif
dp = VTOI(dvp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_mkdir: no name");
#endif
dp = VTOI(dvp);
- if ((unsigned short)dp->i_nlink >= LINK_MAX) {
+ if ((nlink_t)dp->i_nlink >= LINK_MAX) {
free(cnp->cn_pnbuf, M_NAMEI);
ufs_iput(dp);
return (EMLINK);
free(cnp->cn_pnbuf, M_NAMEI);
ufs_iput(dp);
return (EMLINK);
int error;
pdir = VTOI(dvp);
int error;
pdir = VTOI(dvp);
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_makeinode: no name");
#endif
if ((cnp->cn_flags & HASBUF) == 0)
panic("ufs_makeinode: no name");
#endif