aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c31
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c1
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h3
-rw-r--r--fs/xfs/xfs_acl.c5
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--fs/xfs/xfs_vnodeops.c6
9 files changed, 28 insertions, 29 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 83707708ebb1..1d72dbb1a73d 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -261,7 +261,7 @@ xfs_file_mmap(
261 vma->vm_flags |= VM_CAN_NONLINEAR; 261 vma->vm_flags |= VM_CAN_NONLINEAR;
262 262
263#ifdef CONFIG_XFS_DMAPI 263#ifdef CONFIG_XFS_DMAPI
264 if (vn_from_inode(filp->f_path.dentry->d_inode)->v_vfsp->vfs_flag & VFS_DMI) 264 if (vfs_from_sb(filp->f_path.dentry->d_inode->i_sb)->vfs_flag & VFS_DMI)
265 vma->vm_ops = &xfs_dmapi_file_vm_ops; 265 vma->vm_ops = &xfs_dmapi_file_vm_ops;
266#endif /* CONFIG_XFS_DMAPI */ 266#endif /* CONFIG_XFS_DMAPI */
267 267
@@ -320,16 +320,14 @@ xfs_vm_mprotect(
320 struct vm_area_struct *vma, 320 struct vm_area_struct *vma,
321 unsigned int newflags) 321 unsigned int newflags)
322{ 322{
323 bhv_vnode_t *vp = vn_from_inode(vma->vm_file->f_path.dentry->d_inode); 323 struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
324 bhv_vfs_t *vfsp = vfs_from_sb(inode->i_sb);
324 int error = 0; 325 int error = 0;
325 326
326 if (vp->v_vfsp->vfs_flag & VFS_DMI) { 327 if (vfsp->vfs_flag & VFS_DMI) {
327 if ((vma->vm_flags & VM_MAYSHARE) && 328 if ((vma->vm_flags & VM_MAYSHARE) &&
328 (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE)) { 329 (newflags & VM_WRITE) && !(vma->vm_flags & VM_WRITE))
329 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 330 error = XFS_SEND_MMAP(XFS_VFSTOM(vfsp), vma, VM_WRITE);
330
331 error = XFS_SEND_MMAP(mp, vma, VM_WRITE);
332 }
333 } 331 }
334 return error; 332 return error;
335} 333}
@@ -346,18 +344,17 @@ STATIC int
346xfs_file_open_exec( 344xfs_file_open_exec(
347 struct inode *inode) 345 struct inode *inode)
348{ 346{
349 bhv_vnode_t *vp = vn_from_inode(inode); 347 bhv_vfs_t *vfsp = vfs_from_sb(inode->i_sb);
350 348
351 if (unlikely(vp->v_vfsp->vfs_flag & VFS_DMI)) { 349 if (unlikely(vfsp->vfs_flag & VFS_DMI)) {
352 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 350 if (DM_EVENT_ENABLED(XFS_I(inode), DM_EVENT_READ)) {
353 xfs_inode_t *ip = xfs_vtoi(vp); 351 bhv_vnode_t *vp = vn_from_inode(inode);
354 352
355 if (!ip) 353 return -XFS_SEND_DATA(XFS_VFSTOM(vfsp), DM_EVENT_READ,
356 return -EINVAL; 354 vp, 0, 0, 0, NULL);
357 if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) 355 }
358 return -XFS_SEND_DATA(mp, DM_EVENT_READ, vp,
359 0, 0, 0, NULL);
360 } 356 }
357
361 return 0; 358 return 0;
362} 359}
363#endif /* HAVE_FOP_OPEN_EXEC */ 360#endif /* HAVE_FOP_OPEN_EXEC */
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 9bba9f8be1eb..8ff465db909b 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -138,7 +138,8 @@ xfs_find_handle(
138 vp = vn_from_inode(inode); 138 vp = vn_from_inode(inode);
139 139
140 /* now we can grab the fsid */ 140 /* now we can grab the fsid */
141 memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t)); 141 memcpy(&handle.ha_fsid, XFS_MTOVFS(XFS_I(inode)->i_mount)->vfs_altfsid,
142 sizeof(xfs_fsid_t));
142 hsize = sizeof(xfs_fsid_t); 143 hsize = sizeof(xfs_fsid_t);
143 144
144 if (cmd != XFS_IOC_PATH_TO_FSHANDLE) { 145 if (cmd != XFS_IOC_PATH_TO_FSHANDLE) {
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index fb04b11bb815..5b95a7297fd1 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -621,7 +621,7 @@ xfs_write(
621 io = &xip->i_iocore; 621 io = &xip->i_iocore;
622 mp = io->io_mount; 622 mp = io->io_mount;
623 623
624 vfs_wait_for_freeze(vp->v_vfsp, SB_FREEZE_WRITE); 624 vfs_wait_for_freeze(XFS_MTOVFS(mp), SB_FREEZE_WRITE);
625 625
626 if (XFS_FORCED_SHUTDOWN(mp)) 626 if (XFS_FORCED_SHUTDOWN(mp))
627 return -EIO; 627 return -EIO;
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 42d6ed1788ff..650c24ab27e2 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -210,7 +210,6 @@ xfs_initialize_vnode(
210 struct inode *inode = vn_to_inode(vp); 210 struct inode *inode = vn_to_inode(vp);
211 211
212 if (!ip->i_vnode) { 212 if (!ip->i_vnode) {
213 vp->v_vfsp = bhvtovfs(bdp);
214 ip->i_vnode = vp; 213 ip->i_vnode = vp;
215 inode->i_private = ip; 214 inode->i_private = ip;
216 } 215 }
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index ad0494c5c0d1..342c57879901 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -69,8 +69,10 @@ vn_ioerror(
69 char *f, 69 char *f,
70 int l) 70 int l)
71{ 71{
72 bhv_vfs_t *vfsp = vfs_from_sb(vp->v_inode.i_sb);
73
72 if (unlikely(error == -ENODEV)) 74 if (unlikely(error == -ENODEV))
73 bhv_vfs_force_shutdown(vp->v_vfsp, SHUTDOWN_DEVICE_REQ, f, l); 75 bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l);
74} 76}
75 77
76bhv_vnode_t * 78bhv_vnode_t *
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 5abcbd198d73..0f9ba6585c86 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -35,11 +35,10 @@ typedef enum bhv_vflags {
35 35
36/* 36/*
37 * MP locking protocols: 37 * MP locking protocols:
38 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK 38 * v_flag, VN_LOCK/VN_UNLOCK
39 */ 39 */
40typedef struct bhv_vnode { 40typedef struct bhv_vnode {
41 bhv_vflags_t v_flag; /* vnode flags (see above) */ 41 bhv_vflags_t v_flag; /* vnode flags (see above) */
42 bhv_vfs_t *v_vfsp; /* ptr to containing VFS */
43 bhv_vnumber_t v_number; /* in-core vnode number */ 42 bhv_vnumber_t v_number; /* in-core vnode number */
44 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */ 43 spinlock_t v_lock; /* VN_LOCK/VN_UNLOCK */
45 atomic_t v_iocount; /* outstanding I/O count */ 44 atomic_t v_iocount; /* outstanding I/O count */
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 034c5ea80dd1..817d9e93c2c5 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -372,6 +372,7 @@ xfs_acl_allow_set(
372 bhv_vnode_t *vp, 372 bhv_vnode_t *vp,
373 int kind) 373 int kind)
374{ 374{
375 xfs_inode_t *ip = xfs_vtoi(vp);
375 bhv_vattr_t va; 376 bhv_vattr_t va;
376 int error; 377 int error;
377 378
@@ -379,10 +380,10 @@ xfs_acl_allow_set(
379 return EPERM; 380 return EPERM;
380 if (kind == _ACL_TYPE_DEFAULT && !VN_ISDIR(vp)) 381 if (kind == _ACL_TYPE_DEFAULT && !VN_ISDIR(vp))
381 return ENOTDIR; 382 return ENOTDIR;
382 if (vp->v_vfsp->vfs_flag & VFS_RDONLY) 383 if (vp->v_inode.i_sb->s_flags & MS_RDONLY)
383 return EROFS; 384 return EROFS;
384 va.va_mask = XFS_AT_UID; 385 va.va_mask = XFS_AT_UID;
385 error = xfs_getattr(xfs_vtoi(vp), &va, 0); 386 error = xfs_getattr(ip, &va, 0);
386 if (error) 387 if (error)
387 return error; 388 return error;
388 if (va.va_uid != current->fsuid && !capable(CAP_FOWNER)) 389 if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c2fc4838a5fa..c07553bbcdb4 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1154,7 +1154,7 @@ xfs_ialloc(
1154 if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1)) 1154 if ((prid != 0) && (ip->i_d.di_version == XFS_DINODE_VERSION_1))
1155 xfs_bump_ino_vers2(tp, ip); 1155 xfs_bump_ino_vers2(tp, ip);
1156 1156
1157 if (pip && XFS_INHERIT_GID(pip, vp->v_vfsp)) { 1157 if (pip && XFS_INHERIT_GID(pip, XFS_MTOVFS(pip->i_mount))) {
1158 ip->i_d.di_gid = pip->i_d.di_gid; 1158 ip->i_d.di_gid = pip->i_d.di_gid;
1159 if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) { 1159 if ((pip->i_d.di_mode & S_ISGID) && (mode & S_IFMT) == S_IFDIR) {
1160 ip->i_d.di_mode |= S_ISGID; 1160 ip->i_d.di_mode |= S_ISGID;
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 5eb392d06298..7ebbfa0c4f0f 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -230,7 +230,7 @@ xfs_setattr(
230 230
231 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 231 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
232 232
233 if (vp->v_vfsp->vfs_flag & VFS_RDONLY) 233 if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
234 return XFS_ERROR(EROFS); 234 return XFS_ERROR(EROFS);
235 235
236 /* 236 /*
@@ -1515,7 +1515,7 @@ xfs_release(
1515 return 0; 1515 return 0;
1516 1516
1517 /* If this is a read-only mount, don't do this (would generate I/O) */ 1517 /* If this is a read-only mount, don't do this (would generate I/O) */
1518 if (vp->v_vfsp->vfs_flag & VFS_RDONLY) 1518 if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
1519 return 0; 1519 return 0;
1520 1520
1521 if (!XFS_FORCED_SHUTDOWN(mp)) { 1521 if (!XFS_FORCED_SHUTDOWN(mp)) {
@@ -1621,7 +1621,7 @@ xfs_inactive(
1621 error = 0; 1621 error = 0;
1622 1622
1623 /* If this is a read-only mount, don't do this (would generate I/O) */ 1623 /* If this is a read-only mount, don't do this (would generate I/O) */
1624 if (vp->v_vfsp->vfs_flag & VFS_RDONLY) 1624 if (XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY)
1625 goto out; 1625 goto out;
1626 1626
1627 if (ip->i_d.di_nlink != 0) { 1627 if (ip->i_d.di_nlink != 0) {