aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-02-14 21:46:54 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-02-14 21:46:54 -0500
commit8bad4597c2d71365adfa846ea1ca6cf99161a455 (patch)
tree8143f59887776dd77f6e4aa0ed886b143db512ca /fs
parente187c6588d6ef3169db53c389b3de9dfde3b16cc (diff)
ext4: Use unsigned int for blocksize in dx_make_map() and dx_pack_dirents()
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/namei.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 83410244d3ee..04824958cba5 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -161,12 +161,12 @@ static struct dx_frame *dx_probe(const struct qstr *d_name,
161 struct dx_frame *frame, 161 struct dx_frame *frame,
162 int *err); 162 int *err);
163static void dx_release(struct dx_frame *frames); 163static void dx_release(struct dx_frame *frames);
164static int dx_make_map(struct ext4_dir_entry_2 *de, int size, 164static int dx_make_map(struct ext4_dir_entry_2 *de, unsigned blocksize,
165 struct dx_hash_info *hinfo, struct dx_map_entry map[]); 165 struct dx_hash_info *hinfo, struct dx_map_entry map[]);
166static void dx_sort_map(struct dx_map_entry *map, unsigned count); 166static void dx_sort_map(struct dx_map_entry *map, unsigned count);
167static struct ext4_dir_entry_2 *dx_move_dirents(char *from, char *to, 167static struct ext4_dir_entry_2 *dx_move_dirents(char *from, char *to,
168 struct dx_map_entry *offsets, int count); 168 struct dx_map_entry *offsets, int count);
169static struct ext4_dir_entry_2* dx_pack_dirents(char *base, int size); 169static struct ext4_dir_entry_2* dx_pack_dirents(char *base, unsigned blocksize);
170static void dx_insert_block(struct dx_frame *frame, 170static void dx_insert_block(struct dx_frame *frame,
171 u32 hash, ext4_lblk_t block); 171 u32 hash, ext4_lblk_t block);
172static int ext4_htree_next_block(struct inode *dir, __u32 hash, 172static int ext4_htree_next_block(struct inode *dir, __u32 hash,
@@ -713,15 +713,15 @@ errout:
713 * Create map of hash values, offsets, and sizes, stored at end of block. 713 * Create map of hash values, offsets, and sizes, stored at end of block.
714 * Returns number of entries mapped. 714 * Returns number of entries mapped.
715 */ 715 */
716static int dx_make_map (struct ext4_dir_entry_2 *de, int size, 716static int dx_make_map(struct ext4_dir_entry_2 *de, unsigned blocksize,
717 struct dx_hash_info *hinfo, struct dx_map_entry *map_tail) 717 struct dx_hash_info *hinfo,
718 struct dx_map_entry *map_tail)
718{ 719{
719 int count = 0; 720 int count = 0;
720 char *base = (char *) de; 721 char *base = (char *) de;
721 struct dx_hash_info h = *hinfo; 722 struct dx_hash_info h = *hinfo;
722 723
723 while ((char *) de < base + size) 724 while ((char *) de < base + blocksize) {
724 {
725 if (de->name_len && de->inode) { 725 if (de->name_len && de->inode) {
726 ext4fs_dirhash(de->name, de->name_len, &h); 726 ext4fs_dirhash(de->name, de->name_len, &h);
727 map_tail--; 727 map_tail--;
@@ -1130,13 +1130,13 @@ dx_move_dirents(char *from, char *to, struct dx_map_entry *map, int count)
1130 * Compact each dir entry in the range to the minimal rec_len. 1130 * Compact each dir entry in the range to the minimal rec_len.
1131 * Returns pointer to last entry in range. 1131 * Returns pointer to last entry in range.
1132 */ 1132 */
1133static struct ext4_dir_entry_2* dx_pack_dirents(char *base, int size) 1133static struct ext4_dir_entry_2* dx_pack_dirents(char *base, unsigned blocksize)
1134{ 1134{
1135 struct ext4_dir_entry_2 *next, *to, *prev, *de = (struct ext4_dir_entry_2 *) base; 1135 struct ext4_dir_entry_2 *next, *to, *prev, *de = (struct ext4_dir_entry_2 *) base;
1136 unsigned rec_len = 0; 1136 unsigned rec_len = 0;
1137 1137
1138 prev = to = de; 1138 prev = to = de;
1139 while ((char*)de < base + size) { 1139 while ((char*)de < base + blocksize) {
1140 next = ext4_next_entry(de); 1140 next = ext4_next_entry(de);
1141 if (de->inode && de->name_len) { 1141 if (de->inode && de->name_len) {
1142 rec_len = EXT4_DIR_REC_LEN(de->name_len); 1142 rec_len = EXT4_DIR_REC_LEN(de->name_len);