提交 4176ed59 编写于 作者: A Andi Drebes 提交者: Linus Torvalds

fs/cramfs/inode.c: replace hardcoded value with preprocessor constant

Remove the hardcoded value 256 in fs/cramfs/inode.c and replaces it with
CRAMFS_MAXPATHLEN.

Tested on an i386 box.
Signed-off-by: NAndi Drebes <lists-receive@programmierforen.de>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 6bbfb077
...@@ -361,7 +361,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -361,7 +361,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (offset & 3) if (offset & 3)
return -EINVAL; return -EINVAL;
buf = kmalloc(256, GFP_KERNEL); buf = kmalloc(CRAMFS_MAXPATHLEN, GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
...@@ -375,7 +375,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -375,7 +375,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
int namelen, error; int namelen, error;
mutex_lock(&read_mutex); mutex_lock(&read_mutex);
de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+256); de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
name = (char *)(de+1); name = (char *)(de+1);
/* /*
...@@ -425,7 +425,7 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s ...@@ -425,7 +425,7 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
char *name; char *name;
int namelen, retval; int namelen, retval;
de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+256); de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
name = (char *)(de+1); name = (char *)(de+1);
/* Try to take advantage of sorted directories */ /* Try to take advantage of sorted directories */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册