Loading fs/cramfs/inode.c +12 −10 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,7 @@ static DEFINE_MUTEX(read_mutex); /* These macros may change in future, to provide better st_ino semantics. */ /* These macros may change in future, to provide better st_ino semantics. */ #define OFFSET(x) ((x)->i_ino) #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) if (!cino->offset) return offset + 1; return offset + 1; Loading @@ -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, 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; struct inode *inode; static struct timespec zerotime; static struct timespec zerotime; Loading Loading @@ -317,7 +317,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent) /* Set it all up.. */ /* Set it all up.. */ sb->s_op = &cramfs_ops; sb->s_op = &cramfs_ops; root = get_cramfs_inode(sb, &super.root, 0); root = get_cramfs_inode(sb, &super.root, 0); if (!root) if (IS_ERR(root)) goto out; goto out; sb->s_root = d_alloc_root(root); sb->s_root = d_alloc_root(root); if (!sb->s_root) { if (!sb->s_root) { Loading Loading @@ -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) static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) { { unsigned int offset = 0; unsigned int offset = 0; struct inode *inode = NULL; int sorted; int sorted; mutex_lock(&read_mutex); mutex_lock(&read_mutex); Loading @@ -449,8 +450,8 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s for (;;) { for (;;) { if (!namelen) { if (!namelen) { mutex_unlock(&read_mutex); inode = ERR_PTR(-EIO); return ERR_PTR(-EIO); goto out; } } if (name[namelen-1]) if (name[namelen-1]) break; break; Loading @@ -462,17 +463,18 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s if (retval > 0) if (retval > 0) continue; continue; if (!retval) { if (!retval) { struct cramfs_inode entry = *de; inode = get_cramfs_inode(dir->i_sb, de, dir_off); mutex_unlock(&read_mutex); break; d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off)); return NULL; } } /* else (retval < 0) */ /* else (retval < 0) */ if (sorted) if (sorted) break; break; } } out: mutex_unlock(&read_mutex); mutex_unlock(&read_mutex); d_add(dentry, NULL); if (IS_ERR(inode)) return ERR_CAST(inode); d_add(dentry, inode); return NULL; return NULL; } } Loading Loading
fs/cramfs/inode.c +12 −10 Original line number Original line Diff line number Diff line Loading @@ -37,7 +37,7 @@ static DEFINE_MUTEX(read_mutex); /* These macros may change in future, to provide better st_ino semantics. */ /* These macros may change in future, to provide better st_ino semantics. */ #define OFFSET(x) ((x)->i_ino) #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) if (!cino->offset) return offset + 1; return offset + 1; Loading @@ -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, 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; struct inode *inode; static struct timespec zerotime; static struct timespec zerotime; Loading Loading @@ -317,7 +317,7 @@ static int cramfs_fill_super(struct super_block *sb, void *data, int silent) /* Set it all up.. */ /* Set it all up.. */ sb->s_op = &cramfs_ops; sb->s_op = &cramfs_ops; root = get_cramfs_inode(sb, &super.root, 0); root = get_cramfs_inode(sb, &super.root, 0); if (!root) if (IS_ERR(root)) goto out; goto out; sb->s_root = d_alloc_root(root); sb->s_root = d_alloc_root(root); if (!sb->s_root) { if (!sb->s_root) { Loading Loading @@ -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) static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) { { unsigned int offset = 0; unsigned int offset = 0; struct inode *inode = NULL; int sorted; int sorted; mutex_lock(&read_mutex); mutex_lock(&read_mutex); Loading @@ -449,8 +450,8 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s for (;;) { for (;;) { if (!namelen) { if (!namelen) { mutex_unlock(&read_mutex); inode = ERR_PTR(-EIO); return ERR_PTR(-EIO); goto out; } } if (name[namelen-1]) if (name[namelen-1]) break; break; Loading @@ -462,17 +463,18 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s if (retval > 0) if (retval > 0) continue; continue; if (!retval) { if (!retval) { struct cramfs_inode entry = *de; inode = get_cramfs_inode(dir->i_sb, de, dir_off); mutex_unlock(&read_mutex); break; d_add(dentry, get_cramfs_inode(dir->i_sb, &entry, dir_off)); return NULL; } } /* else (retval < 0) */ /* else (retval < 0) */ if (sorted) if (sorted) break; break; } } out: mutex_unlock(&read_mutex); mutex_unlock(&read_mutex); d_add(dentry, NULL); if (IS_ERR(inode)) return ERR_CAST(inode); d_add(dentry, inode); return NULL; return NULL; } } Loading