Commit 45f90217 authored by Wei Yongjun's avatar Wei Yongjun Committed by Linus Torvalds

ext3: use unsigned instead of int for type of blocksize in fs/ext3/namei.c

Use unsigned instead of int for the parameter which carries a blocksize.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: default avatarWei Yongjun <yjwei@cn.fujitsu.com>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ecca9af0
...@@ -161,12 +161,12 @@ static struct dx_frame *dx_probe(struct qstr *entry, ...@@ -161,12 +161,12 @@ static struct dx_frame *dx_probe(struct qstr *entry,
struct dx_frame *frame, struct dx_frame *frame,
int *err); int *err);
static void dx_release (struct dx_frame *frames); static void dx_release (struct dx_frame *frames);
static int dx_make_map (struct ext3_dir_entry_2 *de, int size, static int dx_make_map(struct ext3_dir_entry_2 *de, unsigned blocksize,
struct dx_hash_info *hinfo, struct dx_map_entry map[]); struct dx_hash_info *hinfo, struct dx_map_entry map[]);
static void dx_sort_map(struct dx_map_entry *map, unsigned count); static void dx_sort_map(struct dx_map_entry *map, unsigned count);
static struct ext3_dir_entry_2 *dx_move_dirents (char *from, char *to, static struct ext3_dir_entry_2 *dx_move_dirents (char *from, char *to,
struct dx_map_entry *offsets, int count); struct dx_map_entry *offsets, int count);
static struct ext3_dir_entry_2* dx_pack_dirents (char *base, int size); static struct ext3_dir_entry_2 *dx_pack_dirents(char *base, unsigned blocksize);
static void dx_insert_block (struct dx_frame *frame, u32 hash, u32 block); static void dx_insert_block (struct dx_frame *frame, u32 hash, u32 block);
static int ext3_htree_next_block(struct inode *dir, __u32 hash, static int ext3_htree_next_block(struct inode *dir, __u32 hash,
struct dx_frame *frame, struct dx_frame *frame,
...@@ -708,14 +708,14 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash, ...@@ -708,14 +708,14 @@ int ext3_htree_fill_tree(struct file *dir_file, __u32 start_hash,
* Create map of hash values, offsets, and sizes, stored at end of block. * Create map of hash values, offsets, and sizes, stored at end of block.
* Returns number of entries mapped. * Returns number of entries mapped.
*/ */
static int dx_make_map (struct ext3_dir_entry_2 *de, int size, static int dx_make_map(struct ext3_dir_entry_2 *de, unsigned blocksize,
struct dx_hash_info *hinfo, struct dx_map_entry *map_tail) struct dx_hash_info *hinfo, struct dx_map_entry *map_tail)
{ {
int count = 0; int count = 0;
char *base = (char *) de; char *base = (char *) de;
struct dx_hash_info h = *hinfo; struct dx_hash_info h = *hinfo;
while ((char *) de < base + size) while ((char *) de < base + blocksize)
{ {
if (de->name_len && de->inode) { if (de->name_len && de->inode) {
ext3fs_dirhash(de->name, de->name_len, &h); ext3fs_dirhash(de->name, de->name_len, &h);
...@@ -1120,13 +1120,14 @@ dx_move_dirents(char *from, char *to, struct dx_map_entry *map, int count) ...@@ -1120,13 +1120,14 @@ dx_move_dirents(char *from, char *to, struct dx_map_entry *map, int count)
* Compact each dir entry in the range to the minimal rec_len. * Compact each dir entry in the range to the minimal rec_len.
* Returns pointer to last entry in range. * Returns pointer to last entry in range.
*/ */
static struct ext3_dir_entry_2* dx_pack_dirents(char *base, int size) static struct ext3_dir_entry_2 *dx_pack_dirents(char *base, unsigned blocksize)
{ {
struct ext3_dir_entry_2 *next, *to, *prev, *de = (struct ext3_dir_entry_2 *) base; struct ext3_dir_entry_2 *next, *to, *prev;
struct ext3_dir_entry_2 *de = (struct ext3_dir_entry_2 *)base;
unsigned rec_len = 0; unsigned rec_len = 0;
prev = to = de; prev = to = de;
while ((char*)de < base + size) { while ((char *)de < base + blocksize) {
next = ext3_next_entry(de); next = ext3_next_entry(de);
if (de->inode && de->name_len) { if (de->inode && de->name_len) {
rec_len = EXT3_DIR_REC_LEN(de->name_len); rec_len = EXT3_DIR_REC_LEN(de->name_len);
......
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