Skip to content

Commit

Permalink
Merge pull request #101 from piotrsok2/master
Browse files Browse the repository at this point in the history
Add support for NFS
  • Loading branch information
dorimanx authored Jan 3, 2017
2 parents 22910c9 + 934ad92 commit 8d291f5
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2195,6 +2195,45 @@ const struct super_operations exfat_sops = {
.show_options = exfat_show_options,
};

/*======================================================================*/
/* Export Operations */
/*======================================================================*/

static struct inode *exfat_nfs_get_inode(struct super_block *sb,
u64 ino, u32 generation)
{
struct inode *inode = NULL;
if (ino < EXFAT_ROOT_INO)
return inode;
inode = ilookup(sb, ino);

if (inode && generation && (inode->i_generation != generation)) {
iput(inode);
inode = NULL;
}

return inode;
}

static struct dentry *exfat_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,
exfat_nfs_get_inode);
}

static struct dentry *exfat_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,
exfat_nfs_get_inode);
}

const struct export_operations exfat_export_ops = {
.fh_to_dentry = exfat_fh_to_dentry,
.fh_to_parent = exfat_fh_to_parent,
};

/*======================================================================*/
/* Super Block Read Operations */
/*======================================================================*/
Expand Down Expand Up @@ -2448,6 +2487,7 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent)
sb->s_flags |= MS_NODIRATIME;
sb->s_magic = EXFAT_SUPER_MAGIC;
sb->s_op = &exfat_sops;
sb->s_export_op = &exfat_export_ops;

error = parse_options(data, silent, &debug, &sbi->options);
if (error)
Expand Down

0 comments on commit 8d291f5

Please sign in to comment.