Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254984
b: refs/heads/master
c: 0577d1b
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jul 18, 2011
1 parent eff5a5a commit 4ebf1e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 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: 642c937b4ed2e51d2f2e4c46ab7cd8b5bddf268b
refs/heads/master: 0577d1ba411f9c40693b8b3e4aa7e0892cd03091
22 changes: 12 additions & 10 deletions trunk/fs/cramfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static DEFINE_MUTEX(read_mutex);
/* These macros may change in future, to provide better st_ino semantics. */
#define OFFSET(x) ((x)->i_ino)

static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset)
static unsigned long cramino(const struct cramfs_inode *cino, unsigned int offset)
{
if (!cino->offset)
return offset + 1;
Expand All @@ -61,7 +61,7 @@ static unsigned long cramino(struct cramfs_inode *cino, unsigned int offset)
}

static struct inode *get_cramfs_inode(struct super_block *sb,
struct cramfs_inode *cramfs_inode, unsigned int offset)
const struct cramfs_inode *cramfs_inode, unsigned int offset)
{
struct inode *inode;
static struct timespec zerotime;
Expand Down Expand Up @@ -317,7 +317,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
/* Set it all up.. */
sb->s_op = &cramfs_ops;
root = get_cramfs_inode(sb, &super.root, 0);
if (!root)
if (IS_ERR(root))
goto out;
sb->s_root = d_alloc_root(root);
if (!sb->s_root) {
Expand Down Expand Up @@ -423,6 +423,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
{
unsigned int offset = 0;
struct inode *inode = NULL;
int sorted;

mutex_lock(&read_mutex);
Expand All @@ -449,8 +450,8 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s

for (;;) {
if (!namelen) {
mutex_unlock(&read_mutex);
return ERR_PTR(-EIO);
inode = ERR_PTR(-EIO);
goto out;
}
if (name[namelen-1])
break;
Expand All @@ -462,17 +463,18 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
if (retval > 0)
continue;
if (!retval) {
struct cramfs_inode entry = *de;
mutex_unlock(&read_mutex);
d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off));
return NULL;
inode = get_cramfs_inode(dir->i_sb, de, dir_off);
break;
}
/* else (retval < 0) */
if (sorted)
break;
}
out:
mutex_unlock(&read_mutex);
d_add(dentry, NULL);
if (IS_ERR(inode))
return ERR_CAST(inode);
d_add(dentry, inode);
return NULL;
}

Expand Down

0 comments on commit 4ebf1e8

Please sign in to comment.