From: Andi Drebes Date: Thu, 18 Oct 2007 10:06:55 +0000 (-0700) Subject: fs/cramfs/inode.c: replace hardcoded value with preprocessor constant X-Git-Tag: v2.6.24-rc1~324 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4176ed593866b5e4bcf86896e0734315ad46661b;p=linux-2.6 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: Andi Drebes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 7f76abbe94..350680fd7d 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c @@ -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; @@ -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); /* @@ -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 */