[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>
This commit is contained in:
Nathan Scott 2006-03-17 17:25:36 +11:00
parent 8867bc9bf0
commit ec86dc02fd
20 changed files with 135 additions and 122 deletions

View File

@ -76,7 +76,7 @@ xfs_page_trace(
int mask) int mask)
{ {
xfs_inode_t *ip; xfs_inode_t *ip;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
loff_t isize = i_size_read(inode); loff_t isize = i_size_read(inode);
loff_t offset = page_offset(page); loff_t offset = page_offset(page);
int delalloc = -1, unmapped = -1, unwritten = -1; int delalloc = -1, unmapped = -1, unwritten = -1;
@ -214,7 +214,7 @@ xfs_alloc_ioend(
ioend->io_uptodate = 1; /* cleared if any I/O fails */ ioend->io_uptodate = 1; /* cleared if any I/O fails */
ioend->io_list = NULL; ioend->io_list = NULL;
ioend->io_type = type; ioend->io_type = type;
ioend->io_vnode = LINVFS_GET_VP(inode); ioend->io_vnode = vn_from_inode(inode);
ioend->io_buffer_head = NULL; ioend->io_buffer_head = NULL;
ioend->io_buffer_tail = NULL; ioend->io_buffer_tail = NULL;
atomic_inc(&ioend->io_vnode->v_iocount); atomic_inc(&ioend->io_vnode->v_iocount);
@ -239,7 +239,7 @@ xfs_map_blocks(
xfs_iomap_t *mapp, xfs_iomap_t *mapp,
int flags) int flags)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error, nmaps = 1; int error, nmaps = 1;
VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error); VOP_BMAP(vp, offset, count, flags, mapp, &nmaps, error);
@ -1229,7 +1229,7 @@ __xfs_get_block(
int direct, int direct,
bmapi_flags_t flags) bmapi_flags_t flags)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap; xfs_iomap_t iomap;
xfs_off_t offset; xfs_off_t offset;
ssize_t size; ssize_t size;
@ -1371,7 +1371,7 @@ xfs_vm_direct_IO(
{ {
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
xfs_iomap_t iomap; xfs_iomap_t iomap;
int maps = 1; int maps = 1;
int error; int error;
@ -1410,7 +1410,7 @@ xfs_vm_bmap(
sector_t block) sector_t block)
{ {
struct inode *inode = (struct inode *)mapping->host; struct inode *inode = (struct inode *)mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error; int error;
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);

View File

@ -97,7 +97,7 @@ xfs_fs_encode_fh(
int len; int len;
int is64 = 0; int is64 = 0;
#if XFS_BIG_INUMS #if XFS_BIG_INUMS
vfs_t *vfs = LINVFS_GET_VFS(inode->i_sb); vfs_t *vfs = vfs_from_sb(inode->i_sb);
if (!(vfs->vfs_flag & VFS_32BITINODES)) { if (!(vfs->vfs_flag & VFS_32BITINODES)) {
/* filesystem may contain 64bit inode numbers */ /* filesystem may contain 64bit inode numbers */
@ -139,14 +139,14 @@ xfs_fs_get_dentry(
vnode_t *vp; vnode_t *vp;
struct inode *inode; struct inode *inode;
struct dentry *result; struct dentry *result;
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_VGET(vfsp, &vp, (fid_t *)data, error); VFS_VGET(vfsp, &vp, (fid_t *)data, error);
if (error || vp == NULL) if (error || vp == NULL)
return ERR_PTR(-ESTALE) ; return ERR_PTR(-ESTALE) ;
inode = LINVFS_GET_IP(vp); inode = vn_to_inode(vp);
result = d_alloc_anon(inode); result = d_alloc_anon(inode);
if (!result) { if (!result) {
iput(inode); iput(inode);
@ -164,12 +164,12 @@ xfs_fs_get_parent(
struct dentry *parent; struct dentry *parent;
cvp = NULL; cvp = NULL;
vp = LINVFS_GET_VP(child->d_inode); vp = vn_from_inode(child->d_inode);
VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error); VOP_LOOKUP(vp, &dotdot, &cvp, 0, NULL, NULL, error);
if (unlikely(error)) if (unlikely(error))
return ERR_PTR(-error); return ERR_PTR(-error);
parent = d_alloc_anon(LINVFS_GET_IP(cvp)); parent = d_alloc_anon(vn_to_inode(cvp));
if (unlikely(!parent)) { if (unlikely(!parent)) {
VN_RELE(cvp); VN_RELE(cvp);
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);

View File

@ -58,7 +58,7 @@ __xfs_file_read(
{ {
struct iovec iov = {buf, count}; struct iovec iov = {buf, count};
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
vnode_t *vp = LINVFS_GET_VP(file->f_dentry->d_inode); vnode_t *vp = vn_from_inode(file->f_dentry->d_inode);
ssize_t rval; ssize_t rval;
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
@ -102,7 +102,7 @@ __xfs_file_write(
struct iovec iov = {(void __user *)buf, count}; struct iovec iov = {(void __user *)buf, count};
struct file *file = iocb->ki_filp; struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
ssize_t rval; ssize_t rval;
BUG_ON(iocb->ki_pos != pos); BUG_ON(iocb->ki_pos != pos);
@ -144,7 +144,7 @@ __xfs_file_readv(
loff_t *ppos) loff_t *ppos)
{ {
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
struct kiocb kiocb; struct kiocb kiocb;
ssize_t rval; ssize_t rval;
@ -189,7 +189,7 @@ __xfs_file_writev(
loff_t *ppos) loff_t *ppos)
{ {
struct inode *inode = file->f_mapping->host; struct inode *inode = file->f_mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
struct kiocb kiocb; struct kiocb kiocb;
ssize_t rval; ssize_t rval;
@ -233,7 +233,7 @@ xfs_file_sendfile(
read_actor_t actor, read_actor_t actor,
void *target) void *target)
{ {
vnode_t *vp = LINVFS_GET_VP(filp->f_dentry->d_inode); vnode_t *vp = vn_from_inode(filp->f_dentry->d_inode);
ssize_t rval; ssize_t rval;
VOP_SENDFILE(vp, filp, ppos, 0, count, actor, target, NULL, rval); VOP_SENDFILE(vp, filp, ppos, 0, count, actor, target, NULL, rval);
@ -246,7 +246,7 @@ xfs_file_open(
struct inode *inode, struct inode *inode,
struct file *filp) struct file *filp)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error; int error;
if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) if (!(filp->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS)
@ -263,7 +263,7 @@ xfs_file_release(
struct inode *inode, struct inode *inode,
struct file *filp) struct file *filp)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error = 0; int error = 0;
if (vp) if (vp)
@ -279,7 +279,7 @@ xfs_file_fsync(
int datasync) int datasync)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error; int error;
int flags = FSYNC_WAIT; int flags = FSYNC_WAIT;
@ -307,7 +307,7 @@ xfs_vm_nopage(
int *type) int *type)
{ {
struct inode *inode = area->vm_file->f_dentry->d_inode; struct inode *inode = area->vm_file->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
int error; int error;
@ -340,7 +340,7 @@ xfs_file_readdir(
xfs_off_t start_offset, curr_offset; xfs_off_t start_offset, curr_offset;
xfs_dirent_t *dbp = NULL; xfs_dirent_t *dbp = NULL;
vp = LINVFS_GET_VP(filp->f_dentry->d_inode); vp = vn_from_inode(filp->f_dentry->d_inode);
ASSERT(vp); ASSERT(vp);
/* Try fairly hard to get memory */ /* Try fairly hard to get memory */
@ -409,7 +409,7 @@ xfs_file_mmap(
struct vm_area_struct *vma) struct vm_area_struct *vma)
{ {
struct inode *ip = filp->f_dentry->d_inode; struct inode *ip = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(ip); vnode_t *vp = vn_from_inode(ip);
vattr_t vattr; vattr_t vattr;
int error; int error;
@ -437,7 +437,7 @@ xfs_file_ioctl(
{ {
int error; int error;
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error); VOP_IOCTL(vp, inode, filp, 0, cmd, (void __user *)arg, error);
VMODIFY(vp); VMODIFY(vp);
@ -459,7 +459,7 @@ xfs_file_ioctl_invis(
{ {
int error; int error;
struct inode *inode = filp->f_dentry->d_inode; struct inode *inode = filp->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
ASSERT(vp); ASSERT(vp);
VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error); VOP_IOCTL(vp, inode, filp, IO_INVIS, cmd, (void __user *)arg, error);
@ -481,7 +481,7 @@ xfs_vm_mprotect(
struct vm_area_struct *vma, struct vm_area_struct *vma,
unsigned int newflags) unsigned int newflags)
{ {
vnode_t *vp = LINVFS_GET_VP(vma->vm_file->f_dentry->d_inode); vnode_t *vp = vn_from_inode(vma->vm_file->f_dentry->d_inode);
int error = 0; int error = 0;
if (vp->v_vfsp->vfs_flag & VFS_DMI) { if (vp->v_vfsp->vfs_flag & VFS_DMI) {
@ -507,7 +507,7 @@ STATIC int
xfs_file_open_exec( xfs_file_open_exec(
struct inode *inode) struct inode *inode)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
int error = 0; int error = 0;
xfs_inode_t *ip; xfs_inode_t *ip;

View File

@ -57,7 +57,7 @@ fs_tosspages(
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = LINVFS_GET_IP(vp); struct inode *ip = vn_to_inode(vp);
if (VN_CACHED(vp)) if (VN_CACHED(vp))
truncate_inode_pages(ip->i_mapping, first); truncate_inode_pages(ip->i_mapping, first);
@ -76,7 +76,7 @@ fs_flushinval_pages(
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = LINVFS_GET_IP(vp); struct inode *ip = vn_to_inode(vp);
if (VN_CACHED(vp)) { if (VN_CACHED(vp)) {
filemap_write_and_wait(ip->i_mapping); filemap_write_and_wait(ip->i_mapping);
@ -98,7 +98,7 @@ fs_flush_pages(
int fiopt) int fiopt)
{ {
vnode_t *vp = BHV_TO_VNODE(bdp); vnode_t *vp = BHV_TO_VNODE(bdp);
struct inode *ip = LINVFS_GET_IP(vp); struct inode *ip = vn_to_inode(vp);
if (VN_CACHED(vp)) { if (VN_CACHED(vp)) {
filemap_fdatawrite(ip->i_mapping); filemap_fdatawrite(ip->i_mapping);

View File

@ -138,7 +138,7 @@ xfs_find_handle(
} }
/* we need the vnode */ /* we need the vnode */
vp = LINVFS_GET_VP(inode); vp = vn_from_inode(inode);
/* now we can grab the fsid */ /* now we can grab the fsid */
memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t)); memcpy(&handle.ha_fsid, vp->v_vfsp->vfs_altfsid, sizeof(xfs_fsid_t));
@ -256,7 +256,7 @@ xfs_vget_fsop_handlereq(
} }
vpp = XFS_ITOV(ip); vpp = XFS_ITOV(ip);
inodep = LINVFS_GET_IP(vpp); inodep = vn_to_inode(vpp);
xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_iunlock(ip, XFS_ILOCK_SHARED);
*vp = vpp; *vp = vpp;
@ -715,7 +715,7 @@ xfs_ioctl(
xfs_inode_t *ip; xfs_inode_t *ip;
xfs_mount_t *mp; xfs_mount_t *mp;
vp = LINVFS_GET_VP(inode); vp = vn_from_inode(inode);
vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address); vn_trace_entry(vp, "xfs_ioctl", (inst_t *)__return_address);
@ -1270,7 +1270,7 @@ xfs_ioc_xattr(
} }
case XFS_IOC_GETVERSION: { case XFS_IOC_GETVERSION: {
flags = LINVFS_GET_IP(vp)->i_generation; flags = vn_to_inode(vp)->i_generation;
if (copy_to_user(arg, &flags, sizeof(flags))) if (copy_to_user(arg, &flags, sizeof(flags)))
error = -EFAULT; error = -EFAULT;
break; break;

View File

@ -111,7 +111,7 @@ xfs_compat_ioctl(int mode, struct file *f, unsigned cmd, unsigned long arg)
{ {
int error; int error;
struct inode *inode = f->f_dentry->d_inode; struct inode *inode = f->f_dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_to_inode(inode);
switch (cmd) { switch (cmd) {
case XFS_IOC_DIOINFO: case XFS_IOC_DIOINFO:

View File

@ -106,7 +106,7 @@ xfs_ichgtime(
xfs_inode_t *ip, xfs_inode_t *ip,
int flags) int flags)
{ {
struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
timespec_t tv; timespec_t tv;
nanotime(&tv); nanotime(&tv);
@ -202,7 +202,7 @@ xfs_validate_fields(
struct inode *ip, struct inode *ip,
struct vattr *vattr) struct vattr *vattr)
{ {
vnode_t *vp = LINVFS_GET_VP(ip); vnode_t *vp = vn_from_inode(ip);
int error; int error;
vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS; vattr->va_mask = XFS_AT_NLINK|XFS_AT_SIZE|XFS_AT_NBLOCKS;
@ -228,7 +228,7 @@ xfs_init_security(
struct vnode *vp, struct vnode *vp,
struct inode *dir) struct inode *dir)
{ {
struct inode *ip = LINVFS_GET_IP(vp); struct inode *ip = vn_to_inode(vp);
size_t length; size_t length;
void *value; void *value;
char *name; char *name;
@ -277,7 +277,7 @@ xfs_cleanup_inode(
* xfs_init_security we must back out. * xfs_init_security we must back out.
* ENOSPC can hit here, among other things. * ENOSPC can hit here, among other things.
*/ */
teardown.d_inode = LINVFS_GET_IP(vp); teardown.d_inode = vn_to_inode(vp);
teardown.d_name = dentry->d_name; teardown.d_name = dentry->d_name;
if (S_ISDIR(mode)) if (S_ISDIR(mode))
@ -296,7 +296,7 @@ xfs_vn_mknod(
{ {
struct inode *ip; struct inode *ip;
vattr_t vattr = { 0 }; vattr_t vattr = { 0 };
vnode_t *vp = NULL, *dvp = LINVFS_GET_VP(dir); vnode_t *vp = NULL, *dvp = vn_from_inode(dir);
xfs_acl_t *default_acl = NULL; xfs_acl_t *default_acl = NULL;
attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS;
int error; int error;
@ -359,7 +359,7 @@ xfs_vn_mknod(
if (likely(!error)) { if (likely(!error)) {
ASSERT(vp); ASSERT(vp);
ip = LINVFS_GET_IP(vp); ip = vn_to_inode(vp);
if (S_ISCHR(mode) || S_ISBLK(mode)) if (S_ISCHR(mode) || S_ISBLK(mode))
ip->i_rdev = rdev; ip->i_rdev = rdev;
@ -396,7 +396,7 @@ xfs_vn_lookup(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
struct vnode *vp = LINVFS_GET_VP(dir), *cvp; struct vnode *vp = vn_from_inode(dir), *cvp;
int error; int error;
if (dentry->d_name.len >= MAXNAMELEN) if (dentry->d_name.len >= MAXNAMELEN)
@ -410,7 +410,7 @@ xfs_vn_lookup(
return NULL; return NULL;
} }
return d_splice_alias(LINVFS_GET_IP(cvp), dentry); return d_splice_alias(vn_to_inode(cvp), dentry);
} }
STATIC int STATIC int
@ -429,8 +429,8 @@ xfs_vn_link(
if (S_ISDIR(ip->i_mode)) if (S_ISDIR(ip->i_mode))
return -EPERM; return -EPERM;
tdvp = LINVFS_GET_VP(dir); tdvp = vn_from_inode(dir);
vp = LINVFS_GET_VP(ip); vp = vn_from_inode(ip);
VOP_LINK(tdvp, vp, dentry, NULL, error); VOP_LINK(tdvp, vp, dentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
@ -453,7 +453,7 @@ xfs_vn_unlink(
int error; int error;
inode = dentry->d_inode; inode = dentry->d_inode;
dvp = LINVFS_GET_VP(dir); dvp = vn_from_inode(dir);
VOP_REMOVE(dvp, dentry, NULL, error); VOP_REMOVE(dvp, dentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
@ -475,7 +475,7 @@ xfs_vn_symlink(
vnode_t *cvp; /* used to lookup symlink to put in dentry */ vnode_t *cvp; /* used to lookup symlink to put in dentry */
int error; int error;
dvp = LINVFS_GET_VP(dir); dvp = vn_from_inode(dir);
cvp = NULL; cvp = NULL;
vattr.va_mode = S_IFLNK | vattr.va_mode = S_IFLNK |
@ -487,7 +487,7 @@ xfs_vn_symlink(
if (likely(!error && cvp)) { if (likely(!error && cvp)) {
error = xfs_init_security(cvp, dir); error = xfs_init_security(cvp, dir);
if (likely(!error)) { if (likely(!error)) {
ip = LINVFS_GET_IP(cvp); ip = vn_to_inode(cvp);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
xfs_validate_fields(dir, &vattr); xfs_validate_fields(dir, &vattr);
xfs_validate_fields(ip, &vattr); xfs_validate_fields(ip, &vattr);
@ -502,7 +502,7 @@ xfs_vn_rmdir(
struct dentry *dentry) struct dentry *dentry)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
vnode_t *dvp = LINVFS_GET_VP(dir); vnode_t *dvp = vn_from_inode(dir);
vattr_t vattr; vattr_t vattr;
int error; int error;
@ -527,8 +527,8 @@ xfs_vn_rename(
vattr_t vattr; vattr_t vattr;
int error; int error;
fvp = LINVFS_GET_VP(odir); fvp = vn_from_inode(odir);
tvp = LINVFS_GET_VP(ndir); tvp = vn_from_inode(ndir);
VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error); VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
@ -573,7 +573,7 @@ xfs_vn_follow_link(
return NULL; return NULL;
} }
vp = LINVFS_GET_VP(dentry->d_inode); vp = vn_from_inode(dentry->d_inode);
iov.iov_base = link; iov.iov_base = link;
iov.iov_len = MAXPATHLEN; iov.iov_len = MAXPATHLEN;
@ -616,7 +616,7 @@ xfs_vn_permission(
int mode, int mode,
struct nameidata *nd) struct nameidata *nd)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error; int error;
mode <<= 6; /* convert from linux to vnode access bits */ mode <<= 6; /* convert from linux to vnode access bits */
@ -634,7 +634,7 @@ xfs_vn_getattr(
struct kstat *stat) struct kstat *stat)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error = 0; int error = 0;
if (unlikely(vp->v_flag & VMODIFIED)) if (unlikely(vp->v_flag & VMODIFIED))
@ -651,7 +651,7 @@ xfs_vn_setattr(
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
unsigned int ia_valid = attr->ia_valid; unsigned int ia_valid = attr->ia_valid;
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
vattr_t vattr = { 0 }; vattr_t vattr = { 0 };
int flags = 0; int flags = 0;
int error; int error;
@ -717,7 +717,7 @@ xfs_vn_setxattr(
size_t size, size_t size,
int flags) int flags)
{ {
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;
@ -747,7 +747,7 @@ xfs_vn_getxattr(
void *data, void *data,
size_t size) size_t size)
{ {
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;
@ -776,7 +776,7 @@ xfs_vn_listxattr(
char *data, char *data,
size_t size) size_t size)
{ {
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); vnode_t *vp = vn_from_inode(dentry->d_inode);
int error, xflags = ATTR_KERNAMELS; int error, xflags = ATTR_KERNAMELS;
ssize_t result; ssize_t result;
@ -795,7 +795,7 @@ xfs_vn_removexattr(
struct dentry *dentry, struct dentry *dentry,
const char *name) const char *name)
{ {
vnode_t *vp = LINVFS_GET_VP(dentry->d_inode); vnode_t *vp = vn_from_inode(dentry->d_inode);
char *attr = (char *)name; char *attr = (char *)name;
attrnames_t *namesp; attrnames_t *namesp;
int xflags = 0; int xflags = 0;

View File

@ -234,7 +234,7 @@ BUFFER_FNS(PrivateStart, unwritten);
#define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL)
#define xfs_stack_trace() dump_stack() #define xfs_stack_trace() dump_stack()
#define xfs_itruncate_data(ip, off) \ #define xfs_itruncate_data(ip, off) \
(-vmtruncate(LINVFS_GET_IP(XFS_ITOV(ip)), (off))) (-vmtruncate(vn_to_inode(XFS_ITOV(ip)), (off)))
#define xfs_statvfs_fsid(statp, mp) \ #define xfs_statvfs_fsid(statp, mp) \
({ u64 id = huge_encode_dev((mp)->m_ddev_targp->bt_dev); \ ({ u64 id = huge_encode_dev((mp)->m_ddev_targp->bt_dev); \
__kernel_fsid_t *fsid = &(statp)->f_fsid; \ __kernel_fsid_t *fsid = &(statp)->f_fsid; \

View File

@ -432,7 +432,7 @@ xfs_zero_eof(
xfs_fsize_t isize, /* current inode size */ xfs_fsize_t isize, /* current inode size */
xfs_fsize_t end_size) /* terminal inode size */ xfs_fsize_t end_size) /* terminal inode size */
{ {
struct inode *ip = LINVFS_GET_IP(vp); struct inode *ip = vn_to_inode(vp);
xfs_fileoff_t start_zero_fsb; xfs_fileoff_t start_zero_fsb;
xfs_fileoff_t end_zero_fsb; xfs_fileoff_t end_zero_fsb;
xfs_fileoff_t zero_count_fsb; xfs_fileoff_t zero_count_fsb;

View File

@ -153,7 +153,7 @@ xfs_revalidate_inode(
vnode_t *vp, vnode_t *vp,
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
inode->i_mode = ip->i_d.di_mode; inode->i_mode = ip->i_d.di_mode;
inode->i_nlink = ip->i_d.di_nlink; inode->i_nlink = ip->i_d.di_nlink;
@ -210,7 +210,7 @@ xfs_initialize_vnode(
int unlock) int unlock)
{ {
xfs_inode_t *ip = XFS_BHVTOI(inode_bhv); xfs_inode_t *ip = XFS_BHVTOI(inode_bhv);
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
if (!inode_bhv->bd_vobj) { if (!inode_bhv->bd_vobj) {
vp->v_vfsp = bhvtovfs(bdp); vp->v_vfsp = bhvtovfs(bdp);
@ -228,7 +228,7 @@ xfs_initialize_vnode(
if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) { if (ip->i_d.di_mode != 0 && unlock && (inode->i_state & I_NEW)) {
xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip); xfs_revalidate_inode(XFS_BHVTOM(bdp), vp, ip);
xfs_set_inodeops(inode); xfs_set_inodeops(inode);
ip->i_flags &= ~XFS_INEW; ip->i_flags &= ~XFS_INEW;
barrier(); barrier();
@ -340,14 +340,14 @@ xfs_fs_alloc_inode(
vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP);
if (unlikely(!vp)) if (unlikely(!vp))
return NULL; return NULL;
return LINVFS_GET_IP(vp); return vn_to_inode(vp);
} }
STATIC void STATIC void
xfs_fs_destroy_inode( xfs_fs_destroy_inode(
struct inode *inode) struct inode *inode)
{ {
kmem_zone_free(xfs_vnode_zone, LINVFS_GET_VP(inode)); kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode));
} }
STATIC void STATIC void
@ -358,7 +358,7 @@ xfs_fs_inode_init_once(
{ {
if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) ==
SLAB_CTOR_CONSTRUCTOR) SLAB_CTOR_CONSTRUCTOR)
inode_init_once(LINVFS_GET_IP((vnode_t *)vnode)); inode_init_once(vn_to_inode((vnode_t *)vnode));
} }
STATIC int STATIC int
@ -409,7 +409,7 @@ xfs_fs_write_inode(
struct inode *inode, struct inode *inode,
int sync) int sync)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error = 0, flags = FLUSH_INODE; int error = 0, flags = FLUSH_INODE;
if (vp) { if (vp) {
@ -432,7 +432,7 @@ STATIC void
xfs_fs_clear_inode( xfs_fs_clear_inode(
struct inode *inode) struct inode *inode)
{ {
vnode_t *vp = LINVFS_GET_VP(inode); vnode_t *vp = vn_from_inode(inode);
int error, cache; int error, cache;
vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address);
@ -511,7 +511,7 @@ void
xfs_flush_inode( xfs_flush_inode(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
struct vfs *vfs = XFS_MTOVFS(ip->i_mount); struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
igrab(inode); igrab(inode);
@ -536,7 +536,7 @@ void
xfs_flush_device( xfs_flush_device(
xfs_inode_t *ip) xfs_inode_t *ip)
{ {
struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
struct vfs *vfs = XFS_MTOVFS(ip->i_mount); struct vfs *vfs = XFS_MTOVFS(ip->i_mount);
igrab(inode); igrab(inode);
@ -630,7 +630,7 @@ STATIC void
xfs_fs_put_super( xfs_fs_put_super(
struct super_block *sb) struct super_block *sb)
{ {
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
xfs_fs_stop_syncd(vfsp); xfs_fs_stop_syncd(vfsp);
@ -650,7 +650,7 @@ STATIC void
xfs_fs_write_super( xfs_fs_write_super(
struct super_block *sb) struct super_block *sb)
{ {
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
if (sb->s_flags & MS_RDONLY) { if (sb->s_flags & MS_RDONLY) {
@ -667,7 +667,7 @@ xfs_fs_sync_super(
struct super_block *sb, struct super_block *sb,
int wait) int wait)
{ {
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
int flags = SYNC_FSDATA; int flags = SYNC_FSDATA;
@ -706,7 +706,7 @@ xfs_fs_statfs(
struct super_block *sb, struct super_block *sb,
struct kstatfs *statp) struct kstatfs *statp)
{ {
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_STATVFS(vfsp, statp, NULL, error); VFS_STATVFS(vfsp, statp, NULL, error);
@ -719,7 +719,7 @@ xfs_fs_remount(
int *flags, int *flags,
char *options) char *options)
{ {
vfs_t *vfsp = LINVFS_GET_VFS(sb); vfs_t *vfsp = vfs_from_sb(sb);
struct xfs_mount_args *args = xfs_args_allocate(sb); struct xfs_mount_args *args = xfs_args_allocate(sb);
int error; int error;
@ -734,7 +734,7 @@ STATIC void
xfs_fs_lockfs( xfs_fs_lockfs(
struct super_block *sb) struct super_block *sb)
{ {
VFS_FREEZE(LINVFS_GET_VFS(sb)); VFS_FREEZE(vfs_from_sb(sb));
} }
STATIC int STATIC int
@ -742,7 +742,7 @@ xfs_fs_show_options(
struct seq_file *m, struct seq_file *m,
struct vfsmount *mnt) struct vfsmount *mnt)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(mnt->mnt_sb); struct vfs *vfsp = vfs_from_sb(mnt->mnt_sb);
int error; int error;
VFS_SHOWARGS(vfsp, m, error); VFS_SHOWARGS(vfsp, m, error);
@ -754,7 +754,7 @@ xfs_fs_quotasync(
struct super_block *sb, struct super_block *sb,
int type) int type)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(sb); struct vfs *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error); VFS_QUOTACTL(vfsp, Q_XQUOTASYNC, 0, (caddr_t)NULL, error);
@ -766,7 +766,7 @@ xfs_fs_getxstate(
struct super_block *sb, struct super_block *sb,
struct fs_quota_stat *fqs) struct fs_quota_stat *fqs)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(sb); struct vfs *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error); VFS_QUOTACTL(vfsp, Q_XGETQSTAT, 0, (caddr_t)fqs, error);
@ -779,7 +779,7 @@ xfs_fs_setxstate(
unsigned int flags, unsigned int flags,
int op) int op)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(sb); struct vfs *vfsp = vfs_from_sb(sb);
int error; int error;
VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error); VFS_QUOTACTL(vfsp, op, 0, (caddr_t)&flags, error);
@ -793,7 +793,7 @@ xfs_fs_getxquota(
qid_t id, qid_t id,
struct fs_disk_quota *fdq) struct fs_disk_quota *fdq)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(sb); struct vfs *vfsp = vfs_from_sb(sb);
int error, getmode; int error, getmode;
getmode = (type == USRQUOTA) ? Q_XGETQUOTA : getmode = (type == USRQUOTA) ? Q_XGETQUOTA :
@ -809,7 +809,7 @@ xfs_fs_setxquota(
qid_t id, qid_t id,
struct fs_disk_quota *fdq) struct fs_disk_quota *fdq)
{ {
struct vfs *vfsp = LINVFS_GET_VFS(sb); struct vfs *vfsp = vfs_from_sb(sb);
int error, setmode; int error, setmode;
setmode = (type == USRQUOTA) ? Q_XSETQLIM : setmode = (type == USRQUOTA) ? Q_XSETQLIM :
@ -825,15 +825,11 @@ xfs_fs_fill_super(
int silent) int silent)
{ {
vnode_t *rootvp; vnode_t *rootvp;
struct vfs *vfsp = vfs_allocate(); struct vfs *vfsp = vfs_allocate(sb);
struct xfs_mount_args *args = xfs_args_allocate(sb); struct xfs_mount_args *args = xfs_args_allocate(sb);
struct kstatfs statvfs; struct kstatfs statvfs;
int error, error2; int error, error2;
vfsp->vfs_super = sb;
LINVFS_SET_VFS(sb, vfsp);
if (sb->s_flags & MS_RDONLY)
vfsp->vfs_flag |= VFS_RDONLY;
bhv_insert_all_vfsops(vfsp); bhv_insert_all_vfsops(vfsp);
VFS_PARSEARGS(vfsp, (char *)data, args, 0, error); VFS_PARSEARGS(vfsp, (char *)data, args, 0, error);
@ -871,7 +867,7 @@ xfs_fs_fill_super(
if (error) if (error)
goto fail_unmount; goto fail_unmount;
sb->s_root = d_alloc_root(LINVFS_GET_IP(rootvp)); sb->s_root = d_alloc_root(vn_to_inode(rootvp));
if (!sb->s_root) { if (!sb->s_root) {
error = ENOMEM; error = ENOMEM;
goto fail_vnrele; goto fail_vnrele;

View File

@ -98,11 +98,6 @@ extern void xfs_qm_exit(void);
XFS_DMAPI_STRING \ XFS_DMAPI_STRING \
XFS_DBG_STRING /* DBG must be last */ XFS_DBG_STRING /* DBG must be last */
#define LINVFS_GET_VFS(s) \
(vfs_t *)((s)->s_fs_info)
#define LINVFS_SET_VFS(s, vfsp) \
((s)->s_fs_info = vfsp)
struct xfs_inode; struct xfs_inode;
struct xfs_mount; struct xfs_mount;
struct xfs_buftarg; struct xfs_buftarg;

View File

@ -227,7 +227,8 @@ vfs_freeze(
} }
vfs_t * vfs_t *
vfs_allocate( void ) vfs_allocate(
struct super_block *sb)
{ {
struct vfs *vfsp; struct vfs *vfsp;
@ -236,9 +237,23 @@ vfs_allocate( void )
INIT_LIST_HEAD(&vfsp->vfs_sync_list); INIT_LIST_HEAD(&vfsp->vfs_sync_list);
spin_lock_init(&vfsp->vfs_sync_lock); spin_lock_init(&vfsp->vfs_sync_lock);
init_waitqueue_head(&vfsp->vfs_wait_single_sync_task); init_waitqueue_head(&vfsp->vfs_wait_single_sync_task);
vfsp->vfs_super = sb;
sb->s_fs_info = vfsp;
if (sb->s_flags & MS_RDONLY)
vfsp->vfs_flag |= VFS_RDONLY;
return vfsp; return vfsp;
} }
vfs_t *
vfs_from_sb(
struct super_block *sb)
{
return (vfs_t *)sb->s_fs_info;
}
void void
vfs_deallocate( vfs_deallocate(
struct vfs *vfsp) struct vfs *vfsp)

View File

@ -193,7 +193,8 @@ typedef struct bhv_vfsops {
#define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o)) #define vfs_bhv_set_custom(b,o) ( (b)->bhv_custom = (void *)(o))
#define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL ) #define vfs_bhv_clr_custom(b) ( (b)->bhv_custom = NULL )
extern vfs_t *vfs_allocate(void); extern vfs_t *vfs_allocate(struct super_block *);
extern vfs_t *vfs_from_sb(struct super_block *);
extern void vfs_deallocate(vfs_t *); extern void vfs_deallocate(vfs_t *);
extern void vfs_insertops(vfs_t *, bhv_vfsops_t *); extern void vfs_insertops(vfs_t *, bhv_vfsops_t *);
extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *); extern void vfs_insertbhv(vfs_t *, bhv_desc_t *, vfsops_t *, void *);

View File

@ -58,7 +58,7 @@ struct vnode *
vn_initialize( vn_initialize(
struct inode *inode) struct inode *inode)
{ {
struct vnode *vp = LINVFS_GET_VP(inode); struct vnode *vp = vn_from_inode(inode);
XFS_STATS_INC(vn_active); XFS_STATS_INC(vn_active);
XFS_STATS_INC(vn_alloc); XFS_STATS_INC(vn_alloc);
@ -97,7 +97,7 @@ vn_revalidate_core(
struct vnode *vp, struct vnode *vp,
vattr_t *vap) vattr_t *vap)
{ {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
inode->i_mode = vap->va_mode; inode->i_mode = vap->va_mode;
inode->i_nlink = vap->va_nlink; inode->i_nlink = vap->va_nlink;
@ -166,7 +166,7 @@ vn_hold(
XFS_STATS_INC(vn_hold); XFS_STATS_INC(vn_hold);
VN_LOCK(vp); VN_LOCK(vp);
inode = igrab(LINVFS_GET_IP(vp)); inode = igrab(vn_to_inode(vp));
ASSERT(inode); ASSERT(inode);
VN_UNLOCK(vp, 0); VN_UNLOCK(vp, 0);

View File

@ -116,8 +116,14 @@ typedef enum {
/* /*
* Vnode to Linux inode mapping. * Vnode to Linux inode mapping.
*/ */
#define LINVFS_GET_VP(inode) ((vnode_t *)list_entry(inode, vnode_t, v_inode)) static inline struct vnode *vn_from_inode(struct inode *inode)
#define LINVFS_GET_IP(vp) (&(vp)->v_inode) {
return (vnode_t *)list_entry(inode, vnode_t, v_inode);
}
static inline struct inode *vn_to_inode(struct vnode *vnode)
{
return &vnode->v_inode;
}
/* /*
* Vnode flags. * Vnode flags.
@ -498,7 +504,7 @@ extern void vn_iowake(struct vnode *vp);
static inline int vn_count(struct vnode *vp) static inline int vn_count(struct vnode *vp)
{ {
return atomic_read(&LINVFS_GET_IP(vp)->i_count); return atomic_read(&vn_to_inode(vp)->i_count);
} }
/* /*
@ -512,16 +518,16 @@ extern vnode_t *vn_hold(struct vnode *);
vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
#define VN_RELE(vp) \ #define VN_RELE(vp) \
(vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
iput(LINVFS_GET_IP(vp))) iput(vn_to_inode(vp)))
#else #else
#define VN_HOLD(vp) ((void)vn_hold(vp)) #define VN_HOLD(vp) ((void)vn_hold(vp))
#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) #define VN_RELE(vp) (iput(vn_to_inode(vp)))
#endif #endif
static inline struct vnode *vn_grab(struct vnode *vp) static inline struct vnode *vn_grab(struct vnode *vp)
{ {
struct inode *inode = igrab(LINVFS_GET_IP(vp)); struct inode *inode = igrab(vn_to_inode(vp));
return inode ? LINVFS_GET_VP(inode) : NULL; return inode ? vn_from_inode(inode) : NULL;
} }
/* /*
@ -529,7 +535,7 @@ static inline struct vnode *vn_grab(struct vnode *vp)
*/ */
#define VNAME(dentry) ((char *) (dentry)->d_name.name) #define VNAME(dentry) ((char *) (dentry)->d_name.name)
#define VNAMELEN(dentry) ((dentry)->d_name.len) #define VNAMELEN(dentry) ((dentry)->d_name.len)
#define VNAME_TO_VNODE(dentry) (LINVFS_GET_VP((dentry)->d_inode)) #define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode))
/* /*
* Vnode spinlock manipulation. * Vnode spinlock manipulation.
@ -558,12 +564,12 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag)
*/ */
static inline void vn_mark_bad(struct vnode *vp) static inline void vn_mark_bad(struct vnode *vp)
{ {
make_bad_inode(LINVFS_GET_IP(vp)); make_bad_inode(vn_to_inode(vp));
} }
static inline int VN_BAD(struct vnode *vp) static inline int VN_BAD(struct vnode *vp)
{ {
return is_bad_inode(LINVFS_GET_IP(vp)); return is_bad_inode(vn_to_inode(vp));
} }
/* /*
@ -588,9 +594,9 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
/* /*
* Some useful predicates. * Some useful predicates.
*/ */
#define VN_MAPPED(vp) mapping_mapped(LINVFS_GET_IP(vp)->i_mapping) #define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping)
#define VN_CACHED(vp) (LINVFS_GET_IP(vp)->i_mapping->nrpages) #define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
#define VN_DIRTY(vp) mapping_tagged(LINVFS_GET_IP(vp)->i_mapping, \ #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \
PAGECACHE_TAG_DIRTY) PAGECACHE_TAG_DIRTY)
#define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED) #define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED)
#define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED) #define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED)

View File

@ -2522,7 +2522,7 @@ attr_user_capable(
struct vnode *vp, struct vnode *vp,
cred_t *cred) cred_t *cred)
{ {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
return -EPERM; return -EPERM;
@ -2540,7 +2540,7 @@ attr_trusted_capable(
struct vnode *vp, struct vnode *vp,
cred_t *cred) cred_t *cred)
{ {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
return -EPERM; return -EPERM;

View File

@ -83,7 +83,7 @@ xfs_swapext(
/* Pull information for the target fd */ /* Pull information for the target fd */
if (((fp = fget((int)sxp->sx_fdtarget)) == NULL) || if (((fp = fget((int)sxp->sx_fdtarget)) == NULL) ||
((vp = LINVFS_GET_VP(fp->f_dentry->d_inode)) == NULL)) { ((vp = vn_from_inode(fp->f_dentry->d_inode)) == NULL)) {
error = XFS_ERROR(EINVAL); error = XFS_ERROR(EINVAL);
goto error0; goto error0;
} }
@ -95,7 +95,7 @@ xfs_swapext(
} }
if (((tfp = fget((int)sxp->sx_fdtmp)) == NULL) || if (((tfp = fget((int)sxp->sx_fdtmp)) == NULL) ||
((tvp = LINVFS_GET_VP(tfp->f_dentry->d_inode)) == NULL)) { ((tvp = vn_from_inode(tfp->f_dentry->d_inode)) == NULL)) {
error = XFS_ERROR(EINVAL); error = XFS_ERROR(EINVAL);
goto error0; goto error0;
} }

View File

@ -258,7 +258,7 @@ again:
goto finish_inode; goto finish_inode;
} else if (vp != inode_vp) { } else if (vp != inode_vp) {
struct inode *inode = LINVFS_GET_IP(inode_vp); struct inode *inode = vn_to_inode(inode_vp);
/* The inode is being torn down, pause and /* The inode is being torn down, pause and
* try again. * try again.
@ -495,7 +495,7 @@ retry:
if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) { if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) {
xfs_inode_t *ip; xfs_inode_t *ip;
vp = LINVFS_GET_VP(inode); vp = vn_from_inode(inode);
if (inode->i_state & I_NEW) { if (inode->i_state & I_NEW) {
vn_initialize(inode); vn_initialize(inode);
error = xfs_iget_core(vp, mp, tp, ino, flags, error = xfs_iget_core(vp, mp, tp, ino, flags,
@ -617,7 +617,7 @@ xfs_iput_new(xfs_inode_t *ip,
uint lock_flags) uint lock_flags)
{ {
vnode_t *vp = XFS_ITOV(ip); vnode_t *vp = XFS_ITOV(ip);
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address); vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address);

View File

@ -2723,7 +2723,7 @@ xfs_iunpin(
/* make sync come back and flush this inode */ /* make sync come back and flush this inode */
if (vp) { if (vp) {
struct inode *inode = LINVFS_GET_IP(vp); struct inode *inode = vn_to_inode(vp);
if (!(inode->i_state & I_NEW)) if (!(inode->i_state & I_NEW))
mark_inode_dirty_sync(inode); mark_inode_dirty_sync(inode);
@ -3519,7 +3519,7 @@ xfs_iaccess(
{ {
int error; int error;
mode_t orgmode = mode; mode_t orgmode = mode;
struct inode *inode = LINVFS_GET_IP(XFS_ITOV(ip)); struct inode *inode = vn_to_inode(XFS_ITOV(ip));
if (mode & S_IWUSR) { if (mode & S_IWUSR) {
umode_t imode = inode->i_mode; umode_t imode = inode->i_mode;

View File

@ -1556,7 +1556,7 @@ xfs_release(
if ((error = xfs_inactive_free_eofblocks(mp, ip))) if ((error = xfs_inactive_free_eofblocks(mp, ip)))
return error; return error;
/* Update linux inode block count after free above */ /* Update linux inode block count after free above */
LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
ip->i_d.di_nblocks + ip->i_delayed_blks); ip->i_d.di_nblocks + ip->i_delayed_blks);
} }
} }
@ -1637,7 +1637,7 @@ xfs_inactive(
if ((error = xfs_inactive_free_eofblocks(mp, ip))) if ((error = xfs_inactive_free_eofblocks(mp, ip)))
return VN_INACTIVE_CACHE; return VN_INACTIVE_CACHE;
/* Update linux inode block count after free above */ /* Update linux inode block count after free above */
LINVFS_GET_IP(vp)->i_blocks = XFS_FSB_TO_BB(mp, vn_to_inode(vp)->i_blocks = XFS_FSB_TO_BB(mp,
ip->i_d.di_nblocks + ip->i_delayed_blks); ip->i_d.di_nblocks + ip->i_delayed_blks);
} }
goto out; goto out;