提交 73a79706 编写于 作者: B Bryan Schumaker 提交者: Trond Myklebust

NFS: Split out NFS v4 inode operations

The NFS v4 file inode operations are already already in nfs4proc.c, so
this patch just needs to move the directory operations to the same file.
Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 ab96291e
...@@ -63,33 +63,6 @@ const struct address_space_operations nfs_dir_aops = { ...@@ -63,33 +63,6 @@ const struct address_space_operations nfs_dir_aops = {
.freepage = nfs_readdir_clear_array, .freepage = nfs_readdir_clear_array,
}; };
#ifdef CONFIG_NFS_V4
static int nfs_atomic_open(struct inode *, struct dentry *,
struct file *, unsigned, umode_t,
int *);
const struct inode_operations nfs4_dir_inode_operations = {
.create = nfs_create,
.lookup = nfs_lookup,
.atomic_open = nfs_atomic_open,
.link = nfs_link,
.unlink = nfs_unlink,
.symlink = nfs_symlink,
.mkdir = nfs_mkdir,
.rmdir = nfs_rmdir,
.mknod = nfs_mknod,
.rename = nfs_rename,
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
.getxattr = generic_getxattr,
.setxattr = generic_setxattr,
.listxattr = generic_listxattr,
.removexattr = generic_removexattr,
};
#endif /* CONFIG_NFS_V4 */
static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir, struct rpc_cred *cred) static struct nfs_open_dir_context *alloc_nfs_open_dir_context(struct inode *dir, struct rpc_cred *cred)
{ {
struct nfs_open_dir_context *ctx; struct nfs_open_dir_context *ctx;
...@@ -1352,9 +1325,9 @@ static int nfs_finish_open(struct nfs_open_context *ctx, ...@@ -1352,9 +1325,9 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
return err; return err;
} }
static int nfs_atomic_open(struct inode *dir, struct dentry *dentry, int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
struct file *file, unsigned open_flags, struct file *file, unsigned open_flags,
umode_t mode, int *opened) umode_t mode, int *opened)
{ {
struct nfs_open_context *ctx; struct nfs_open_context *ctx;
struct dentry *res; struct dentry *res;
......
...@@ -200,7 +200,10 @@ struct nfs4_state_maintenance_ops { ...@@ -200,7 +200,10 @@ struct nfs4_state_maintenance_ops {
}; };
extern const struct dentry_operations nfs4_dentry_operations; extern const struct dentry_operations nfs4_dentry_operations;
extern const struct inode_operations nfs4_dir_inode_operations;
/* dir.c */
int nfs_atomic_open(struct inode *, struct dentry *, struct file *,
unsigned, umode_t, int *);
/* write.c */ /* write.c */
int nfs4_write_inode(struct inode *, struct writeback_control *); int nfs4_write_inode(struct inode *, struct writeback_control *);
......
...@@ -6832,6 +6832,26 @@ const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] = { ...@@ -6832,6 +6832,26 @@ const struct nfs4_minor_version_ops *nfs_v4_minor_ops[] = {
#endif #endif
}; };
const struct inode_operations nfs4_dir_inode_operations = {
.create = nfs_create,
.lookup = nfs_lookup,
.atomic_open = nfs_atomic_open,
.link = nfs_link,
.unlink = nfs_unlink,
.symlink = nfs_symlink,
.mkdir = nfs_mkdir,
.rmdir = nfs_rmdir,
.mknod = nfs_mknod,
.rename = nfs_rename,
.permission = nfs_permission,
.getattr = nfs_getattr,
.setattr = nfs_setattr,
.getxattr = generic_getxattr,
.setxattr = generic_setxattr,
.listxattr = generic_listxattr,
.removexattr = generic_removexattr,
};
static const struct inode_operations nfs4_file_inode_operations = { static const struct inode_operations nfs4_file_inode_operations = {
.permission = nfs_permission, .permission = nfs_permission,
.getattr = nfs_getattr, .getattr = nfs_getattr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册