Commit 4176ed593866b5e4bcf86896e0734315ad46661b

Authored by Andi Drebes
Committed by Linus Torvalds
1 parent 6bbfb07766

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 <lists-receive@programmierforen.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -361,7 +361,7 @@
361 361 if (offset & 3)
362 362 return -EINVAL;
363 363  
364   - buf = kmalloc(256, GFP_KERNEL);
  364 + buf = kmalloc(CRAMFS_MAXPATHLEN, GFP_KERNEL);
365 365 if (!buf)
366 366 return -ENOMEM;
367 367  
... ... @@ -375,7 +375,7 @@
375 375 int namelen, error;
376 376  
377 377 mutex_lock(&read_mutex);
378   - de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+256);
  378 + de = cramfs_read(sb, OFFSET(inode) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
379 379 name = (char *)(de+1);
380 380  
381 381 /*
... ... @@ -425,7 +425,7 @@
425 425 char *name;
426 426 int namelen, retval;
427 427  
428   - de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+256);
  428 + de = cramfs_read(dir->i_sb, OFFSET(dir) + offset, sizeof(*de)+CRAMFS_MAXPATHLEN);
429 429 name = (char *)(de+1);
430 430  
431 431 /* Try to take advantage of sorted directories */