Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 283216
b: refs/heads/master
c: 0b2c4e3
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jan 10, 2012
1 parent 392abce commit bfe9f76
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 16 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: 3e25eb9c4bb649acdddb333d10774b640190f727
refs/heads/master: 0b2c4e39c014219ef73f05ab580c284bf8e6af0a
21 changes: 9 additions & 12 deletions trunk/fs/coda/cnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,19 +156,16 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
}

/* the CONTROL inode is made without asking attributes from Venus */
int coda_cnode_makectl(struct inode **inode, struct super_block *sb)
struct inode *coda_cnode_makectl(struct super_block *sb)
{
int error = -ENOMEM;

*inode = new_inode(sb);
if (*inode) {
(*inode)->i_ino = CTL_INO;
(*inode)->i_op = &coda_ioctl_inode_operations;
(*inode)->i_fop = &coda_ioctl_operations;
(*inode)->i_mode = 0444;
error = 0;
struct inode *inode = new_inode(sb);
if (inode) {
inode->i_ino = CTL_INO;
inode->i_op = &coda_ioctl_inode_operations;
inode->i_fop = &coda_ioctl_operations;
inode->i_mode = 0444;
return inode;
}

return error;
return ERR_PTR(-ENOMEM);
}

2 changes: 1 addition & 1 deletion trunk/fs/coda/coda_fs_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct coda_file_info {

int coda_cnode_make(struct inode **, struct CodaFid *, struct super_block *);
struct inode *coda_iget(struct super_block *sb, struct CodaFid *fid, struct coda_vattr *attr);
int coda_cnode_makectl(struct inode **inode, struct super_block *sb);
struct inode *coda_cnode_makectl(struct super_block *sb);
struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb);
void coda_replace_fid(struct inode *, struct CodaFid *, struct CodaFid *);

Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/coda/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc

/* control object, create inode on the fly */
if (coda_isroot(dir) && coda_iscontrol(name, length)) {
error = coda_cnode_makectl(&inode, dir->i_sb);
inode = coda_cnode_makectl(dir->i_sb);
type = CODA_NOCACHE;
goto exit;
}
Expand All @@ -125,7 +125,7 @@ static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, struc
return ERR_PTR(error);

exit:
if (inode && (type & CODA_NOCACHE))
if (inode && !IS_ERR(inode) && (type & CODA_NOCACHE))
coda_flag_inode(inode, C_VATTR | C_PURGE);

return d_splice_alias(inode, entry);
Expand Down

0 comments on commit bfe9f76

Please sign in to comment.