aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-17 01:25:36 -0500
committerNathan Scott <nathans@sgi.com>2006-03-17 01:25:36 -0500
commitec86dc02fdc062d0d298814b1e78b482ab38caf7 (patch)
tree2746adfa5471f7026cdd5a9ba4c4853de6795256 /fs/xfs/linux-2.6
parent8867bc9bf0aed7181aa72c7c938c6ce830b75166 (diff)
[XFS] Complete transition away from linvfs naming convention, finally.
SGI-PV: 947038 SGI-Modid: xfs-linux-melb:xfs-kern:25474a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c12
-rw-r--r--fs/xfs/linux-2.6/xfs_export.c10
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c30
-rw-r--r--fs/xfs/linux-2.6/xfs_fs_subr.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c8
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl32.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c48
-rw-r--r--fs/xfs/linux-2.6/xfs_linux.h2
-rw-r--r--fs/xfs/linux-2.6/xfs_lrw.c2
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c52
-rw-r--r--fs/xfs/linux-2.6/xfs_super.h5
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c17
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h3
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h32
15 files changed, 124 insertions, 111 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 2b610c7ba322..448912f0e753 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -76,7 +76,7 @@ xfs_page_trace(
76 int mask) 76 int mask)
77{ 77{
78 xfs_inode_t *ip; 78 xfs_inode_t *ip;
79 vnode_t *vp = LINVFS_GET_VP(inode); 79 vnode_t *vp = vn_from_inode(inode);
80 loff_t isize = i_size_read(inode); 80 loff_t isize = i_size_read(inode);
81 loff_t offset = page_offset(page); 81 loff_t offset = page_offset(page);
82 int delalloc = -1, unmapped = -1, unwritten = -1; 82 int delalloc = -1, unmapped = -1, unwritten = -1;
@@ -214,7 +214,7 @@ xfs_alloc_ioend(
214 ioend->io_uptodate = 1; /* cleared if any I/O fails */ 214 ioend->io_uptodate = 1; /* cleared if any I/O fails */
215 ioend->io_list = NULL; 215 ioend->io_list = NULL;
216 ioend->io_type = type; 216 ioend->io_type = type;
217 ioend->io_vnode = LINVFS_GET_VP(inode); 217 ioend->io_vnode = vn_from_inode(inode);
218 ioend->io_buffer_head = NULL; 218 ioend->io_buffer_head = NULL;
219 ioend->io_buffer_tail = NULL; 219 ioend->io_buffer_tail = NULL;
220 atomic_inc(&ioend->io_vnode->v_iocount); 220 atomic_inc(&ioend->io_vnode->v_iocount);
@@ -239,7 +239,7 @@ xfs_map_blocks(
239 xfs_iomap_t *mapp, 239 xfs_iomap_t *mapp,
240 int flags) 240 int flags)
241{ 241{
242 vnode_t *vp = LINVFS_GET_VP(inode); 242 vnode_t *vp = vn_from_inode(inode);
243 int error, nmaps = 1; 243 int error, nmaps = 1;
244 244
245 VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error); 245 VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error);
@@ -1229,7 +1229,7 @@ __xfs_get_block(
1229 int direct, 1229 int direct,
1230 bmapi_flags_t flags) 1230 bmapi_flags_t flags)
1231{ 1231{
1232 vnode_t *vp = LINVFS_GET_VP(inode); 1232 vnode_t *vp = vn_from_inode(inode);
1233 xfs_iomap_t iomap; 1233 xfs_iomap_t iomap;
1234 xfs_off_t offset; 1234 xfs_off_t offset;
1235 ssize_t size; 1235 ssize_t size;
@@ -1371,7 +1371,7 @@ xfs_vm_direct_IO(
1371{ 1371{
1372 struct file *file = iocb->ki_filp; 1372 struct file *file = iocb->ki_filp;
1373 struct inode *inode = file->f_mapping->host; 1373 struct inode *inode = file->f_mapping->host;
1374 vnode_t *vp = LINVFS_GET_VP(inode); 1374 vnode_t *vp = vn_from_inode(inode);
1375 xfs_iomap_t iomap; 1375 xfs_iomap_t iomap;
1376 int maps = 1; 1376 int maps = 1;
1377 int error; 1377 int error;
@@ -1410,7 +1410,7 @@ xfs_vm_bmap(
1410 sector_t block) 1410 sector_t block)
1411{ 1411{
1412 struct inode *inode = (struct inode *)mapping->host; 1412 struct inode *inode = (struct inode *)mapping->host;
1413 vnode_t *vp = LINVFS_GET_VP(inode); 1413 vnode_t *vp = vn_from_inode(inode);
1414 int error; 1414 int error;
1415 1415
1416 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 1416 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
index 391c1353cd42..b768ea910bbe 100644
--- a/fs/xfs/linux-2.6/xfs_export.c
+++ b/fs/xfs/linux-2.6/xfs_export.c
@@ -97,7 +97,7 @@ xfs_fs_encode_fh(
97 int len; 97 int len;
98 int is64 = 0; 98 int is64 = 0;
99#if XFS_BIG_INUMS 99#if XFS_BIG_INUMS
100 vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb); 100 vfs_t *vfs = vfs_from_sb(inode->i_sb);
101 101
102 if (!(vfs->vfs_flag & VFS_32BITINODES)) { 102 if (!(vfs->vfs_flag & VFS_32BITINODES)) {
103 /* filesystem may contain 64bit inode numbers */ 103 /* filesystem may contain 64bit inode numbers */
@@ -139,14 +139,14 @@ xfs_fs_get_dentry(
139 vnode_t *vp; 139 vnode_t *vp;
140 struct inode *inode; 140 struct inode *inode;
141 struct dentry *result; 141 struct dentry *result;
142 vfs_t *vfsp = LINVFS_GET_VFS(sb); 142 vfs_t *vfsp = vfs_from_sb(sb);
143 int error; 143 int error;
144 144
145 VFS_VGET(vfsp, &vp, (fid_t *)data, error); 145 VFS_VGET(vfsp, &vp, (fid_t *)data, error);
146 if (error || vp == NULL) 146 if (error || vp == NULL)
147 return ERR_PTR(-ESTALE) ; 147 return ERR_PTR(-ESTALE) ;
148 148
149 inode = LINVFS_GET_IP(vp); 149 inode = vn_to_inode(vp);
150 result = d_alloc_anon(inode); 150 result = d_alloc_anon(inode);
151 if (!result) { 151 if (!result) {
152 iput(inode); 152 iput(inode);
@@ -164,12 +164,12 @@ xfs_fs_get_parent(
164 struct dentry *parent; 164 struct dentry *parent;
165 165
166 cvp = NULL; 166 cvp = NULL;
167 vp = LINVFS_GET_VP(child->d_inode); 167 vp = vn_from_inode(child->d_inode);
168 VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); 168 VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error);
169 if (unlikely(error)) 169 if (unlikely(error))
170 return ERR_PTR(-error); 170 return ERR_PTR(-error);
171 171
172 parent = d_alloc_anon(LINVFS_GET_IP(cvp)); 172 parent = d_alloc_anon(vn_to_inode(cvp));
173 if (unlikely(!parent)) { 173 if (unlikely(!parent)) {
174 VN_RELE(cvp); 174 VN_RELE(cvp);
175 return ERR_PTR(-ENOMEM); 175 return ERR_PTR(-ENOMEM);
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index c271c9936498..185567a6a561 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -58,7 +58,7 @@ __xfs_file_read(
58{ 58{
59 struct iovec iov = {buf, count}; 59 struct iovec iov = {buf, count};
60 struct file *file = iocb->ki_filp; 60 struct file *file = iocb->ki_filp;
61 vnode_t *vp = LINVFS_GET_VP(file->f_dentry->d_inode); 61 vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
62 ssize_t rval; 62 ssize_t rval;
63 63
64 BUG_ON(iocb->ki_pos != pos); 64 BUG_ON(iocb->ki_pos != pos);
@@ -102,7 +102,7 @@ __xfs_file_write(
102 struct iovec iov = {(void __user *)buf, count}; 102 struct iovec iov = {(void __user *)buf, count};
103 struct file *file = iocb->ki_filp; 103 struct file *file = iocb->ki_filp;
104 struct inode *inode = file->f_mapping->host; 104 struct inode *inode = file->f_mapping->host;
105 vnode_t *vp = LINVFS_GET_VP(inode); 105 vnode_t *vp = vn_from_inode(inode);
106 ssize_t rval; 106 ssize_t rval;
107 107
108 BUG_ON(iocb->ki_pos != pos); 108 BUG_ON(iocb->ki_pos != pos);
@@ -144,7 +144,7 @@ __xfs_file_readv(
144 loff_t *ppos) 144 loff_t *ppos)
145{ 145{
146 struct inode *inode = file->f_mapping->host; 146 struct inode *inode = file->f_mapping->host;
147 vnode_t *vp = LINVFS_GET_VP(inode); 147 vnode_t *vp = vn_from_inode(inode);
148 struct kiocb kiocb; 148 struct kiocb kiocb;
149 ssize_t rval; 149 ssize_t rval;
150 150
@@ -189,7 +189,7 @@ __xfs_file_writev(
189 loff_t *ppos) 189 loff_t *ppos)
190{ 190{
191 struct inode *inode = file->f_mapping->host; 191 struct inode *inode = file->f_mapping->host;
192 vnode_t *vp = LINVFS_GET_VP(inode); 192 vnode_t *vp = vn_from_inode(inode);
193 struct kiocb kiocb; 193 struct kiocb kiocb;
194 ssize_t rval; 194 ssize_t rval;
195 195
@@ -233,7 +233,7 @@ xfs_file_sendfile(
233 read_actor_t actor, 233 read_actor_t actor,
234 void *target) 234 void *target)
235{ 235{
236 vnode_t *vp = LINVFS_GET_VP(filp->f_dentry->d_inode); 236 vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
237 ssize_t rval; 237 ssize_t rval;
238 238
239 VOP_SENDFILE(vp, filp, ppos, 0, count, actor, target, NULL, rval); 239 VOP_SENDFILE(vp, filp, ppos, 0, count, actor, target, NULL, rval);
@@ -246,7 +246,7 @@ xfs_file_open(
246 struct inode *inode, 246 struct inode *inode,
247 struct file *filp) 247 struct file *filp)
248{ 248{
249 vnode_t *vp = LINVFS_GET_VP(inode); 249 vnode_t *vp = vn_from_inode(inode);
250 int error; 250 int error;
251 251
252 if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) 252 if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
@@ -263,7 +263,7 @@ xfs_file_release(
263 struct inode *inode, 263 struct inode *inode,
264 struct file *filp) 264 struct file *filp)
265{ 265{
266 vnode_t *vp = LINVFS_GET_VP(inode); 266 vnode_t *vp = vn_from_inode(inode);
267 int error = 0; 267 int error = 0;
268 268
269 if (vp) 269 if (vp)
@@ -279,7 +279,7 @@ xfs_file_fsync(
279 int datasync) 279 int datasync)
280{ 280{
281 struct inode *inode = dentry->d_inode; 281 struct inode *inode = dentry->d_inode;
282 vnode_t *vp = LINVFS_GET_VP(inode); 282 vnode_t *vp = vn_from_inode(inode);
283 int error; 283 int error;
284 int flags = FSYNC_WAIT; 284 int flags = FSYNC_WAIT;
285 285
@@ -307,7 +307,7 @@ xfs_vm_nopage(
307 int *type) 307 int *type)
308{ 308{
309 struct inode *inode = area->vm_file->f_dentry->d_inode; 309 struct inode *inode = area->vm_file->f_dentry->d_inode;
310 vnode_t *vp = LINVFS_GET_VP(inode); 310 vnode_t *vp = vn_from_inode(inode);
311 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 311 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
312 int error; 312 int error;
313 313
@@ -340,7 +340,7 @@ xfs_file_readdir(
340 xfs_off_t start_offset, curr_offset; 340 xfs_off_t start_offset, curr_offset;
341 xfs_dirent_t *dbp = NULL; 341 xfs_dirent_t *dbp = NULL;
342 342
343 vp = LINVFS_GET_VP(filp->f_dentry->d_inode); 343 vp = vn_from_inode(filp->f_dentry->d_inode);
344 ASSERT(vp); 344 ASSERT(vp);
345 345
346 /* Try fairly hard to get memory */ 346 /* Try fairly hard to get memory */
@@ -409,7 +409,7 @@ xfs_file_mmap(
409 struct vm_area_struct *vma) 409 struct vm_area_struct *vma)
410{ 410{
411 struct inode *ip = filp->f_dentry->d_inode; 411 struct inode *ip = filp->f_dentry->d_inode;
412 vnode_t *vp = LINVFS_GET_VP(ip); 412 vnode_t *vp = vn_from_inode(ip);
413 vattr_t vattr; 413 vattr_t vattr;
414 int error; 414 int error;
415 415
@@ -437,7 +437,7 @@ xfs_file_ioctl(
437{ 437{
438 int error; 438 int error;
439 struct inode *inode = filp->f_dentry->d_inode; 439 struct inode *inode = filp->f_dentry->d_inode;
440 vnode_t *vp = LINVFS_GET_VP(inode); 440 vnode_t *vp = vn_from_inode(inode);
441 441
442 VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error); 442 VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error);
443 VMODIFY(vp); 443 VMODIFY(vp);
@@ -459,7 +459,7 @@ xfs_file_ioctl_invis(
459{ 459{
460 int error; 460 int error;
461 struct inode *inode = filp->f_dentry->d_inode; 461 struct inode *inode = filp->f_dentry->d_inode;
462 vnode_t *vp = LINVFS_GET_VP(inode); 462 vnode_t *vp = vn_from_inode(inode);
463 463
464 ASSERT(vp); 464 ASSERT(vp);
465 VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error); 465 VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error);
@@ -481,7 +481,7 @@ xfs_vm_mprotect(
481 struct vm_area_struct *vma, 481 struct vm_area_struct *vma,
482 unsigned int newflags) 482 unsigned int newflags)
483{ 483{
484 vnode_t *vp = LINVFS_GET_VP(vma->vm_file->f_dentry->d_inode); 484 vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode);
485 int error = 0; 485 int error = 0;
486 486
487 if (vp->v_vfsp->vfs_flag & VFS_DMI) { 487 if (vp->v_vfsp->vfs_flag & VFS_DMI) {
@@ -507,7 +507,7 @@ STATIC int
507xfs_file_open_exec( 507xfs_file_open_exec(
508 struct inode *inode) 508 struct inode *inode)
509{ 509{
510 vnode_t *vp = LINVFS_GET_VP(inode); 510 vnode_t *vp = vn_from_inode(inode);
511 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 511 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
512 int error = 0; 512 int error = 0;
513 xfs_inode_t *ip; 513 xfs_inode_t *ip;
diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c
index 4fa4b1a5187e..575f2a790f31 100644
--- a/fs/xfs/linux-2.6/xfs_fs_subr.c
+++ b/fs/xfs/linux-2.6/xfs_fs_subr.c
@@ -57,7 +57,7 @@ fs_tosspages(
57 int fiopt) 57 int fiopt)
58{ 58{
59 vnode_t *vp = BHV_TO_VNODE(bdp); 59 vnode_t *vp = BHV_TO_VNODE(bdp);
60 struct inode *ip = LINVFS_GET_IP(vp); 60 struct inode *ip = vn_to_inode(vp);
61 61
62 if (VN_CACHED(vp)) 62 if (VN_CACHED(vp))
63 truncate_inode_pages(ip->i_mapping, first); 63 truncate_inode_pages(ip->i_mapping, first);
@@ -76,7 +76,7 @@ fs_flushinval_pages(
76 int fiopt) 76 int fiopt)
77{ 77{
78 vnode_t *vp = BHV_TO_VNODE(bdp); 78 vnode_t *vp = BHV_TO_VNODE(bdp);
79 struct inode *ip = LINVFS_GET_IP(vp); 79 struct inode *ip = vn_to_inode(vp);
80 80
81 if (VN_CACHED(vp)) { 81 if (VN_CACHED(vp)) {
82 filemap_write_and_wait(ip->i_mapping); 82 filemap_write_and_wait(ip->i_mapping);
@@ -98,7 +98,7 @@ fs_flush_pages(
98 int fiopt) 98 int fiopt)
99{ 99{
100 vnode_t *vp = BHV_TO_VNODE(bdp); 100 vnode_t *vp = BHV_TO_VNODE(bdp);
101 struct inode *ip = LINVFS_GET_IP(vp); 101 struct inode *ip = vn_to_inode(vp);
102 102
103 if (VN_CACHED(vp)) { 103 if (VN_CACHED(vp)) {
104 filemap_fdatawrite(ip->i_mapping); 104 filemap_fdatawrite(ip->i_mapping);
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index e435ad17419d..84478491609b 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -138,7 +138,7 @@ xfs_find_handle(
138 } 138 }
139 139
140 /* we need the vnode */ 140 /* we need the vnode */
141 vp = LINVFS_GET_VP(inode); 141 vp = vn_from_inode(inode);
142 142
143 /* now we can grab the fsid */ 143 /* now we can grab the fsid */
144 memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t)); 144 memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t));
@@ -256,7 +256,7 @@ xfs_vget_fsop_handlereq(
256 } 256 }
257 257
258 vpp = XFS_ITOV(ip); 258 vpp = XFS_ITOV(ip);
259 inodep = LINVFS_GET_IP(vpp); 259 inodep = vn_to_inode(vpp);
260 xfs_iunlock(ip, XFS_ILOCK_SHARED); 260 xfs_iunlock(ip, XFS_ILOCK_SHARED);
261 261
262 *vp = vpp; 262 *vp = vpp;
@@ -715,7 +715,7 @@ xfs_ioctl(
715 xfs_inode_t *ip; 715 xfs_inode_t *ip;
716 xfs_mount_t *mp; 716 xfs_mount_t *mp;
717 717
718 vp = LINVFS_GET_VP(inode); 718 vp = vn_from_inode(inode);
719 719
720 vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address); 720 vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address);
721 721
@@ -1270,7 +1270,7 @@ xfs_ioc_xattr(
1270 } 1270 }
1271 1271
1272 case XFS_IOC_GETVERSION: { 1272 case XFS_IOC_GETVERSION: {
1273 flags = LINVFS_GET_IP(vp)->i_generation; 1273 flags = vn_to_inode(vp)->i_generation;
1274 if (copy_to_user(arg, &flags, sizeof(flags))) 1274 if (copy_to_user(arg, &flags, sizeof(flags)))
1275 error = -EFAULT; 1275 error = -EFAULT;
1276 break; 1276 break;
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c
index e9da0bde36a6..b6321abd9a81 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl32.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl32.c
@@ -111,7 +111,7 @@ xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg)
111{ 111{
112 int error; 112 int error;
113 struct inode *inode = f->f_dentry->d_inode; 113 struct inode *inode = f->f_dentry->d_inode;
114 vnode_t *vp = LINVFS_GET_VP(inode); 114 vnode_t *vp = vn_to_inode(inode);
115 115
116 switch (cmd) { 116 switch (cmd) {
117 case XFS_IOC_DIOINFO: 117 case XFS_IOC_DIOINFO:
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 0a508580e572..64c3395074de 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -106,7 +106,7 @@ xfs_ichgtime(
106 xfs_inode_t *ip, 106 xfs_inode_t *ip,
107 int flags) 107 int flags)
108{ 108{
109 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); 109 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
110 timespec_t tv; 110 timespec_t tv;
111 111
112 nanotime(&tv); 112 nanotime(&tv);
@@ -202,7 +202,7 @@ xfs_validate_fields(
202 struct inode *ip, 202 struct inode *ip,
203 struct vattr *vattr) 203 struct vattr *vattr)
204{ 204{
205 vnode_t *vp = LINVFS_GET_VP(ip); 205 vnode_t *vp = vn_from_inode(ip);
206 int error; 206 int error;
207 207
208 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; 208 vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
@@ -228,7 +228,7 @@ xfs_init_security(
228 struct vnode *vp, 228 struct vnode *vp,
229 struct inode *dir) 229 struct inode *dir)
230{ 230{
231 struct inode *ip = LINVFS_GET_IP(vp); 231 struct inode *ip = vn_to_inode(vp);
232 size_t length; 232 size_t length;
233 void *value; 233 void *value;
234 char *name; 234 char *name;
@@ -277,7 +277,7 @@ xfs_cleanup_inode(
277 * xfs_init_security we must back out. 277 * xfs_init_security we must back out.
278 * ENOSPC can hit here, among other things. 278 * ENOSPC can hit here, among other things.
279 */ 279 */
280 teardown.d_inode = LINVFS_GET_IP(vp); 280 teardown.d_inode = vn_to_inode(vp);
281 teardown.d_name = dentry->d_name; 281 teardown.d_name = dentry->d_name;
282 282
283 if (S_ISDIR(mode)) 283 if (S_ISDIR(mode))
@@ -296,7 +296,7 @@ xfs_vn_mknod(
296{ 296{
297 struct inode *ip; 297 struct inode *ip;
298 vattr_t vattr = { 0 }; 298 vattr_t vattr = { 0 };
299 vnode_t *vp = NULL, *dvp = LINVFS_GET_VP(dir); 299 vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
300 xfs_acl_t *default_acl = NULL; 300 xfs_acl_t *default_acl = NULL;
301 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; 301 attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
302 int error; 302 int error;
@@ -359,7 +359,7 @@ xfs_vn_mknod(
359 359
360 if (likely(!error)) { 360 if (likely(!error)) {
361 ASSERT(vp); 361 ASSERT(vp);
362 ip = LINVFS_GET_IP(vp); 362 ip = vn_to_inode(vp);
363 363
364 if (S_ISCHR(mode) || S_ISBLK(mode)) 364 if (S_ISCHR(mode) || S_ISBLK(mode))
365 ip->i_rdev = rdev; 365 ip->i_rdev = rdev;
@@ -396,7 +396,7 @@ xfs_vn_lookup(
396 struct dentry *dentry, 396 struct dentry *dentry,
397 struct nameidata *nd) 397 struct nameidata *nd)
398{ 398{
399 struct vnode *vp = LINVFS_GET_VP(dir), *cvp; 399 struct vnode *vp = vn_from_inode(dir), *cvp;
400 int error; 400 int error;
401 401
402 if (dentry->d_name.len >= MAXNAMELEN) 402 if (dentry->d_name.len >= MAXNAMELEN)
@@ -410,7 +410,7 @@ xfs_vn_lookup(
410 return NULL; 410 return NULL;
411 } 411 }
412 412
413 return d_splice_alias(LINVFS_GET_IP(cvp), dentry); 413 return d_splice_alias(vn_to_inode(cvp), dentry);
414} 414}
415 415
416STATIC int 416STATIC int
@@ -429,8 +429,8 @@ xfs_vn_link(
429 if (S_ISDIR(ip->i_mode)) 429 if (S_ISDIR(ip->i_mode))
430 return -EPERM; 430 return -EPERM;
431 431
432 tdvp = LINVFS_GET_VP(dir); 432 tdvp = vn_from_inode(dir);
433 vp = LINVFS_GET_VP(ip); 433 vp = vn_from_inode(ip);
434 434
435 VOP_LINK(tdvp, vp, dentry, NULL, error); 435 VOP_LINK(tdvp, vp, dentry, NULL, error);
436 if (likely(!error)) { 436 if (likely(!error)) {
@@ -453,7 +453,7 @@ xfs_vn_unlink(
453 int error; 453 int error;
454 454
455 inode = dentry->d_inode; 455 inode = dentry->d_inode;
456 dvp = LINVFS_GET_VP(dir); 456 dvp = vn_from_inode(dir);
457 457
458 VOP_REMOVE(dvp, dentry, NULL, error); 458 VOP_REMOVE(dvp, dentry, NULL, error);
459 if (likely(!error)) { 459 if (likely(!error)) {
@@ -475,7 +475,7 @@ xfs_vn_symlink(
475 vnode_t *cvp; /* used to lookup symlink to put in dentry */ 475 vnode_t *cvp; /* used to lookup symlink to put in dentry */
476 int error; 476 int error;
477 477
478 dvp = LINVFS_GET_VP(dir); 478 dvp = vn_from_inode(dir);
479 cvp = NULL; 479 cvp = NULL;
480 480
481 vattr.va_mode = S_IFLNK | 481 vattr.va_mode = S_IFLNK |
@@ -487,7 +487,7 @@ xfs_vn_symlink(
487 if (likely(!error && cvp)) { 487 if (likely(!error && cvp)) {
488 error = xfs_init_security(cvp, dir); 488 error = xfs_init_security(cvp, dir);
489 if (likely(!error)) { 489 if (likely(!error)) {
490 ip = LINVFS_GET_IP(cvp); 490 ip = vn_to_inode(cvp);
491 d_instantiate(dentry, ip); 491 d_instantiate(dentry, ip);
492 xfs_validate_fields(dir, &vattr); 492 xfs_validate_fields(dir, &vattr);
493 xfs_validate_fields(ip, &vattr); 493 xfs_validate_fields(ip, &vattr);
@@ -502,7 +502,7 @@ xfs_vn_rmdir(
502 struct dentry *dentry) 502 struct dentry *dentry)
503{ 503{
504 struct inode *inode = dentry->d_inode; 504 struct inode *inode = dentry->d_inode;
505 vnode_t *dvp = LINVFS_GET_VP(dir); 505 vnode_t *dvp = vn_from_inode(dir);
506 vattr_t vattr; 506 vattr_t vattr;
507 int error; 507 int error;
508 508
@@ -527,8 +527,8 @@ xfs_vn_rename(
527 vattr_t vattr; 527 vattr_t vattr;
528 int error; 528 int error;
529 529
530 fvp = LINVFS_GET_VP(odir); 530 fvp = vn_from_inode(odir);
531 tvp = LINVFS_GET_VP(ndir); 531 tvp = vn_from_inode(ndir);
532 532
533 VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error); 533 VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error);
534 if (likely(!error)) { 534 if (likely(!error)) {
@@ -573,7 +573,7 @@ xfs_vn_follow_link(
573 return NULL; 573 return NULL;
574 } 574 }
575 575
576 vp = LINVFS_GET_VP(dentry->d_inode); 576 vp = vn_from_inode(dentry->d_inode);
577 577
578 iov.iov_base = link; 578 iov.iov_base = link;
579 iov.iov_len = MAXPATHLEN; 579 iov.iov_len = MAXPATHLEN;
@@ -616,7 +616,7 @@ xfs_vn_permission(
616 int mode, 616 int mode,
617 struct nameidata *nd) 617 struct nameidata *nd)
618{ 618{
619 vnode_t *vp = LINVFS_GET_VP(inode); 619 vnode_t *vp = vn_from_inode(inode);
620 int error; 620 int error;
621 621
622 mode <<= 6; /* convert from linux to vnode access bits */ 622 mode <<= 6; /* convert from linux to vnode access bits */
@@ -634,7 +634,7 @@ xfs_vn_getattr(
634 struct kstat *stat) 634 struct kstat *stat)
635{ 635{
636 struct inode *inode = dentry->d_inode; 636 struct inode *inode = dentry->d_inode;
637 vnode_t *vp = LINVFS_GET_VP(inode); 637 vnode_t *vp = vn_from_inode(inode);
638 int error = 0; 638 int error = 0;
639 639
640 if (unlikely(vp->v_flag & VMODIFIED)) 640 if (unlikely(vp->v_flag & VMODIFIED))
@@ -651,7 +651,7 @@ xfs_vn_setattr(
651{ 651{
652 struct inode *inode = dentry->d_inode; 652 struct inode *inode = dentry->d_inode;
653 unsigned int ia_valid = attr->ia_valid; 653 unsigned int ia_valid = attr->ia_valid;
654 vnode_t *vp = LINVFS_GET_VP(inode); 654 vnode_t *vp = vn_from_inode(inode);
655 vattr_t vattr = { 0 }; 655 vattr_t vattr = { 0 };
656 int flags = 0; 656 int flags = 0;
657 int error; 657 int error;
@@ -717,7 +717,7 @@ xfs_vn_setxattr(
717 size_t size, 717 size_t size,
718 int flags) 718 int flags)
719{ 719{
720 vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); 720 vnode_t *vp = vn_from_inode(dentry->d_inode);
721 char *attr = (char *)name; 721 char *attr = (char *)name;
722 attrnames_t *namesp; 722 attrnames_t *namesp;
723 int xflags = 0; 723 int xflags = 0;
@@ -747,7 +747,7 @@ xfs_vn_getxattr(
747 void *data, 747 void *data,
748 size_t size) 748 size_t size)
749{ 749{
750 vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); 750 vnode_t *vp = vn_from_inode(dentry->d_inode);
751 char *attr = (char *)name; 751 char *attr = (char *)name;
752 attrnames_t *namesp; 752 attrnames_t *namesp;
753 int xflags = 0; 753 int xflags = 0;
@@ -776,7 +776,7 @@ xfs_vn_listxattr(
776 char *data, 776 char *data,
777 size_t size) 777 size_t size)
778{ 778{
779 vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); 779 vnode_t *vp = vn_from_inode(dentry->d_inode);
780 int error, xflags = ATTR_KERNAMELS; 780 int error, xflags = ATTR_KERNAMELS;
781 ssize_t result; 781 ssize_t result;
782 782
@@ -795,7 +795,7 @@ xfs_vn_removexattr(
795 struct dentry *dentry, 795 struct dentry *dentry,
796 const char *name) 796 const char *name)
797{ 797{
798 vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); 798 vnode_t *vp = vn_from_inode(dentry->d_inode);
799 char *attr = (char *)name; 799 char *attr = (char *)name;
800 attrnames_t *namesp; 800 attrnames_t *namesp;
801 int xflags = 0; 801 int xflags = 0;
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h
index bd88ccb0cad0..1fe09f2d6519 100644
--- a/fs/xfs/linux-2.6/xfs_linux.h
+++ b/fs/xfs/linux-2.6/xfs_linux.h
@@ -234,7 +234,7 @@ BUFFER_FNS(PrivateStart, unwritten);
234#define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) 234#define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL)
235#define xfs_stack_trace() dump_stack() 235#define xfs_stack_trace() dump_stack()
236#define xfs_itruncate_data(ip, off) \ 236#define xfs_itruncate_data(ip, off) \
237 (-vmtruncate(LINVFS_GET_IP(XFS_ITOV(ip)), (off))) 237 (-vmtruncate(vn_to_inode(XFS_ITOV(ip)), (off)))
238#define xfs_statvfs_fsid(statp, mp) \ 238#define xfs_statvfs_fsid(statp, mp) \
239 ({ u64 id = huge_encode_dev((mp)->m_ddev_targp->bt_dev); \ 239 ({ u64 id = huge_encode_dev((mp)->m_ddev_targp->bt_dev); \
240 __kernel_fsid_t *fsid = &(statp)->f_fsid; \ 240 __kernel_fsid_t *fsid = &(statp)->f_fsid; \
diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c
index e0ab45fbfebd..2ede4bb7ecd0 100644
--- a/fs/xfs/linux-2.6/xfs_lrw.c
+++ b/fs/xfs/linux-2.6/xfs_lrw.c
@@ -432,7 +432,7 @@ xfs_zero_eof(
432 xfs_fsize_t isize, /* current inode size */ 432 xfs_fsize_t isize, /* current inode size */
433 xfs_fsize_t end_size) /* terminal inode size */ 433 xfs_fsize_t end_size) /* terminal inode size */
434{ 434{
435 struct inode *ip = LINVFS_GET_IP(vp); 435 struct inode *ip = vn_to_inode(vp);
436 xfs_fileoff_t start_zero_fsb; 436 xfs_fileoff_t start_zero_fsb;
437 xfs_fileoff_t end_zero_fsb; 437 xfs_fileoff_t end_zero_fsb;
438 xfs_fileoff_t zero_count_fsb; 438 xfs_fileoff_t zero_count_fsb;
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 352aa3d40c1f..d9d28a965bac 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -153,7 +153,7 @@ xfs_revalidate_inode(
153 vnode_t *vp, 153 vnode_t *vp,
154 xfs_inode_t *ip) 154 xfs_inode_t *ip)
155{ 155{
156 struct inode *inode = LINVFS_GET_IP(vp); 156 struct inode *inode = vn_to_inode(vp);
157 157
158 inode->i_mode = ip->i_d.di_mode; 158 inode->i_mode = ip->i_d.di_mode;
159 inode->i_nlink = ip->i_d.di_nlink; 159 inode->i_nlink = ip->i_d.di_nlink;
@@ -210,7 +210,7 @@ xfs_initialize_vnode(
210 int unlock) 210 int unlock)
211{ 211{
212 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv); 212 xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
213 struct inode *inode = LINVFS_GET_IP(vp); 213 struct inode *inode = vn_to_inode(vp);
214 214
215 if (!inode_bhv->bd_vobj) { 215 if (!inode_bhv->bd_vobj) {
216 vp->v_vfsp = bhvtovfs(bdp); 216 vp->v_vfsp = bhvtovfs(bdp);
@@ -228,7 +228,7 @@ xfs_initialize_vnode(
228 if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) { 228 if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) {
229 xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip); 229 xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
230 xfs_set_inodeops(inode); 230 xfs_set_inodeops(inode);
231 231
232 ip->i_flags &= ~XFS_INEW; 232 ip->i_flags &= ~XFS_INEW;
233 barrier(); 233 barrier();
234 234
@@ -340,14 +340,14 @@ xfs_fs_alloc_inode(
340 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); 340 vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
341 if (unlikely(!vp)) 341 if (unlikely(!vp))
342 return NULL; 342 return NULL;
343 return LINVFS_GET_IP(vp); 343 return vn_to_inode(vp);
344} 344}
345 345
346STATIC void 346STATIC void
347xfs_fs_destroy_inode( 347xfs_fs_destroy_inode(
348 struct inode *inode) 348 struct inode *inode)
349{ 349{
350 kmem_zone_free(xfs_vnode_zone, LINVFS_GET_VP(inode)); 350 kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode));
351} 351}
352 352
353STATIC void 353STATIC void
@@ -358,7 +358,7 @@ xfs_fs_inode_init_once(
358{ 358{
359 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == 359 if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
360 SLAB_CTOR_CONSTRUCTOR) 360 SLAB_CTOR_CONSTRUCTOR)
361 inode_init_once(LINVFS_GET_IP((vnode_t *)vnode)); 361 inode_init_once(vn_to_inode((vnode_t *)vnode));
362} 362}
363 363
364STATIC int 364STATIC int
@@ -409,7 +409,7 @@ xfs_fs_write_inode(
409 struct inode *inode, 409 struct inode *inode,
410 int sync) 410 int sync)
411{ 411{
412 vnode_t *vp = LINVFS_GET_VP(inode); 412 vnode_t *vp = vn_from_inode(inode);
413 int error = 0, flags = FLUSH_INODE; 413 int error = 0, flags = FLUSH_INODE;
414 414
415 if (vp) { 415 if (vp) {
@@ -432,7 +432,7 @@ STATIC void
432xfs_fs_clear_inode( 432xfs_fs_clear_inode(
433 struct inode *inode) 433 struct inode *inode)
434{ 434{
435 vnode_t *vp = LINVFS_GET_VP(inode); 435 vnode_t *vp = vn_from_inode(inode);
436 int error, cache; 436 int error, cache;
437 437
438 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); 438 vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
@@ -511,7 +511,7 @@ void
511xfs_flush_inode( 511xfs_flush_inode(
512 xfs_inode_t *ip) 512 xfs_inode_t *ip)
513{ 513{
514 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); 514 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
515 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 515 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
516 516
517 igrab(inode); 517 igrab(inode);
@@ -536,7 +536,7 @@ void
536xfs_flush_device( 536xfs_flush_device(
537 xfs_inode_t *ip) 537 xfs_inode_t *ip)
538{ 538{
539 struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); 539 struct inode *inode = vn_to_inode(XFS_ITOV(ip));
540 struct vfs *vfs = XFS_MTOVFS(ip->i_mount); 540 struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
541 541
542 igrab(inode); 542 igrab(inode);
@@ -630,7 +630,7 @@ STATIC void
630xfs_fs_put_super( 630xfs_fs_put_super(
631 struct super_block *sb) 631 struct super_block *sb)
632{ 632{
633 vfs_t *vfsp = LINVFS_GET_VFS(sb); 633 vfs_t *vfsp = vfs_from_sb(sb);
634 int error; 634 int error;
635 635
636 xfs_fs_stop_syncd(vfsp); 636 xfs_fs_stop_syncd(vfsp);
@@ -650,7 +650,7 @@ STATIC void
650xfs_fs_write_super( 650xfs_fs_write_super(
651 struct super_block *sb) 651 struct super_block *sb)
652{ 652{
653 vfs_t *vfsp = LINVFS_GET_VFS(sb); 653 vfs_t *vfsp = vfs_from_sb(sb);
654 int error; 654 int error;
655 655
656 if (sb->s_flags & MS_RDONLY) { 656 if (sb->s_flags & MS_RDONLY) {
@@ -667,7 +667,7 @@ xfs_fs_sync_super(
667 struct super_block *sb, 667 struct super_block *sb,
668 int wait) 668 int wait)
669{ 669{
670 vfs_t *vfsp = LINVFS_GET_VFS(sb); 670 vfs_t *vfsp = vfs_from_sb(sb);
671 int error; 671 int error;
672 int flags = SYNC_FSDATA; 672 int flags = SYNC_FSDATA;
673 673
@@ -706,7 +706,7 @@ xfs_fs_statfs(
706 struct super_block *sb, 706 struct super_block *sb,
707 struct kstatfs *statp) 707 struct kstatfs *statp)
708{ 708{
709 vfs_t *vfsp = LINVFS_GET_VFS(sb); 709 vfs_t *vfsp = vfs_from_sb(sb);
710 int error; 710 int error;
711 711
712 VFS_STATVFS(vfsp, statp, NULL, error); 712 VFS_STATVFS(vfsp, statp, NULL, error);
@@ -719,7 +719,7 @@ xfs_fs_remount(
719 int *flags, 719 int *flags,
720 char *options) 720 char *options)
721{ 721{
722 vfs_t *vfsp = LINVFS_GET_VFS(sb); 722 vfs_t *vfsp = vfs_from_sb(sb);
723 struct xfs_mount_args *args = xfs_args_allocate(sb); 723 struct xfs_mount_args *args = xfs_args_allocate(sb);
724 int error; 724 int error;
725 725
@@ -734,7 +734,7 @@ STATIC void
734xfs_fs_lockfs( 734xfs_fs_lockfs(
735 struct super_block *sb) 735 struct super_block *sb)
736{ 736{
737 VFS_FREEZE(LINVFS_GET_VFS(sb)); 737 VFS_FREEZE(vfs_from_sb(sb));
738} 738}
739 739
740STATIC int 740STATIC int
@@ -742,7 +742,7 @@ xfs_fs_show_options(
742 struct seq_file *m, 742 struct seq_file *m,
743 struct vfsmount *mnt) 743 struct vfsmount *mnt)
744{ 744{
745 struct vfs *vfsp = LINVFS_GET_VFS(mnt->mnt_sb); 745 struct vfs *vfsp = vfs_from_sb(mnt->mnt_sb);
746 int error; 746 int error;
747 747
748 VFS_SHOWARGS(vfsp, m, error); 748 VFS_SHOWARGS(vfsp, m, error);
@@ -754,7 +754,7 @@ xfs_fs_quotasync(
754 struct super_block *sb, 754 struct super_block *sb,
755 int type) 755 int type)
756{ 756{
757 struct vfs *vfsp = LINVFS_GET_VFS(sb); 757 struct vfs *vfsp = vfs_from_sb(sb);
758 int error; 758 int error;
759 759
760 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error); 760 VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
@@ -766,7 +766,7 @@ xfs_fs_getxstate(
766 struct super_block *sb, 766 struct super_block *sb,
767 struct fs_quota_stat *fqs) 767 struct fs_quota_stat *fqs)
768{ 768{
769 struct vfs *vfsp = LINVFS_GET_VFS(sb); 769 struct vfs *vfsp = vfs_from_sb(sb);
770 int error; 770 int error;
771 771
772 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error); 772 VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
@@ -779,7 +779,7 @@ xfs_fs_setxstate(
779 unsigned int flags, 779 unsigned int flags,
780 int op) 780 int op)
781{ 781{
782 struct vfs *vfsp = LINVFS_GET_VFS(sb); 782 struct vfs *vfsp = vfs_from_sb(sb);
783 int error; 783 int error;
784 784
785 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error); 785 VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
@@ -793,7 +793,7 @@ xfs_fs_getxquota(
793 qid_t id, 793 qid_t id,
794 struct fs_disk_quota *fdq) 794 struct fs_disk_quota *fdq)
795{ 795{
796 struct vfs *vfsp = LINVFS_GET_VFS(sb); 796 struct vfs *vfsp = vfs_from_sb(sb);
797 int error, getmode; 797 int error, getmode;
798 798
799 getmode = (type == USRQUOTA) ? Q_XGETQUOTA : 799 getmode = (type == USRQUOTA) ? Q_XGETQUOTA :
@@ -809,7 +809,7 @@ xfs_fs_setxquota(
809 qid_t id, 809 qid_t id,
810 struct fs_disk_quota *fdq) 810 struct fs_disk_quota *fdq)
811{ 811{
812 struct vfs *vfsp = LINVFS_GET_VFS(sb); 812 struct vfs *vfsp = vfs_from_sb(sb);
813 int error, setmode; 813 int error, setmode;
814 814
815 setmode = (type == USRQUOTA) ? Q_XSETQLIM : 815 setmode = (type == USRQUOTA) ? Q_XSETQLIM :
@@ -825,15 +825,11 @@ xfs_fs_fill_super(
825 int silent) 825 int silent)
826{ 826{
827 vnode_t *rootvp; 827 vnode_t *rootvp;
828 struct vfs *vfsp = vfs_allocate(); 828 struct vfs *vfsp = vfs_allocate(sb);
829 struct xfs_mount_args *args = xfs_args_allocate(sb); 829 struct xfs_mount_args *args = xfs_args_allocate(sb);
830 struct kstatfs statvfs; 830 struct kstatfs statvfs;
831 int error, error2; 831 int error, error2;
832 832
833 vfsp->vfs_super = sb;
834 LINVFS_SET_VFS(sb, vfsp);
835 if (sb->s_flags & MS_RDONLY)
836 vfsp->vfs_flag |= VFS_RDONLY;
837 bhv_insert_all_vfsops(vfsp); 833 bhv_insert_all_vfsops(vfsp);
838 834
839 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error); 835 VFS_PARSEARGS(vfsp, (char *)data, args, 0, error);
@@ -871,7 +867,7 @@ xfs_fs_fill_super(
871 if (error) 867 if (error)
872 goto fail_unmount; 868 goto fail_unmount;
873 869
874 sb->s_root = d_alloc_root(LINVFS_GET_IP(rootvp)); 870 sb->s_root = d_alloc_root(vn_to_inode(rootvp));
875 if (!sb->s_root) { 871 if (!sb->s_root) {
876 error = ENOMEM; 872 error = ENOMEM;
877 goto fail_vnrele; 873 goto fail_vnrele;
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index 5e1b525cb1eb..376b96cb513a 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -98,11 +98,6 @@ extern void xfs_qm_exit(void);
98 XFS_DMAPI_STRING \ 98 XFS_DMAPI_STRING \
99 XFS_DBG_STRING /* DBG must be last */ 99 XFS_DBG_STRING /* DBG must be last */
100 100
101#define LINVFS_GET_VFS(s) \
102 (vfs_t *)((s)->s_fs_info)
103#define LINVFS_SET_VFS(s, vfsp) \
104 ((s)->s_fs_info = vfsp)
105
106struct xfs_inode; 101struct xfs_inode;
107struct xfs_mount; 102struct xfs_mount;
108struct xfs_buftarg; 103struct xfs_buftarg;
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index a6b4084bda88..6f7c9f7a8624 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -227,7 +227,8 @@ vfs_freeze(
227} 227}
228 228
229vfs_t * 229vfs_t *
230vfs_allocate( void ) 230vfs_allocate(
231 struct super_block *sb)
231{ 232{
232 struct vfs *vfsp; 233 struct vfs *vfsp;
233 234
@@ -236,9 +237,23 @@ vfs_allocate( void )
236 INIT_LIST_HEAD(&vfsp->vfs_sync_list); 237 INIT_LIST_HEAD(&vfsp->vfs_sync_list);
237 spin_lock_init(&vfsp->vfs_sync_lock); 238 spin_lock_init(&vfsp->vfs_sync_lock);
238 init_waitqueue_head(&vfsp->vfs_wait_single_sync_task); 239 init_waitqueue_head(&vfsp->vfs_wait_single_sync_task);
240
241 vfsp->vfs_super = sb;
242 sb->s_fs_info = vfsp;
243
244 if (sb->s_flags & MS_RDONLY)
245 vfsp->vfs_flag |= VFS_RDONLY;
246
239 return vfsp; 247 return vfsp;
240} 248}
241 249
250vfs_t *
251vfs_from_sb(
252 struct super_block *sb)
253{
254 return (vfs_t *)sb->s_fs_info;
255}
256
242void 257void
243vfs_deallocate( 258vfs_deallocate(
244 struct vfs *vfsp) 259 struct vfs *vfsp)
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index 57caf9eddee0..8fed356db055 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -193,7 +193,8 @@ typedef struct bhv_vfsops {
193#define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o)) 193#define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o))
194#define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL ) 194#define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL )
195 195
196extern vfs_t *vfs_allocate(void); 196extern vfs_t *vfs_allocate(struct super_block *);
197extern vfs_t *vfs_from_sb(struct super_block *);
197extern void vfs_deallocate(vfs_t *); 198extern void vfs_deallocate(vfs_t *);
198extern void vfs_insertops(vfs_t *, bhv_vfsops_t *); 199extern void vfs_insertops(vfs_t *, bhv_vfsops_t *);
199extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *); 200extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *);
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 225e7dd8b21d..d27c25b27ccd 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -58,7 +58,7 @@ struct vnode *
58vn_initialize( 58vn_initialize(
59 struct inode *inode) 59 struct inode *inode)
60{ 60{
61 struct vnode *vp = LINVFS_GET_VP(inode); 61 struct vnode *vp = vn_from_inode(inode);
62 62
63 XFS_STATS_INC(vn_active); 63 XFS_STATS_INC(vn_active);
64 XFS_STATS_INC(vn_alloc); 64 XFS_STATS_INC(vn_alloc);
@@ -97,7 +97,7 @@ vn_revalidate_core(
97 struct vnode *vp, 97 struct vnode *vp,
98 vattr_t *vap) 98 vattr_t *vap)
99{ 99{
100 struct inode *inode = LINVFS_GET_IP(vp); 100 struct inode *inode = vn_to_inode(vp);
101 101
102 inode->i_mode = vap->va_mode; 102 inode->i_mode = vap->va_mode;
103 inode->i_nlink = vap->va_nlink; 103 inode->i_nlink = vap->va_nlink;
@@ -166,7 +166,7 @@ vn_hold(
166 XFS_STATS_INC(vn_hold); 166 XFS_STATS_INC(vn_hold);
167 167
168 VN_LOCK(vp); 168 VN_LOCK(vp);
169 inode = igrab(LINVFS_GET_IP(vp)); 169 inode = igrab(vn_to_inode(vp));
170 ASSERT(inode); 170 ASSERT(inode);
171 VN_UNLOCK(vp, 0); 171 VN_UNLOCK(vp, 0);
172 172
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 0cf92ca80ce7..06f5845e9568 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -116,8 +116,14 @@ typedef enum {
116/* 116/*
117 * Vnode to Linux inode mapping. 117 * Vnode to Linux inode mapping.
118 */ 118 */
119#define LINVFS_GET_VP(inode) ((vnode_t *)list_entry(inode, vnode_t, v_inode)) 119static inline struct vnode *vn_from_inode(struct inode *inode)
120#define LINVFS_GET_IP(vp) (&(vp)->v_inode) 120{
121 return (vnode_t *)list_entry(inode, vnode_t, v_inode);
122}
123static inline struct inode *vn_to_inode(struct vnode *vnode)
124{
125 return &vnode->v_inode;
126}
121 127
122/* 128/*
123 * Vnode flags. 129 * Vnode flags.
@@ -498,7 +504,7 @@ extern void vn_iowake(struct vnode *vp);
498 504
499static inline int vn_count(struct vnode *vp) 505static inline int vn_count(struct vnode *vp)
500{ 506{
501 return atomic_read(&LINVFS_GET_IP(vp)->i_count); 507 return atomic_read(&vn_to_inode(vp)->i_count);
502} 508}
503 509
504/* 510/*
@@ -512,16 +518,16 @@ extern vnode_t *vn_hold(struct vnode *);
512 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) 518 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
513#define VN_RELE(vp) \ 519#define VN_RELE(vp) \
514 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ 520 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
515 iput(LINVFS_GET_IP(vp))) 521 iput(vn_to_inode(vp)))
516#else 522#else
517#define VN_HOLD(vp) ((void)vn_hold(vp)) 523#define VN_HOLD(vp) ((void)vn_hold(vp))
518#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) 524#define VN_RELE(vp) (iput(vn_to_inode(vp)))
519#endif 525#endif
520 526
521static inline struct vnode *vn_grab(struct vnode *vp) 527static inline struct vnode *vn_grab(struct vnode *vp)
522{ 528{
523 struct inode *inode = igrab(LINVFS_GET_IP(vp)); 529 struct inode *inode = igrab(vn_to_inode(vp));
524 return inode ? LINVFS_GET_VP(inode) : NULL; 530 return inode ? vn_from_inode(inode) : NULL;
525} 531}
526 532
527/* 533/*
@@ -529,7 +535,7 @@ static inline struct vnode *vn_grab(struct vnode *vp)
529 */ 535 */
530#define VNAME(dentry) ((char *) (dentry)->d_name.name) 536#define VNAME(dentry) ((char *) (dentry)->d_name.name)
531#define VNAMELEN(dentry) ((dentry)->d_name.len) 537#define VNAMELEN(dentry) ((dentry)->d_name.len)
532#define VNAME_TO_VNODE(dentry) (LINVFS_GET_VP((dentry)->d_inode)) 538#define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode))
533 539
534/* 540/*
535 * Vnode spinlock manipulation. 541 * Vnode spinlock manipulation.
@@ -558,12 +564,12 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag)
558 */ 564 */
559static inline void vn_mark_bad(struct vnode *vp) 565static inline void vn_mark_bad(struct vnode *vp)
560{ 566{
561 make_bad_inode(LINVFS_GET_IP(vp)); 567 make_bad_inode(vn_to_inode(vp));
562} 568}
563 569
564static inline int VN_BAD(struct vnode *vp) 570static inline int VN_BAD(struct vnode *vp)
565{ 571{
566 return is_bad_inode(LINVFS_GET_IP(vp)); 572 return is_bad_inode(vn_to_inode(vp));
567} 573}
568 574
569/* 575/*
@@ -588,9 +594,9 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
588/* 594/*
589 * Some useful predicates. 595 * Some useful predicates.
590 */ 596 */
591#define VN_MAPPED(vp) mapping_mapped(LINVFS_GET_IP(vp)->i_mapping) 597#define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping)
592#define VN_CACHED(vp) (LINVFS_GET_IP(vp)->i_mapping->nrpages) 598#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
593#define VN_DIRTY(vp) mapping_tagged(LINVFS_GET_IP(vp)->i_mapping, \ 599#define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \
594 PAGECACHE_TAG_DIRTY) 600 PAGECACHE_TAG_DIRTY)
595#define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED) 601#define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED)
596#define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED) 602#define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED)