提交 416c6d5b 编写于 作者: N Nathan Scott

[XFS] Switch over from linvfs names for inode operations for consistent

naming.

SGI-PV: 950556
SGI-Modid: xfs-linux-melb:xfs-kern:25381a
Signed-off-by: NNathan Scott <nathans@sgi.com>
上级 3562fd45
...@@ -198,7 +198,7 @@ xfs_ichgtime_fast( ...@@ -198,7 +198,7 @@ xfs_ichgtime_fast(
* Pull the link count and size up from the xfs inode to the linux inode * Pull the link count and size up from the xfs inode to the linux inode
*/ */
STATIC void STATIC void
__linvfs_validate_fields( xfs_validate_fields(
struct inode *ip, struct inode *ip,
struct vattr *vattr) struct vattr *vattr)
{ {
...@@ -224,7 +224,7 @@ __linvfs_validate_fields( ...@@ -224,7 +224,7 @@ __linvfs_validate_fields(
* inode, of course, such that log replay can't cause these to be lost). * inode, of course, such that log replay can't cause these to be lost).
*/ */
STATIC int STATIC int
__linvfs_init_security( xfs_init_security(
struct vnode *vp, struct vnode *vp,
struct inode *dir) struct inode *dir)
{ {
...@@ -257,13 +257,13 @@ __linvfs_init_security( ...@@ -257,13 +257,13 @@ __linvfs_init_security(
* XXX(hch): nfsd is broken, better fix it instead. * XXX(hch): nfsd is broken, better fix it instead.
*/ */
STATIC inline int STATIC inline int
__linvfs_has_fs_struct(struct task_struct *task) xfs_has_fs_struct(struct task_struct *task)
{ {
return (task->fs != init_task.fs); return (task->fs != init_task.fs);
} }
STATIC inline void STATIC inline void
__linvfs_cleanup_inode( xfs_cleanup_inode(
vnode_t *dvp, vnode_t *dvp,
vnode_t *vp, vnode_t *vp,
struct dentry *dentry, struct dentry *dentry,
...@@ -274,7 +274,7 @@ __linvfs_cleanup_inode( ...@@ -274,7 +274,7 @@ __linvfs_cleanup_inode(
/* Oh, the horror. /* Oh, the horror.
* If we can't add the ACL or we fail in * If we can't add the ACL or we fail in
* linvfs_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 = LINVFS_GET_IP(vp);
...@@ -288,7 +288,7 @@ __linvfs_cleanup_inode( ...@@ -288,7 +288,7 @@ __linvfs_cleanup_inode(
} }
STATIC int STATIC int
linvfs_mknod( xfs_vn_mknod(
struct inode *dir, struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
int mode, int mode,
...@@ -323,7 +323,7 @@ linvfs_mknod( ...@@ -323,7 +323,7 @@ linvfs_mknod(
} }
} }
if (IS_POSIXACL(dir) && !default_acl && __linvfs_has_fs_struct(current)) if (IS_POSIXACL(dir) && !default_acl && xfs_has_fs_struct(current))
mode &= ~current->fs->umask; mode &= ~current->fs->umask;
memset(vattr, 0, sizeof(*vattr)); memset(vattr, 0, sizeof(*vattr));
...@@ -347,9 +347,9 @@ linvfs_mknod( ...@@ -347,9 +347,9 @@ linvfs_mknod(
} }
if (unlikely(!error)) { if (unlikely(!error)) {
error = __linvfs_init_security(vp, dir); error = xfs_init_security(vp, dir);
if (error) if (error)
__linvfs_cleanup_inode(dvp, vp, dentry, mode); xfs_cleanup_inode(dvp, vp, dentry, mode);
} }
if (unlikely(default_acl)) { if (unlikely(default_acl)) {
...@@ -358,7 +358,7 @@ linvfs_mknod( ...@@ -358,7 +358,7 @@ linvfs_mknod(
if (!error) if (!error)
VMODIFY(vp); VMODIFY(vp);
else else
__linvfs_cleanup_inode(dvp, vp, dentry, mode); xfs_cleanup_inode(dvp, vp, dentry, mode);
} }
_ACL_FREE(default_acl); _ACL_FREE(default_acl);
} }
...@@ -370,35 +370,35 @@ linvfs_mknod( ...@@ -370,35 +370,35 @@ linvfs_mknod(
if (S_ISCHR(mode) || S_ISBLK(mode)) if (S_ISCHR(mode) || S_ISBLK(mode))
ip->i_rdev = rdev; ip->i_rdev = rdev;
else if (S_ISDIR(mode)) else if (S_ISDIR(mode))
__linvfs_validate_fields(ip, vattr); xfs_validate_fields(ip, vattr);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
__linvfs_validate_fields(dir, vattr); xfs_validate_fields(dir, vattr);
} }
kfree(vattr); kfree(vattr);
return -error; return -error;
} }
STATIC int STATIC int
linvfs_create( xfs_vn_create(
struct inode *dir, struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
int mode, int mode,
struct nameidata *nd) struct nameidata *nd)
{ {
return linvfs_mknod(dir, dentry, mode, 0); return xfs_vn_mknod(dir, dentry, mode, 0);
} }
STATIC int STATIC int
linvfs_mkdir( xfs_vn_mkdir(
struct inode *dir, struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
int mode) int mode)
{ {
return linvfs_mknod(dir, dentry, mode|S_IFDIR, 0); return xfs_vn_mknod(dir, dentry, mode|S_IFDIR, 0);
} }
STATIC struct dentry * STATIC struct dentry *
linvfs_lookup( xfs_vn_lookup(
struct inode *dir, struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
...@@ -421,7 +421,7 @@ linvfs_lookup( ...@@ -421,7 +421,7 @@ linvfs_lookup(
} }
STATIC int STATIC int
linvfs_link( xfs_vn_link(
struct dentry *old_dentry, struct dentry *old_dentry,
struct inode *dir, struct inode *dir,
struct dentry *dentry) struct dentry *dentry)
...@@ -447,7 +447,7 @@ linvfs_link( ...@@ -447,7 +447,7 @@ linvfs_link(
if (likely(!error)) { if (likely(!error)) {
VMODIFY(tdvp); VMODIFY(tdvp);
VN_HOLD(vp); VN_HOLD(vp);
__linvfs_validate_fields(ip, vattr); xfs_validate_fields(ip, vattr);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
} }
kfree(vattr); kfree(vattr);
...@@ -455,7 +455,7 @@ linvfs_link( ...@@ -455,7 +455,7 @@ linvfs_link(
} }
STATIC int STATIC int
linvfs_unlink( xfs_vn_unlink(
struct inode *dir, struct inode *dir,
struct dentry *dentry) struct dentry *dentry)
{ {
...@@ -473,15 +473,15 @@ linvfs_unlink( ...@@ -473,15 +473,15 @@ linvfs_unlink(
VOP_REMOVE(dvp, dentry, NULL, error); VOP_REMOVE(dvp, dentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
__linvfs_validate_fields(dir, vattr); /* size needs update */ xfs_validate_fields(dir, vattr); /* size needs update */
__linvfs_validate_fields(inode, vattr); xfs_validate_fields(inode, vattr);
} }
kfree(vattr); kfree(vattr);
return -error; return -error;
} }
STATIC int STATIC int
linvfs_symlink( xfs_vn_symlink(
struct inode *dir, struct inode *dir,
struct dentry *dentry, struct dentry *dentry,
const char *symname) const char *symname)
...@@ -507,12 +507,12 @@ linvfs_symlink( ...@@ -507,12 +507,12 @@ linvfs_symlink(
error = 0; error = 0;
VOP_SYMLINK(dvp, dentry, vattr, (char *)symname, &cvp, NULL, error); VOP_SYMLINK(dvp, dentry, vattr, (char *)symname, &cvp, NULL, error);
if (likely(!error && cvp)) { if (likely(!error && cvp)) {
error = __linvfs_init_security(cvp, dir); error = xfs_init_security(cvp, dir);
if (likely(!error)) { if (likely(!error)) {
ip = LINVFS_GET_IP(cvp); ip = LINVFS_GET_IP(cvp);
d_instantiate(dentry, ip); d_instantiate(dentry, ip);
__linvfs_validate_fields(dir, vattr); xfs_validate_fields(dir, vattr);
__linvfs_validate_fields(ip, vattr); xfs_validate_fields(ip, vattr);
} }
} }
kfree(vattr); kfree(vattr);
...@@ -520,7 +520,7 @@ linvfs_symlink( ...@@ -520,7 +520,7 @@ linvfs_symlink(
} }
STATIC int STATIC int
linvfs_rmdir( xfs_vn_rmdir(
struct inode *dir, struct inode *dir,
struct dentry *dentry) struct dentry *dentry)
{ {
...@@ -535,15 +535,15 @@ linvfs_rmdir( ...@@ -535,15 +535,15 @@ linvfs_rmdir(
VOP_RMDIR(dvp, dentry, NULL, error); VOP_RMDIR(dvp, dentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
__linvfs_validate_fields(inode, vattr); xfs_validate_fields(inode, vattr);
__linvfs_validate_fields(dir, vattr); xfs_validate_fields(dir, vattr);
} }
kfree(vattr); kfree(vattr);
return -error; return -error;
} }
STATIC int STATIC int
linvfs_rename( xfs_vn_rename(
struct inode *odir, struct inode *odir,
struct dentry *odentry, struct dentry *odentry,
struct inode *ndir, struct inode *ndir,
...@@ -565,10 +565,10 @@ linvfs_rename( ...@@ -565,10 +565,10 @@ linvfs_rename(
VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error); VOP_RENAME(fvp, odentry, tvp, ndentry, NULL, error);
if (likely(!error)) { if (likely(!error)) {
if (new_inode) if (new_inode)
__linvfs_validate_fields(new_inode, vattr); xfs_validate_fields(new_inode, vattr);
__linvfs_validate_fields(odir, vattr); xfs_validate_fields(odir, vattr);
if (ndir != odir) if (ndir != odir)
__linvfs_validate_fields(ndir, vattr); xfs_validate_fields(ndir, vattr);
} }
kfree(vattr); kfree(vattr);
return -error; return -error;
...@@ -580,7 +580,7 @@ linvfs_rename( ...@@ -580,7 +580,7 @@ linvfs_rename(
* uio is kmalloced for this reason... * uio is kmalloced for this reason...
*/ */
STATIC void * STATIC void *
linvfs_follow_link( xfs_vn_follow_link(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd) struct nameidata *nd)
{ {
...@@ -631,7 +631,7 @@ linvfs_follow_link( ...@@ -631,7 +631,7 @@ linvfs_follow_link(
} }
STATIC void STATIC void
linvfs_put_link( xfs_vn_put_link(
struct dentry *dentry, struct dentry *dentry,
struct nameidata *nd, struct nameidata *nd,
void *p) void *p)
...@@ -644,7 +644,7 @@ linvfs_put_link( ...@@ -644,7 +644,7 @@ linvfs_put_link(
#ifdef CONFIG_XFS_POSIX_ACL #ifdef CONFIG_XFS_POSIX_ACL
STATIC int STATIC int
linvfs_permission( xfs_vn_permission(
struct inode *inode, struct inode *inode,
int mode, int mode,
struct nameidata *nd) struct nameidata *nd)
...@@ -657,11 +657,11 @@ linvfs_permission( ...@@ -657,11 +657,11 @@ linvfs_permission(
return -error; return -error;
} }
#else #else
#define linvfs_permission NULL #define xfs_vn_permission NULL
#endif #endif
STATIC int STATIC int
linvfs_getattr( xfs_vn_getattr(
struct vfsmount *mnt, struct vfsmount *mnt,
struct dentry *dentry, struct dentry *dentry,
struct kstat *stat) struct kstat *stat)
...@@ -678,7 +678,7 @@ linvfs_getattr( ...@@ -678,7 +678,7 @@ linvfs_getattr(
} }
STATIC int STATIC int
linvfs_setattr( xfs_vn_setattr(
struct dentry *dentry, struct dentry *dentry,
struct iattr *attr) struct iattr *attr)
{ {
...@@ -736,14 +736,14 @@ linvfs_setattr( ...@@ -736,14 +736,14 @@ linvfs_setattr(
} }
STATIC void STATIC void
linvfs_truncate( xfs_vn_truncate(
struct inode *inode) struct inode *inode)
{ {
block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_block); block_truncate_page(inode->i_mapping, inode->i_size, xfs_get_block);
} }
STATIC int STATIC int
linvfs_setxattr( xfs_vn_setxattr(
struct dentry *dentry, struct dentry *dentry,
const char *name, const char *name,
const void *data, const void *data,
...@@ -774,7 +774,7 @@ linvfs_setxattr( ...@@ -774,7 +774,7 @@ linvfs_setxattr(
} }
STATIC ssize_t STATIC ssize_t
linvfs_getxattr( xfs_vn_getxattr(
struct dentry *dentry, struct dentry *dentry,
const char *name, const char *name,
void *data, void *data,
...@@ -804,7 +804,7 @@ linvfs_getxattr( ...@@ -804,7 +804,7 @@ linvfs_getxattr(
} }
STATIC ssize_t STATIC ssize_t
linvfs_listxattr( xfs_vn_listxattr(
struct dentry *dentry, struct dentry *dentry,
char *data, char *data,
size_t size) size_t size)
...@@ -824,7 +824,7 @@ linvfs_listxattr( ...@@ -824,7 +824,7 @@ linvfs_listxattr(
} }
STATIC int STATIC int
linvfs_removexattr( xfs_vn_removexattr(
struct dentry *dentry, struct dentry *dentry,
const char *name) const char *name)
{ {
...@@ -846,45 +846,45 @@ linvfs_removexattr( ...@@ -846,45 +846,45 @@ linvfs_removexattr(
} }
struct inode_operations linvfs_file_inode_operations = { struct inode_operations xfs_inode_operations = {
.permission = linvfs_permission, .permission = xfs_vn_permission,
.truncate = linvfs_truncate, .truncate = xfs_vn_truncate,
.getattr = linvfs_getattr, .getattr = xfs_vn_getattr,
.setattr = linvfs_setattr, .setattr = xfs_vn_setattr,
.setxattr = linvfs_setxattr, .setxattr = xfs_vn_setxattr,
.getxattr = linvfs_getxattr, .getxattr = xfs_vn_getxattr,
.listxattr = linvfs_listxattr, .listxattr = xfs_vn_listxattr,
.removexattr = linvfs_removexattr, .removexattr = xfs_vn_removexattr,
}; };
struct inode_operations linvfs_dir_inode_operations = { struct inode_operations xfs_dir_inode_operations = {
.create = linvfs_create, .create = xfs_vn_create,
.lookup = linvfs_lookup, .lookup = xfs_vn_lookup,
.link = linvfs_link, .link = xfs_vn_link,
.unlink = linvfs_unlink, .unlink = xfs_vn_unlink,
.symlink = linvfs_symlink, .symlink = xfs_vn_symlink,
.mkdir = linvfs_mkdir, .mkdir = xfs_vn_mkdir,
.rmdir = linvfs_rmdir, .rmdir = xfs_vn_rmdir,
.mknod = linvfs_mknod, .mknod = xfs_vn_mknod,
.rename = linvfs_rename, .rename = xfs_vn_rename,
.permission = linvfs_permission, .permission = xfs_vn_permission,
.getattr = linvfs_getattr, .getattr = xfs_vn_getattr,
.setattr = linvfs_setattr, .setattr = xfs_vn_setattr,
.setxattr = linvfs_setxattr, .setxattr = xfs_vn_setxattr,
.getxattr = linvfs_getxattr, .getxattr = xfs_vn_getxattr,
.listxattr = linvfs_listxattr, .listxattr = xfs_vn_listxattr,
.removexattr = linvfs_removexattr, .removexattr = xfs_vn_removexattr,
}; };
struct inode_operations linvfs_symlink_inode_operations = { struct inode_operations xfs_symlink_inode_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = linvfs_follow_link, .follow_link = xfs_vn_follow_link,
.put_link = linvfs_put_link, .put_link = xfs_vn_put_link,
.permission = linvfs_permission, .permission = xfs_vn_permission,
.getattr = linvfs_getattr, .getattr = xfs_vn_getattr,
.setattr = linvfs_setattr, .setattr = xfs_vn_setattr,
.setxattr = linvfs_setxattr, .setxattr = xfs_vn_setxattr,
.getxattr = linvfs_getxattr, .getxattr = xfs_vn_getxattr,
.listxattr = linvfs_listxattr, .listxattr = xfs_vn_listxattr,
.removexattr = linvfs_removexattr, .removexattr = xfs_vn_removexattr,
}; };
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
#ifndef __XFS_IOPS_H__ #ifndef __XFS_IOPS_H__
#define __XFS_IOPS_H__ #define __XFS_IOPS_H__
extern struct inode_operations linvfs_file_inode_operations; extern struct inode_operations xfs_inode_operations;
extern struct inode_operations linvfs_dir_inode_operations; extern struct inode_operations xfs_dir_inode_operations;
extern struct inode_operations linvfs_symlink_inode_operations; extern struct inode_operations xfs_symlink_inode_operations;
extern struct file_operations xfs_file_operations; extern struct file_operations xfs_file_operations;
extern struct file_operations xfs_dir_file_operations; extern struct file_operations xfs_dir_file_operations;
......
...@@ -127,21 +127,21 @@ xfs_set_inodeops( ...@@ -127,21 +127,21 @@ xfs_set_inodeops(
{ {
switch (inode->i_mode & S_IFMT) { switch (inode->i_mode & S_IFMT) {
case S_IFREG: case S_IFREG:
inode->i_op = &linvfs_file_inode_operations; inode->i_op = &xfs_inode_operations;
inode->i_fop = &xfs_file_operations; inode->i_fop = &xfs_file_operations;
inode->i_mapping->a_ops = &xfs_address_space_operations; inode->i_mapping->a_ops = &xfs_address_space_operations;
break; break;
case S_IFDIR: case S_IFDIR:
inode->i_op = &linvfs_dir_inode_operations; inode->i_op = &xfs_dir_inode_operations;
inode->i_fop = &xfs_dir_file_operations; inode->i_fop = &xfs_dir_file_operations;
break; break;
case S_IFLNK: case S_IFLNK:
inode->i_op = &linvfs_symlink_inode_operations; inode->i_op = &xfs_symlink_inode_operations;
if (inode->i_blocks) if (inode->i_blocks)
inode->i_mapping->a_ops = &xfs_address_space_operations; inode->i_mapping->a_ops = &xfs_address_space_operations;
break; break;
default: default:
inode->i_op = &linvfs_file_inode_operations; inode->i_op = &xfs_inode_operations;
init_special_inode(inode, inode->i_mode, inode->i_rdev); init_special_inode(inode, inode->i_mode, inode->i_rdev);
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册