if (!(filp->f_flags & FMODE_WRITE)) 
if (!(filp->f_mode & FMODE_WRITE)) 
xfs_ioc_space(	bhv_desc_t		*bdp,	vnode_t			*vp,	struct file		*filp,	int			ioflags,	unsigned int		cmd,	void			__user *arg){	xfs_flock64_t		bf;	int			attr_flags = 0;	int			error;	if (vp->v_inode.i_flags & (S_IMMUTABLE|S_APPEND))		return -XFS_ERROR(EPERM);	if (!(filp->f_flags & FMODE_WRITE))		return -XFS_ERROR(EBADF);	if (vp->v_type != VREG)		return -XFS_ERROR(EINVAL);	if (copy_from_user(&bf, arg, sizeof(bf)))		return -XFS_ERROR(EFAULT);	if (filp->f_flags & (O_NDELAY|O_NONBLOCK))		attr_flags |= ATTR_NONBLOCK;	if (ioflags & IO_INVIS)		attr_flags |= ATTR_DMI;	error = xfs_change_file_space(bdp, cmd, &bf, filp->f_pos,					      NULL, attr_flags);	return -error;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ad4a8ac4e9d9cffb0a4c9ebebc6bda9d8dbbfe99/xfs_ioctl.c/clean/fs/xfs/linux-2.6/xfs_ioctl.c