All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 2/3] fs/cramfs/inode.c: replace hardcoded value with preprocessor constant
@ 2007-08-30 15:35 Andi Drebes
  0 siblings, 0 replies; only message in thread
From: Andi Drebes @ 2007-08-30 15:35 UTC (permalink / raw)
  To: kernel-janitors

This patch removes 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>
---
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 5286f4e..ca6a4b5 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 */

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-30 15:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 15:35 [patch 2/3] fs/cramfs/inode.c: replace hardcoded value with preprocessor constant Andi Drebes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.