diff options
author | Ajeet Yadav <ajeet.yadav.77@gmail.com> | 2012-02-02 07:34:49 (GMT) |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2012-03-10 03:00:54 (GMT) |
commit | 4826d83d9c4f6bbf61f997e7b68547b4bffd8a49 (patch) | |
tree | 097311a82c02b3d0d8fc35ed1589e3edd6bccbcb | |
parent | 192cfd58774b4d17b2fe8bdc77d89c2ef4e0591d (diff) | |
download | linux-4826d83d9c4f6bbf61f997e7b68547b4bffd8a49.tar.xz |
Squashfs: use define instead of constant
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>
-rw-r--r-- | fs/squashfs/dir.c | 3 | ||||
-rw-r--r-- | fs/squashfs/namei.c | 3 | ||||
-rw-r--r-- | fs/squashfs/squashfs_fs.h | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/fs/squashfs/dir.c b/fs/squashfs/dir.c index 9dfe2ce..4a812bfc 100644 --- a/fs/squashfs/dir.c +++ b/fs/squashfs/dir.c @@ -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--) { diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c index 0682b38..66c70fc 100644 --- a/fs/squashfs/namei.c +++ b/fs/squashfs/namei.c @@ -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--) { diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h index e8e1464..b2f9f62 100644 --- a/fs/squashfs/squashfs_fs.h +++ b/fs/squashfs/squashfs_fs.h @@ -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) |