Skip to content

Commit

Permalink
fs/cramfs/inode.c: replace hardcoded value with preprocessor constant
Browse files Browse the repository at this point in the history
Remove the hardcoded value 256 in fs/cramfs/inode.c and replaces it with
CRAMFS_MAXPATHLEN.

Tested on an i386 box.
Signed-off-by: Andi Drebes <lists-receive@programmierforen.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andi Drebes authored and Linus Torvalds committed Oct 18, 2007
1 parent 6bbfb07 commit 4176ed5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/cramfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (offset & 3)
return -EINVAL;

buf = kmalloc(256, GFP_KERNEL);
buf = kmalloc(CRAMFS_MAXPATHLEN, GFP_KERNEL);
if (!buf)
return -ENOMEM;

Expand All @@ -375,7 +375,7 @@ static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
int namelen, error;

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);

/*
Expand Down Expand Up @@ -425,7 +425,7 @@ static struct dentry * cramfs_lookup(struct inode *dir, struct dentry *dentry, s
char *name;
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);

/* Try to take advantage of sorted directories */
Expand Down

0 comments on commit 4176ed5

Please sign in to comment.