mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
jfs: new export ops
Trivial switch over to the new generic helpers. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Neil Brown <neilb@suse.de> Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
05da080482
commit
d425de7043
3 changed files with 27 additions and 18 deletions
|
@ -18,6 +18,8 @@
|
||||||
#ifndef _H_JFS_INODE
|
#ifndef _H_JFS_INODE
|
||||||
#define _H_JFS_INODE
|
#define _H_JFS_INODE
|
||||||
|
|
||||||
|
struct fid;
|
||||||
|
|
||||||
extern struct inode *ialloc(struct inode *, umode_t);
|
extern struct inode *ialloc(struct inode *, umode_t);
|
||||||
extern int jfs_fsync(struct file *, struct dentry *, int);
|
extern int jfs_fsync(struct file *, struct dentry *, int);
|
||||||
extern int jfs_ioctl(struct inode *, struct file *,
|
extern int jfs_ioctl(struct inode *, struct file *,
|
||||||
|
@ -32,7 +34,10 @@ extern void jfs_truncate_nolock(struct inode *, loff_t);
|
||||||
extern void jfs_free_zero_link(struct inode *);
|
extern void jfs_free_zero_link(struct inode *);
|
||||||
extern struct dentry *jfs_get_parent(struct dentry *dentry);
|
extern struct dentry *jfs_get_parent(struct dentry *dentry);
|
||||||
extern void jfs_get_inode_flags(struct jfs_inode_info *);
|
extern void jfs_get_inode_flags(struct jfs_inode_info *);
|
||||||
extern struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp);
|
extern struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
|
||||||
|
int fh_len, int fh_type);
|
||||||
|
extern struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
|
||||||
|
int fh_len, int fh_type);
|
||||||
extern void jfs_set_inode_flags(struct inode *);
|
extern void jfs_set_inode_flags(struct inode *);
|
||||||
extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
|
extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/ctype.h>
|
#include <linux/ctype.h>
|
||||||
#include <linux/quotaops.h>
|
#include <linux/quotaops.h>
|
||||||
|
#include <linux/exportfs.h>
|
||||||
#include "jfs_incore.h"
|
#include "jfs_incore.h"
|
||||||
#include "jfs_superblock.h"
|
#include "jfs_superblock.h"
|
||||||
#include "jfs_inode.h"
|
#include "jfs_inode.h"
|
||||||
|
@ -1477,13 +1478,10 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
|
||||||
return dentry;
|
return dentry;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp)
|
static struct inode *jfs_nfs_get_inode(struct super_block *sb,
|
||||||
|
u64 ino, u32 generation)
|
||||||
{
|
{
|
||||||
__u32 *objp = vobjp;
|
|
||||||
unsigned long ino = objp[0];
|
|
||||||
__u32 generation = objp[1];
|
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct dentry *result;
|
|
||||||
|
|
||||||
if (ino == 0)
|
if (ino == 0)
|
||||||
return ERR_PTR(-ESTALE);
|
return ERR_PTR(-ESTALE);
|
||||||
|
@ -1493,20 +1491,25 @@ struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp)
|
||||||
|
|
||||||
if (is_bad_inode(inode) ||
|
if (is_bad_inode(inode) ||
|
||||||
(generation && inode->i_generation != generation)) {
|
(generation && inode->i_generation != generation)) {
|
||||||
result = ERR_PTR(-ESTALE);
|
iput(inode);
|
||||||
goto out_iput;
|
return ERR_PTR(-ESTALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = d_alloc_anon(inode);
|
return inode;
|
||||||
if (!result) {
|
}
|
||||||
result = ERR_PTR(-ENOMEM);
|
|
||||||
goto out_iput;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
|
|
||||||
out_iput:
|
struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
|
||||||
iput(inode);
|
int fh_len, int fh_type)
|
||||||
return result;
|
{
|
||||||
|
return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
|
||||||
|
jfs_nfs_get_inode);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct dentry *jfs_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,
|
||||||
|
jfs_nfs_get_inode);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dentry *jfs_get_parent(struct dentry *dentry)
|
struct dentry *jfs_get_parent(struct dentry *dentry)
|
||||||
|
|
|
@ -738,7 +738,8 @@ static const struct super_operations jfs_super_operations = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct export_operations jfs_export_operations = {
|
static struct export_operations jfs_export_operations = {
|
||||||
.get_dentry = jfs_get_dentry,
|
.fh_to_dentry = jfs_fh_to_dentry,
|
||||||
|
.fh_to_parent = jfs_fh_to_parent,
|
||||||
.get_parent = jfs_get_parent,
|
.get_parent = jfs_get_parent,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue