Skip to content

Commit

Permalink
Squashfs: use define instead of constant
Browse files Browse the repository at this point in the history
Its better to use defined name instead of constant

Signed-off-by: Ajeet Yadav <ajeet.yadav.77@gmail.com>
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
  • Loading branch information
Ajeet Yadav authored and Phillip Lougher committed Mar 10, 2012
1 parent 192cfd5 commit 4826d83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/squashfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir)

dir_count = le32_to_cpu(dirh.count) + 1;

/* dir_count should never be larger than 256 */
if (dir_count > 256)
if (dir_count > SQUASHFS_DIR_COUNT)
goto failed_read;

while (dir_count--) {
Expand Down
3 changes: 1 addition & 2 deletions fs/squashfs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry,

dir_count = le32_to_cpu(dirh.count) + 1;

/* dir_count should never be larger than 256 */
if (dir_count > 256)
if (dir_count > SQUASHFS_DIR_COUNT)
goto data_error;

while (dir_count--) {
Expand Down
3 changes: 3 additions & 0 deletions fs/squashfs/squashfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
/* Max length of filename (not 255) */
#define SQUASHFS_NAME_LEN 256

/* Max value for directory header count*/
#define SQUASHFS_DIR_COUNT 256

#define SQUASHFS_INVALID_FRAG (0xffffffffU)
#define SQUASHFS_INVALID_XATTR (0xffffffffU)
#define SQUASHFS_INVALID_BLK (-1LL)
Expand Down

0 comments on commit 4826d83

Please sign in to comment.