diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
tree | 50c101806f4d3b6585222dda060559eb4f3e005a /fs/xfs/linux-2.6/xfs_ioctl.c | |
parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index b78b5eb9e96c..4db47790415c 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include "xfs_dfrag.h" | 52 | #include "xfs_dfrag.h" |
53 | #include "xfs_fsops.h" | 53 | #include "xfs_fsops.h" |
54 | 54 | ||
55 | #include <linux/capability.h> | ||
55 | #include <linux/dcache.h> | 56 | #include <linux/dcache.h> |
56 | #include <linux/mount.h> | 57 | #include <linux/mount.h> |
57 | #include <linux/namei.h> | 58 | #include <linux/namei.h> |
@@ -145,13 +146,10 @@ xfs_find_handle( | |||
145 | 146 | ||
146 | if (cmd != XFS_IOC_PATH_TO_FSHANDLE) { | 147 | if (cmd != XFS_IOC_PATH_TO_FSHANDLE) { |
147 | xfs_inode_t *ip; | 148 | xfs_inode_t *ip; |
148 | bhv_desc_t *bhv; | ||
149 | int lock_mode; | 149 | int lock_mode; |
150 | 150 | ||
151 | /* need to get access to the xfs_inode to read the generation */ | 151 | /* need to get access to the xfs_inode to read the generation */ |
152 | bhv = vn_bhv_lookup_unlocked(VN_BHV_HEAD(vp), &xfs_vnodeops); | 152 | ip = xfs_vtoi(vp); |
153 | ASSERT(bhv); | ||
154 | ip = XFS_BHVTOI(bhv); | ||
155 | ASSERT(ip); | 153 | ASSERT(ip); |
156 | lock_mode = xfs_ilock_map_shared(ip); | 154 | lock_mode = xfs_ilock_map_shared(ip); |
157 | 155 | ||
@@ -530,6 +528,8 @@ xfs_attrmulti_attr_set( | |||
530 | char *kbuf; | 528 | char *kbuf; |
531 | int error = EFAULT; | 529 | int error = EFAULT; |
532 | 530 | ||
531 | if (IS_RDONLY(&vp->v_inode)) | ||
532 | return -EROFS; | ||
533 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) | 533 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) |
534 | return EPERM; | 534 | return EPERM; |
535 | if (len > XATTR_SIZE_MAX) | 535 | if (len > XATTR_SIZE_MAX) |
@@ -557,6 +557,9 @@ xfs_attrmulti_attr_remove( | |||
557 | { | 557 | { |
558 | int error; | 558 | int error; |
559 | 559 | ||
560 | |||
561 | if (IS_RDONLY(&vp->v_inode)) | ||
562 | return -EROFS; | ||
560 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) | 563 | if (IS_IMMUTABLE(&vp->v_inode) || IS_APPEND(&vp->v_inode)) |
561 | return EPERM; | 564 | return EPERM; |
562 | 565 | ||
@@ -745,9 +748,8 @@ xfs_ioctl( | |||
745 | (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? | 748 | (ip->i_d.di_flags & XFS_DIFLAG_REALTIME) ? |
746 | mp->m_rtdev_targp : mp->m_ddev_targp; | 749 | mp->m_rtdev_targp : mp->m_ddev_targp; |
747 | 750 | ||
748 | da.d_mem = da.d_miniosz = 1 << target->pbr_sshift; | 751 | da.d_mem = da.d_miniosz = 1 << target->bt_sshift; |
749 | /* The size dio will do in one go */ | 752 | da.d_maxiosz = INT_MAX & ~(da.d_miniosz - 1); |
750 | da.d_maxiosz = 64 * PAGE_CACHE_SIZE; | ||
751 | 753 | ||
752 | if (copy_to_user(arg, &da, sizeof(da))) | 754 | if (copy_to_user(arg, &da, sizeof(da))) |
753 | return -XFS_ERROR(EFAULT); | 755 | return -XFS_ERROR(EFAULT); |