Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207554
b: refs/heads/master
c: e971a6d
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Aug 9, 2010
1 parent f04fe48 commit 34877a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f053ddde7575090e09e2f5c4233d8a19f0925b93
refs/heads/master: e971a6d7b9daebfe2c11c590377d3933410ab929
30 changes: 8 additions & 22 deletions trunk/fs/hostfs/hostfs_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,13 @@ static struct inode *hostfs_iget(struct super_block *sb)
struct inode *inode;
long ret;

inode = iget_locked(sb, 0);
inode = new_inode(sb);
if (!inode)
return ERR_PTR(-ENOMEM);
if (inode->i_state & I_NEW) {
ret = hostfs_read_inode(inode);
if (ret < 0) {
iget_failed(inode);
return ERR_PTR(ret);
}
unlock_new_inode(inode);
ret = hostfs_read_inode(inode);
if (ret < 0) {
iput(inode);
return ERR_PTR(ret);
}
return inode;
}
Expand Down Expand Up @@ -299,29 +296,19 @@ static struct inode *hostfs_alloc_inode(struct super_block *sb)
return &hi->vfs_inode;
}

static void hostfs_delete_inode(struct inode *inode)
static void hostfs_evict_inode(struct inode *inode)
{
truncate_inode_pages(&inode->i_data, 0);
end_writeback(inode);
if (HOSTFS_I(inode)->fd != -1) {
close_file(&HOSTFS_I(inode)->fd);
HOSTFS_I(inode)->fd = -1;
}
clear_inode(inode);
}

static void hostfs_destroy_inode(struct inode *inode)
{
kfree(HOSTFS_I(inode)->host_filename);

/*
* XXX: This should not happen, probably. The check is here for
* additional safety.
*/
if (HOSTFS_I(inode)->fd != -1) {
close_file(&HOSTFS_I(inode)->fd);
printk(KERN_DEBUG "Closing host fd in .destroy_inode\n");
}

kfree(HOSTFS_I(inode));
}

Expand All @@ -339,9 +326,8 @@ static int hostfs_show_options(struct seq_file *seq, struct vfsmount *vfs)

static const struct super_operations hostfs_sbops = {
.alloc_inode = hostfs_alloc_inode,
.drop_inode = generic_delete_inode,
.delete_inode = hostfs_delete_inode,
.destroy_inode = hostfs_destroy_inode,
.evict_inode = hostfs_evict_inode,
.statfs = hostfs_statfs,
.show_options = hostfs_show_options,
};
Expand Down

0 comments on commit 34877a9

Please sign in to comment.