Commit 4826d83d authored by Ajeet Yadav's avatar Ajeet Yadav Committed by Phillip Lougher

Squashfs: use define instead of constant

Its better to use defined name instead of constant
Signed-off-by: default avatarAjeet Yadav <ajeet.yadav.77@gmail.com>
Signed-off-by: default avatarPhillip Lougher <phillip@squashfs.org.uk>
parent 192cfd58
......@@ -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--) {
......
......@@ -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--) {
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment