Received: with ECARTIS (v1.0.0; list linux-xfs); Sat, 16 Aug 2003 17:05:33 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.9) with SMTP id h7H054Fl007118 for ; Sat, 16 Aug 2003 17:05:05 -0700 Received: from willy by www.linux.org.uk with local (Exim 4.14) id 19o9kq-0002z4-OK for linux-xfs@oss.sgi.com; Sat, 16 Aug 2003 23:42:36 +0100 Date: Sat, 16 Aug 2003 23:42:36 +0100 From: Matthew Wilcox To: linux-xfs@oss.sgi.com Subject: Better patch to remove VOP_ACCESS and vop_access Message-ID: <20030816224236.GK19630@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 63 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: willy@debian.org Precedence: bulk X-list: linux-xfs Content-Length: 3901 Lines: 120 Thinking about it, this is probably a better patch. There's only one implementation of vop_access, so inline it into linvfs_permission. Um, unless someone has another vop_access implementation that might crop up? - Remove VOP_ACCESS - Remove vop_access - Inline xfs_access into linvfs_permission Index: fs/xfs/xfs_vnodeops.c =================================================================== RCS file: /var/cvs/linux-2.6/fs/xfs/xfs_vnodeops.c,v retrieving revision 1.2 diff -u -p -r1.2 xfs_vnodeops.c --- fs/xfs/xfs_vnodeops.c 12 Aug 2003 19:11:19 -0000 1.2 +++ fs/xfs/xfs_vnodeops.c 16 Aug 2003 22:34:57 -0000 @@ -928,30 +928,6 @@ xfs_setattr( /* - * xfs_access - * Null conversion from vnode mode bits to inode mode bits, as in efs. - */ -STATIC int -xfs_access( - bhv_desc_t *bdp, - int mode, - cred_t *credp) -{ - xfs_inode_t *ip; - int error; - - vn_trace_entry(BHV_TO_VNODE(bdp), __FUNCTION__, - (inst_t *)__return_address); - - ip = XFS_BHVTOI(bdp); - xfs_ilock(ip, XFS_ILOCK_SHARED); - error = xfs_iaccess(ip, mode, credp); - xfs_iunlock(ip, XFS_ILOCK_SHARED); - return error; -} - - -/* * xfs_readlink * */ @@ -4731,7 +4707,6 @@ vnodeops_t xfs_vnodeops = { .vop_ioctl = xfs_ioctl, .vop_getattr = xfs_getattr, .vop_setattr = xfs_setattr, - .vop_access = xfs_access, .vop_lookup = xfs_lookup, .vop_create = xfs_create, .vop_remove = xfs_remove, Index: fs/xfs/linux/xfs_iops.c =================================================================== RCS file: /var/cvs/linux-2.6/fs/xfs/linux/xfs_iops.c,v retrieving revision 1.2 diff -u -p -r1.2 xfs_iops.c --- fs/xfs/linux/xfs_iops.c 12 Aug 2003 19:11:20 -0000 1.2 +++ fs/xfs/linux/xfs_iops.c 16 Aug 2003 22:34:58 -0000 @@ -435,11 +435,18 @@ linvfs_permission( int mode, struct nameidata *nd) { + xfs_inode_t *ip; vnode_t *vp = LINVFS_GET_VP(inode); int error; + vn_trace_entry(BHV_TO_VNODE(bdp), __FUNCTION__, + (inst_t *)__return_address); + mode <<= 6; /* convert from linux to vnode access bits */ - VOP_ACCESS(vp, mode, NULL, error); + ip = XFS_BHVTOI(bdp); + xfs_ilock(ip, XFS_ILOCK_SHARED); + error = xfs_iaccess(ip, mode, NULL); + xfs_iunlock(ip, XFS_ILOCK_SHARED); return -error; } #else Index: fs/xfs/linux/xfs_vnode.h =================================================================== RCS file: /var/cvs/linux-2.6/fs/xfs/linux/xfs_vnode.h,v retrieving revision 1.2 diff -u -p -r1.2 xfs_vnode.h --- fs/xfs/linux/xfs_vnode.h 12 Aug 2003 19:11:20 -0000 1.2 +++ fs/xfs/linux/xfs_vnode.h 16 Aug 2003 22:34:58 -0000 @@ -173,7 +173,6 @@ typedef int (*vop_getattr_t)(bhv_desc_t struct cred *); typedef int (*vop_setattr_t)(bhv_desc_t *, struct vattr *, int, struct cred *); -typedef int (*vop_access_t)(bhv_desc_t *, int, struct cred *); typedef int (*vop_lookup_t)(bhv_desc_t *, vname_t *, vnode_t **, int, vnode_t *, struct cred *); typedef int (*vop_create_t)(bhv_desc_t *, vname_t *, struct vattr *, @@ -226,7 +225,6 @@ typedef struct vnodeops { vop_ioctl_t vop_ioctl; vop_getattr_t vop_getattr; vop_setattr_t vop_setattr; - vop_access_t vop_access; vop_lookup_t vop_lookup; vop_create_t vop_create; vop_remove_t vop_remove; @@ -276,8 +274,6 @@ typedef struct vnodeops { rv = _VOP_(vop_getattr, vp)((vp)->v_fbhv, vap, f, cr) #define VOP_SETATTR(vp, vap, f, cr, rv) \ rv = _VOP_(vop_setattr, vp)((vp)->v_fbhv, vap, f, cr) -#define VOP_ACCESS(vp, mode, cr, rv) \ - rv = _VOP_(vop_access, vp)((vp)->v_fbhv, mode, cr) #define VOP_LOOKUP(vp,d,vpp,f,rdir,cr,rv) \ rv = _VOP_(vop_lookup, vp)((vp)->v_fbhv,d,vpp,f,rdir,cr) #define VOP_CREATE(dvp,d,vap,vpp,cr,rv) \ -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk