projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
iget: stop AFFS from using iget() and read_inode()
[cascardo/linux.git]
/
fs
/
affs
/
super.c
diff --git
a/fs/affs/super.c
b/fs/affs/super.c
index
c80191a
..
3c45d49
100644
(file)
--- a/
fs/affs/super.c
+++ b/
fs/affs/super.c
@@
-84,7
+84,7
@@
static void affs_destroy_inode(struct inode *inode)
kmem_cache_free(affs_inode_cachep, AFFS_I(inode));
}
kmem_cache_free(affs_inode_cachep, AFFS_I(inode));
}
-static void init_once(
void * foo, struct kmem_cache * cachep, unsigned long flags
)
+static void init_once(
struct kmem_cache *cachep, void *foo
)
{
struct affs_inode_info *ei = (struct affs_inode_info *) foo;
{
struct affs_inode_info *ei = (struct affs_inode_info *) foo;
@@
-113,7
+113,6
@@
static void destroy_inodecache(void)
static const struct super_operations affs_sops = {
.alloc_inode = affs_alloc_inode,
.destroy_inode = affs_destroy_inode,
static const struct super_operations affs_sops = {
.alloc_inode = affs_alloc_inode,
.destroy_inode = affs_destroy_inode,
- .read_inode = affs_read_inode,
.write_inode = affs_write_inode,
.put_inode = affs_put_inode,
.drop_inode = affs_drop_inode,
.write_inode = affs_write_inode,
.put_inode = affs_put_inode,
.drop_inode = affs_drop_inode,
@@
-271,6
+270,7
@@
static int affs_fill_super(struct super_block *sb, void *data, int silent)
unsigned long mount_flags;
int tmp_flags; /* fix remount prototype... */
u8 sig[4];
unsigned long mount_flags;
int tmp_flags; /* fix remount prototype... */
u8 sig[4];
+ int ret = -EINVAL;
pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
@@
-444,7
+444,12
@@
got_root:
/* set up enough so that it can read an inode */
/* set up enough so that it can read an inode */
- root_inode = iget(sb, root_block);
+ root_inode = affs_iget(sb, root_block);
+ if (IS_ERR(root_inode)) {
+ ret = PTR_ERR(root_inode);
+ goto out_error_noinode;
+ }
+
sb->s_root = d_alloc_root(root_inode);
if (!sb->s_root) {
printk(KERN_ERR "AFFS: Get root inode failed\n");
sb->s_root = d_alloc_root(root_inode);
if (!sb->s_root) {
printk(KERN_ERR "AFFS: Get root inode failed\n");
@@
-461,12
+466,13
@@
got_root:
out_error:
if (root_inode)
iput(root_inode);
out_error:
if (root_inode)
iput(root_inode);
+out_error_noinode:
kfree(sbi->s_bitmap);
affs_brelse(root_bh);
kfree(sbi->s_prefix);
kfree(sbi);
sb->s_fs_info = NULL;
kfree(sbi->s_bitmap);
affs_brelse(root_bh);
kfree(sbi->s_prefix);
kfree(sbi);
sb->s_fs_info = NULL;
- return
-EINVAL
;
+ return
ret
;
}
static int
}
static int