aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_ioctl.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 03:00:52 -0400
commit67fcaa73adafb19139a7cd8ab133592b6a0a0901 (patch)
tree6e7b83e7c8b0a1d8b4776af1537d6f07ebe9435d /fs/xfs/linux-2.6/xfs_ioctl.c
parentb83bd1388133e914c38bd31d69bc90143e6ab10c (diff)
[XFS] Resolve a namespace collision on vnode/vnodeops for FreeBSD porters.
SGI-PV: 953338 SGI-Modid: xfs-linux-melb:xfs-kern:26107a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c61
1 files changed, 29 insertions, 32 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 84478491609b..73182503c16e 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -78,7 +78,7 @@ xfs_find_handle(
78 xfs_handle_t handle; 78 xfs_handle_t handle;
79 xfs_fsop_handlereq_t hreq; 79 xfs_fsop_handlereq_t hreq;
80 struct inode *inode; 80 struct inode *inode;
81 struct vnode *vp; 81 bhv_vnode_t *vp;
82 82
83 if (copy_from_user(&hreq, arg, sizeof(hreq))) 83 if (copy_from_user(&hreq, arg, sizeof(hreq)))
84 return -XFS_ERROR(EFAULT); 84 return -XFS_ERROR(EFAULT);
@@ -192,7 +192,7 @@ xfs_vget_fsop_handlereq(
192 xfs_mount_t *mp, 192 xfs_mount_t *mp,
193 struct inode *parinode, /* parent inode pointer */ 193 struct inode *parinode, /* parent inode pointer */
194 xfs_fsop_handlereq_t *hreq, 194 xfs_fsop_handlereq_t *hreq,
195 vnode_t **vp, 195 bhv_vnode_t **vp,
196 struct inode **inode) 196 struct inode **inode)
197{ 197{
198 void __user *hanp; 198 void __user *hanp;
@@ -202,7 +202,7 @@ xfs_vget_fsop_handlereq(
202 xfs_handle_t handle; 202 xfs_handle_t handle;
203 xfs_inode_t *ip; 203 xfs_inode_t *ip;
204 struct inode *inodep; 204 struct inode *inodep;
205 vnode_t *vpp; 205 bhv_vnode_t *vpp;
206 xfs_ino_t ino; 206 xfs_ino_t ino;
207 __u32 igen; 207 __u32 igen;
208 int error; 208 int error;
@@ -277,7 +277,7 @@ xfs_open_by_handle(
277 struct file *filp; 277 struct file *filp;
278 struct inode *inode; 278 struct inode *inode;
279 struct dentry *dentry; 279 struct dentry *dentry;
280 vnode_t *vp; 280 bhv_vnode_t *vp;
281 xfs_fsop_handlereq_t hreq; 281 xfs_fsop_handlereq_t hreq;
282 282
283 if (!capable(CAP_SYS_ADMIN)) 283 if (!capable(CAP_SYS_ADMIN))
@@ -362,7 +362,7 @@ xfs_readlink_by_handle(
362 struct uio auio; 362 struct uio auio;
363 struct inode *inode; 363 struct inode *inode;
364 xfs_fsop_handlereq_t hreq; 364 xfs_fsop_handlereq_t hreq;
365 vnode_t *vp; 365 bhv_vnode_t *vp;
366 __u32 olen; 366 __u32 olen;
367 367
368 if (!capable(CAP_SYS_ADMIN)) 368 if (!capable(CAP_SYS_ADMIN))
@@ -393,9 +393,11 @@ xfs_readlink_by_handle(
393 auio.uio_segflg = UIO_USERSPACE; 393 auio.uio_segflg = UIO_USERSPACE;
394 auio.uio_resid = olen; 394 auio.uio_resid = olen;
395 395
396 VOP_READLINK(vp, &auio, IO_INVIS, NULL, error); 396 error = bhv_vop_readlink(vp, &auio, IO_INVIS, NULL);
397
398 VN_RELE(vp); 397 VN_RELE(vp);
398 if (error)
399 return -error;
400
399 return (olen - auio.uio_resid); 401 return (olen - auio.uio_resid);
400} 402}
401 403
@@ -411,7 +413,7 @@ xfs_fssetdm_by_handle(
411 xfs_fsop_setdm_handlereq_t dmhreq; 413 xfs_fsop_setdm_handlereq_t dmhreq;
412 struct inode *inode; 414 struct inode *inode;
413 bhv_desc_t *bdp; 415 bhv_desc_t *bdp;
414 vnode_t *vp; 416 bhv_vnode_t *vp;
415 417
416 if (!capable(CAP_MKNOD)) 418 if (!capable(CAP_MKNOD))
417 return -XFS_ERROR(EPERM); 419 return -XFS_ERROR(EPERM);
@@ -452,7 +454,7 @@ xfs_attrlist_by_handle(
452 attrlist_cursor_kern_t *cursor; 454 attrlist_cursor_kern_t *cursor;
453 xfs_fsop_attrlist_handlereq_t al_hreq; 455 xfs_fsop_attrlist_handlereq_t al_hreq;
454 struct inode *inode; 456 struct inode *inode;
455 vnode_t *vp; 457 bhv_vnode_t *vp;
456 char *kbuf; 458 char *kbuf;
457 459
458 if (!capable(CAP_SYS_ADMIN)) 460 if (!capable(CAP_SYS_ADMIN))
@@ -472,8 +474,8 @@ xfs_attrlist_by_handle(
472 goto out_vn_rele; 474 goto out_vn_rele;
473 475
474 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos; 476 cursor = (attrlist_cursor_kern_t *)&al_hreq.pos;
475 VOP_ATTR_LIST(vp, kbuf, al_hreq.buflen, al_hreq.flags, 477 error = bhv_vop_attr_list(vp, kbuf, al_hreq.buflen, al_hreq.flags,
476 cursor, NULL, error); 478 cursor, NULL);
477 if (error) 479 if (error)
478 goto out_kfree; 480 goto out_kfree;
479 481
@@ -490,7 +492,7 @@ xfs_attrlist_by_handle(
490 492
491STATIC int 493STATIC int
492xfs_attrmulti_attr_get( 494xfs_attrmulti_attr_get(
493 struct vnode *vp, 495 bhv_vnode_t *vp,
494 char *name, 496 char *name,
495 char __user *ubuf, 497 char __user *ubuf,
496 __uint32_t *len, 498 __uint32_t *len,
@@ -505,7 +507,7 @@ xfs_attrmulti_attr_get(
505 if (!kbuf) 507 if (!kbuf)
506 return ENOMEM; 508 return ENOMEM;
507 509
508 VOP_ATTR_GET(vp, name, kbuf, len, flags, NULL, error); 510 error = bhv_vop_attr_get(vp, name, kbuf, len, flags, NULL);
509 if (error) 511 if (error)
510 goto out_kfree; 512 goto out_kfree;
511 513
@@ -519,7 +521,7 @@ xfs_attrmulti_attr_get(
519 521
520STATIC int 522STATIC int
521xfs_attrmulti_attr_set( 523xfs_attrmulti_attr_set(
522 struct vnode *vp, 524 bhv_vnode_t *vp,
523 char *name, 525 char *name,
524 const char __user *ubuf, 526 const char __user *ubuf,
525 __uint32_t len, 527 __uint32_t len,
@@ -542,7 +544,7 @@ xfs_attrmulti_attr_set(
542 if (copy_from_user(kbuf, ubuf, len)) 544 if (copy_from_user(kbuf, ubuf, len))
543 goto out_kfree; 545 goto out_kfree;
544 546
545 VOP_ATTR_SET(vp, name, kbuf, len, flags, NULL, error); 547 error = bhv_vop_attr_set(vp, name, kbuf, len, flags, NULL);
546 548
547 out_kfree: 549 out_kfree:
548 kfree(kbuf); 550 kfree(kbuf);
@@ -551,20 +553,15 @@ xfs_attrmulti_attr_set(
551 553
552STATIC int 554STATIC int
553xfs_attrmulti_attr_remove( 555xfs_attrmulti_attr_remove(
554 struct vnode *vp, 556 bhv_vnode_t *vp,
555 char *name, 557 char *name,
556 __uint32_t flags) 558 __uint32_t flags)
557{ 559{
558 int error;
559
560
561 if (IS_RDONLY(&vp->v_inode)) 560 if (IS_RDONLY(&vp->v_inode))
562 return -EROFS; 561 return -EROFS;
563 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) 562 if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode))
564 return EPERM; 563 return EPERM;
565 564 return bhv_vop_attr_remove(vp, name, flags, NULL);
566 VOP_ATTR_REMOVE(vp, name, flags, NULL, error);
567 return error;
568} 565}
569 566
570STATIC int 567STATIC int
@@ -578,7 +575,7 @@ xfs_attrmulti_by_handle(
578 xfs_attr_multiop_t *ops; 575 xfs_attr_multiop_t *ops;
579 xfs_fsop_attrmulti_handlereq_t am_hreq; 576 xfs_fsop_attrmulti_handlereq_t am_hreq;
580 struct inode *inode; 577 struct inode *inode;
581 vnode_t *vp; 578 bhv_vnode_t *vp;
582 unsigned int i, size; 579 unsigned int i, size;
583 char *attr_name; 580 char *attr_name;
584 581
@@ -658,7 +655,7 @@ xfs_attrmulti_by_handle(
658STATIC int 655STATIC int
659xfs_ioc_space( 656xfs_ioc_space(
660 bhv_desc_t *bdp, 657 bhv_desc_t *bdp,
661 vnode_t *vp, 658 bhv_vnode_t *vp,
662 struct file *filp, 659 struct file *filp,
663 int flags, 660 int flags,
664 unsigned int cmd, 661 unsigned int cmd,
@@ -682,7 +679,7 @@ xfs_ioc_fsgeometry(
682 679
683STATIC int 680STATIC int
684xfs_ioc_xattr( 681xfs_ioc_xattr(
685 vnode_t *vp, 682 bhv_vnode_t *vp,
686 xfs_inode_t *ip, 683 xfs_inode_t *ip,
687 struct file *filp, 684 struct file *filp,
688 unsigned int cmd, 685 unsigned int cmd,
@@ -711,7 +708,7 @@ xfs_ioctl(
711 void __user *arg) 708 void __user *arg)
712{ 709{
713 int error; 710 int error;
714 vnode_t *vp; 711 bhv_vnode_t *vp;
715 xfs_inode_t *ip; 712 xfs_inode_t *ip;
716 xfs_mount_t *mp; 713 xfs_mount_t *mp;
717 714
@@ -962,7 +959,7 @@ xfs_ioctl(
962STATIC int 959STATIC int
963xfs_ioc_space( 960xfs_ioc_space(
964 bhv_desc_t *bdp, 961 bhv_desc_t *bdp,
965 vnode_t *vp, 962 bhv_vnode_t *vp,
966 struct file *filp, 963 struct file *filp,
967 int ioflags, 964 int ioflags,
968 unsigned int cmd, 965 unsigned int cmd,
@@ -1153,7 +1150,7 @@ xfs_di2lxflags(
1153 1150
1154STATIC int 1151STATIC int
1155xfs_ioc_xattr( 1152xfs_ioc_xattr(
1156 vnode_t *vp, 1153 bhv_vnode_t *vp,
1157 xfs_inode_t *ip, 1154 xfs_inode_t *ip,
1158 struct file *filp, 1155 struct file *filp,
1159 unsigned int cmd, 1156 unsigned int cmd,
@@ -1173,7 +1170,7 @@ xfs_ioc_xattr(
1173 case XFS_IOC_FSGETXATTR: { 1170 case XFS_IOC_FSGETXATTR: {
1174 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1171 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1175 XFS_AT_NEXTENTS | XFS_AT_PROJID; 1172 XFS_AT_NEXTENTS | XFS_AT_PROJID;
1176 VOP_GETATTR(vp, vattr, 0, NULL, error); 1173 error = bhv_vop_getattr(vp, vattr, 0, NULL);
1177 if (unlikely(error)) { 1174 if (unlikely(error)) {
1178 error = -error; 1175 error = -error;
1179 break; 1176 break;
@@ -1206,7 +1203,7 @@ xfs_ioc_xattr(
1206 vattr->va_extsize = fa.fsx_extsize; 1203 vattr->va_extsize = fa.fsx_extsize;
1207 vattr->va_projid = fa.fsx_projid; 1204 vattr->va_projid = fa.fsx_projid;
1208 1205
1209 VOP_SETATTR(vp, vattr, attr_flags, NULL, error); 1206 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
1210 if (likely(!error)) 1207 if (likely(!error))
1211 __vn_revalidate(vp, vattr); /* update flags */ 1208 __vn_revalidate(vp, vattr); /* update flags */
1212 error = -error; 1209 error = -error;
@@ -1216,7 +1213,7 @@ xfs_ioc_xattr(
1216 case XFS_IOC_FSGETXATTRA: { 1213 case XFS_IOC_FSGETXATTRA: {
1217 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \ 1214 vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | \
1218 XFS_AT_ANEXTENTS | XFS_AT_PROJID; 1215 XFS_AT_ANEXTENTS | XFS_AT_PROJID;
1219 VOP_GETATTR(vp, vattr, 0, NULL, error); 1216 error = bhv_vop_getattr(vp, vattr, 0, NULL);
1220 if (unlikely(error)) { 1217 if (unlikely(error)) {
1221 error = -error; 1218 error = -error;
1222 break; 1219 break;
@@ -1262,7 +1259,7 @@ xfs_ioc_xattr(
1262 vattr->va_xflags = xfs_merge_ioc_xflags(flags, 1259 vattr->va_xflags = xfs_merge_ioc_xflags(flags,
1263 xfs_ip2xflags(ip)); 1260 xfs_ip2xflags(ip));
1264 1261
1265 VOP_SETATTR(vp, vattr, attr_flags, NULL, error); 1262 error = bhv_vop_setattr(vp, vattr, attr_flags, NULL);
1266 if (likely(!error)) 1263 if (likely(!error))
1267 __vn_revalidate(vp, vattr); /* update flags */ 1264 __vn_revalidate(vp, vattr); /* update flags */
1268 error = -error; 1265 error = -error;