aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorLeon Romanovsky <leon@leon.nu>2012-12-27 12:55:46 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2012-12-27 21:27:53 -0500
commit9836b8b9499cb25ea32cad9fff640eef874c5431 (patch)
treeb7d05ce46e6b1f86aea3794ba7b0eddf9db8c9bd /fs/f2fs/dir.c
parent2b50638decdb9a8585654a5acf1c8ce5962f1951 (diff)
f2fs: unify string length declarations and usage
This patch is intended to unify string length declarations and usage. There are number of calls to strlen which return size_t object. The size of this object depends on compiler if it will be bigger, equal or even smaller than an unsigned int Signed-off-by: Leon Romanovsky <leon@leon.nu> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 4a78d6c4f3a7..951ed52748f6 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -75,7 +75,7 @@ static unsigned long dir_block_index(unsigned int level, unsigned int idx)
75 return bidx; 75 return bidx;
76} 76}
77 77
78static bool early_match_name(const char *name, int namelen, 78static bool early_match_name(const char *name, size_t namelen,
79 f2fs_hash_t namehash, struct f2fs_dir_entry *de) 79 f2fs_hash_t namehash, struct f2fs_dir_entry *de)
80{ 80{
81 if (le16_to_cpu(de->name_len) != namelen) 81 if (le16_to_cpu(de->name_len) != namelen)
@@ -88,7 +88,7 @@ static bool early_match_name(const char *name, int namelen,
88} 88}
89 89
90static struct f2fs_dir_entry *find_in_block(struct page *dentry_page, 90static struct f2fs_dir_entry *find_in_block(struct page *dentry_page,
91 const char *name, int namelen, int *max_slots, 91 const char *name, size_t namelen, int *max_slots,
92 f2fs_hash_t namehash, struct page **res_page) 92 f2fs_hash_t namehash, struct page **res_page)
93{ 93{
94 struct f2fs_dir_entry *de; 94 struct f2fs_dir_entry *de;
@@ -127,7 +127,7 @@ found:
127} 127}
128 128
129static struct f2fs_dir_entry *find_in_level(struct inode *dir, 129static struct f2fs_dir_entry *find_in_level(struct inode *dir,
130 unsigned int level, const char *name, int namelen, 130 unsigned int level, const char *name, size_t namelen,
131 f2fs_hash_t namehash, struct page **res_page) 131 f2fs_hash_t namehash, struct page **res_page)
132{ 132{
133 int s = GET_DENTRY_SLOTS(namelen); 133 int s = GET_DENTRY_SLOTS(namelen);
@@ -182,7 +182,7 @@ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
182 struct qstr *child, struct page **res_page) 182 struct qstr *child, struct page **res_page)
183{ 183{
184 const char *name = child->name; 184 const char *name = child->name;
185 int namelen = child->len; 185 size_t namelen = child->len;
186 unsigned long npages = dir_blocks(dir); 186 unsigned long npages = dir_blocks(dir);
187 struct f2fs_dir_entry *de = NULL; 187 struct f2fs_dir_entry *de = NULL;
188 f2fs_hash_t name_hash; 188 f2fs_hash_t name_hash;
@@ -383,7 +383,7 @@ int f2fs_add_link(struct dentry *dentry, struct inode *inode)
383 struct inode *dir = dentry->d_parent->d_inode; 383 struct inode *dir = dentry->d_parent->d_inode;
384 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); 384 struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb);
385 const char *name = dentry->d_name.name; 385 const char *name = dentry->d_name.name;
386 int namelen = dentry->d_name.len; 386 size_t namelen = dentry->d_name.len;
387 struct page *dentry_page = NULL; 387 struct page *dentry_page = NULL;
388 struct f2fs_dentry_block *dentry_blk = NULL; 388 struct f2fs_dentry_block *dentry_blk = NULL;
389 int slots = GET_DENTRY_SLOTS(namelen); 389 int slots = GET_DENTRY_SLOTS(namelen);