Adapt to accmode_t changes.

Approved by:	rwatson (mentor), kan
This commit is contained in:
Edward Tomasz Napierala 2008-11-14 09:58:16 +00:00
parent 4edfe66253
commit f02bd9eacc
5 changed files with 13 additions and 13 deletions

View File

@ -292,8 +292,8 @@ typedef struct xfs_vnodeops {
rv = _VOP_(vop_getattr, vp)((vp)->v_fbhv, vap, f, cr)
#define XVOP_SETATTR(vp, vap, f, cr, rv) \
rv = _VOP_(vop_setattr, vp)((vp)->v_fbhv, vap, f, cr)
#define XVOP_ACCESS(vp, mode, cr, rv) \
rv = _VOP_(vop_access, vp)((vp)->v_fbhv, mode, cr)
#define XVOP_ACCESS(vp, accmode, cr, rv) \
rv = _VOP_(vop_access, vp)((vp)->v_fbhv, accmode, cr)
#define XVOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv) \
rv = _VOP_(vop_lookup, vp)((vp)->v_fbhv,d,vpp,f,rdir,cr)
#define XVOP_CREATE(dvp,d,vap,vpp,cr,rv) \

View File

@ -181,11 +181,11 @@ xfs_swap_extents(
locked = 1;
/* Check permissions */
error = xfs_iaccess(ip, S_IWUSR, NULL);
error = xfs_iaccess(ip, VWRITE, NULL);
if (error)
goto error0;
error = xfs_iaccess(tip, S_IWUSR, NULL);
error = xfs_iaccess(tip, VWRITE, NULL);
if (error)
goto error0;

View File

@ -3610,7 +3610,7 @@ xfs_iflush_all(
int
xfs_iaccess(
xfs_inode_t *ip,
mode_t mode,
accmode_t accmode,
cred_t *cr)
{
xfs_vnode_t *vp;
@ -3624,10 +3624,10 @@ xfs_iaccess(
/*
* Verify that the MAC policy allows the requested access.
*/
if ((error = _MAC_XFS_IACCESS(ip, mode, cr)))
if ((error = _MAC_XFS_IACCESS(ip, accmode, cr)))
return XFS_ERROR(error);
if (mode & S_IWUSR) {
if (accmode & VWRITE) {
xfs_mount_t *mp = ip->i_mount;
if ((XVFSTOMNT(XFS_MTOVFS(mp))->mnt_flag & MNT_RDONLY) &&
@ -3644,13 +3644,13 @@ xfs_iaccess(
* If there's an Access Control List it's used instead of
* the mode bits.
*/
if ((error = _ACL_XFS_IACCESS(ip, mode, cr)) != -1)
if ((error = _ACL_XFS_IACCESS(ip, accmode, cr)) != -1)
return error ? XFS_ERROR(error) : 0;
/* FreeBSD local change here */
error = vaccess(vp->v_vnode->v_type, imode, ip->i_d.di_uid, ip->i_d.di_gid,
mode, cr, NULL);
accmode, cr, NULL);
return (error);
}

View File

@ -455,7 +455,7 @@ void xfs_iunpin(xfs_inode_t *);
int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int);
int xfs_iflush(xfs_inode_t *, uint);
void xfs_iflush_all(struct xfs_mount *);
int xfs_iaccess(xfs_inode_t *, mode_t, cred_t *);
int xfs_iaccess(xfs_inode_t *, accmode_t, cred_t *);
uint xfs_iroundup(uint);
void xfs_ichgtime(xfs_inode_t *, int);
xfs_fsize_t xfs_file_last_byte(xfs_inode_t *);

View File

@ -922,7 +922,7 @@ xfs_setattr(
STATIC int
xfs_access(
bhv_desc_t *bdp,
int mode,
accmode_t accmode,
cred_t *credp)
{
xfs_inode_t *ip;
@ -933,7 +933,7 @@ xfs_access(
ip = XFS_BHVTOI(bdp);
xfs_ilock(ip, XFS_ILOCK_SHARED);
error = xfs_iaccess(ip, mode, credp);
error = xfs_iaccess(ip, accmode, credp);
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return error;
}
@ -4538,7 +4538,7 @@ xfs_change_file_space(
xfs_ilock(ip, XFS_ILOCK_SHARED);
if ((error = xfs_iaccess(ip, S_IWUSR, credp))) {
if ((error = xfs_iaccess(ip, VWRITE, credp))) {
xfs_iunlock(ip, XFS_ILOCK_SHARED);
return error;
}