Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 117467
b: refs/heads/master
c: 5f556aa
h: refs/heads/master
i:
  117465: b165efc
  117463: 285b4a6
v: v3
  • Loading branch information
David Woodhouse authored and Al Viro committed Oct 23, 2008
1 parent f3e0241 commit d74b02d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d88f1833fcbb5663c86253039966f880f8f46b1a
refs/heads/master: 5f556aab907a358c7837cc9a83c3aea4e69cff5b
48 changes: 48 additions & 0 deletions trunk/fs/jffs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/mtd/super.h>
#include <linux/ctype.h>
#include <linux/namei.h>
#include <linux/exportfs.h>
#include "compr.h"
#include "nodelist.h"

Expand Down Expand Up @@ -62,6 +63,52 @@ static int jffs2_sync_fs(struct super_block *sb, int wait)
return 0;
}

static struct inode *jffs2_nfs_get_inode(struct super_block *sb, uint64_t ino,
uint32_t generation)
{
/* We don't care about i_generation. We'll destroy the flash
before we start re-using inode numbers anyway. And even
if that wasn't true, we'd have other problems...*/
return jffs2_iget(sb, ino);
}

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

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

static struct dentry *jffs2_get_parent(struct dentry *child)
{
struct jffs2_inode_info *f;
uint32_t pino;

BUG_ON(!S_ISDIR(child->d_inode->i_mode));

f = JFFS2_INODE_INFO(child->d_inode);

pino = f->inocache->pino_nlink;

JFFS2_DEBUG("Parent of directory ino #%u is #%u\n",
f->inocache->ino, pino);

return d_obtain_alias(jffs2_iget(child->d_inode->i_sb, pino));
}

static struct export_operations jffs2_export_ops = {
.get_parent = jffs2_get_parent,
.fh_to_dentry = jffs2_fh_to_dentry,
.fh_to_parent = jffs2_fh_to_parent,
};

static const struct super_operations jffs2_super_operations =
{
.alloc_inode = jffs2_alloc_inode,
Expand Down Expand Up @@ -104,6 +151,7 @@ static int jffs2_fill_super(struct super_block *sb, void *data, int silent)
spin_lock_init(&c->inocache_lock);

sb->s_op = &jffs2_super_operations;
sb->s_export_op = &jffs2_export_ops;
sb->s_flags = sb->s_flags | MS_NOATIME;
sb->s_xattr = jffs2_xattr_handlers;
#ifdef CONFIG_JFFS2_FS_POSIX_ACL
Expand Down

0 comments on commit d74b02d

Please sign in to comment.