Commit ed4433d7 authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

fs/affs: make affs exportable

Add standard functions making AFFS work with NFS.

Functions based on ext4 implementation.  Tested on loop device.

Link: default avatarFabian Frederick <>
Cc: Al Viro <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent d5de9fd5
......@@ -162,6 +162,7 @@ extern void affs_free_bitmap(struct super_block *sb);
/* namei.c */
extern const struct export_operations affs_export_ops;
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
......@@ -9,6 +9,7 @@
#include "affs.h"
#include <linux/exportfs.h>
typedef int (*toupper_t)(int);
......@@ -465,3 +466,42 @@ affs_rename(struct inode *old_dir, struct dentry *old_dentry,
return retval;
static struct inode *affs_nfs_get_inode(struct super_block *sb, u64 ino,
u32 generation)
struct inode *inode;
if (!affs_validblock(sb, ino))
return ERR_PTR(-ESTALE);
inode = affs_iget(sb, ino);
if (IS_ERR(inode))
return ERR_CAST(inode);
if (generation && inode->i_generation != generation) {
return ERR_PTR(-ESTALE);
return inode;
static struct dentry *affs_fh_to_dentry(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type)
return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
static struct dentry *affs_fh_to_parent(struct super_block *sb, struct fid *fid,
int fh_len, int fh_type)
return generic_fh_to_parent(sb, fid, fh_len, fh_type,
const struct export_operations affs_export_ops = {
.fh_to_dentry = affs_fh_to_dentry,
.fh_to_parent = affs_fh_to_parent,
......@@ -507,6 +507,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
return -ENOMEM;
sb->s_export_op = &affs_export_ops;
pr_debug("s_flags=%lX\n", sb->s_flags);
return 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment