diff options
Diffstat (limited to 'fs/ext2/dir.c')
-rw-r--r-- | fs/ext2/dir.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 8dededd80fe2..a78c6b4af060 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c | |||
@@ -41,8 +41,8 @@ static inline __le16 ext2_rec_len_to_disk(unsigned len) | |||
41 | { | 41 | { |
42 | if (len == (1 << 16)) | 42 | if (len == (1 << 16)) |
43 | return cpu_to_le16(EXT2_MAX_REC_LEN); | 43 | return cpu_to_le16(EXT2_MAX_REC_LEN); |
44 | else if (len > (1 << 16)) | 44 | else |
45 | BUG(); | 45 | BUG_ON(len > (1 << 16)); |
46 | return cpu_to_le16(len); | 46 | return cpu_to_le16(len); |
47 | } | 47 | } |
48 | 48 | ||
@@ -295,11 +295,11 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) | |||
295 | struct page *page = ext2_get_page(inode, n); | 295 | struct page *page = ext2_get_page(inode, n); |
296 | 296 | ||
297 | if (IS_ERR(page)) { | 297 | if (IS_ERR(page)) { |
298 | ext2_error(sb, __FUNCTION__, | 298 | ext2_error(sb, __func__, |
299 | "bad page in #%lu", | 299 | "bad page in #%lu", |
300 | inode->i_ino); | 300 | inode->i_ino); |
301 | filp->f_pos += PAGE_CACHE_SIZE - offset; | 301 | filp->f_pos += PAGE_CACHE_SIZE - offset; |
302 | return -EIO; | 302 | return PTR_ERR(page); |
303 | } | 303 | } |
304 | kaddr = page_address(page); | 304 | kaddr = page_address(page); |
305 | if (unlikely(need_revalidate)) { | 305 | if (unlikely(need_revalidate)) { |
@@ -314,7 +314,7 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir) | |||
314 | limit = kaddr + ext2_last_byte(inode, n) - EXT2_DIR_REC_LEN(1); | 314 | limit = kaddr + ext2_last_byte(inode, n) - EXT2_DIR_REC_LEN(1); |
315 | for ( ;(char*)de <= limit; de = ext2_next_entry(de)) { | 315 | for ( ;(char*)de <= limit; de = ext2_next_entry(de)) { |
316 | if (de->rec_len == 0) { | 316 | if (de->rec_len == 0) { |
317 | ext2_error(sb, __FUNCTION__, | 317 | ext2_error(sb, __func__, |
318 | "zero-length directory entry"); | 318 | "zero-length directory entry"); |
319 | ext2_put_page(page); | 319 | ext2_put_page(page); |
320 | return -EIO; | 320 | return -EIO; |
@@ -381,7 +381,7 @@ struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir, | |||
381 | kaddr += ext2_last_byte(dir, n) - reclen; | 381 | kaddr += ext2_last_byte(dir, n) - reclen; |
382 | while ((char *) de <= kaddr) { | 382 | while ((char *) de <= kaddr) { |
383 | if (de->rec_len == 0) { | 383 | if (de->rec_len == 0) { |
384 | ext2_error(dir->i_sb, __FUNCTION__, | 384 | ext2_error(dir->i_sb, __func__, |
385 | "zero-length directory entry"); | 385 | "zero-length directory entry"); |
386 | ext2_put_page(page); | 386 | ext2_put_page(page); |
387 | goto out; | 387 | goto out; |
@@ -396,7 +396,7 @@ struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir, | |||
396 | n = 0; | 396 | n = 0; |
397 | /* next page is past the blocks we've got */ | 397 | /* next page is past the blocks we've got */ |
398 | if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { | 398 | if (unlikely(n > (dir->i_blocks >> (PAGE_CACHE_SHIFT - 9)))) { |
399 | ext2_error(dir->i_sb, __FUNCTION__, | 399 | ext2_error(dir->i_sb, __func__, |
400 | "dir %lu size %lld exceeds block count %llu", | 400 | "dir %lu size %lld exceeds block count %llu", |
401 | dir->i_ino, dir->i_size, | 401 | dir->i_ino, dir->i_size, |
402 | (unsigned long long)dir->i_blocks); | 402 | (unsigned long long)dir->i_blocks); |
@@ -506,7 +506,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode) | |||
506 | goto got_it; | 506 | goto got_it; |
507 | } | 507 | } |
508 | if (de->rec_len == 0) { | 508 | if (de->rec_len == 0) { |
509 | ext2_error(dir->i_sb, __FUNCTION__, | 509 | ext2_error(dir->i_sb, __func__, |
510 | "zero-length directory entry"); | 510 | "zero-length directory entry"); |
511 | err = -EIO; | 511 | err = -EIO; |
512 | goto out_unlock; | 512 | goto out_unlock; |
@@ -578,7 +578,7 @@ int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page ) | |||
578 | 578 | ||
579 | while ((char*)de < (char*)dir) { | 579 | while ((char*)de < (char*)dir) { |
580 | if (de->rec_len == 0) { | 580 | if (de->rec_len == 0) { |
581 | ext2_error(inode->i_sb, __FUNCTION__, | 581 | ext2_error(inode->i_sb, __func__, |
582 | "zero-length directory entry"); | 582 | "zero-length directory entry"); |
583 | err = -EIO; | 583 | err = -EIO; |
584 | goto out; | 584 | goto out; |
@@ -670,7 +670,7 @@ int ext2_empty_dir (struct inode * inode) | |||
670 | 670 | ||
671 | while ((char *)de <= kaddr) { | 671 | while ((char *)de <= kaddr) { |
672 | if (de->rec_len == 0) { | 672 | if (de->rec_len == 0) { |
673 | ext2_error(inode->i_sb, __FUNCTION__, | 673 | ext2_error(inode->i_sb, __func__, |
674 | "zero-length directory entry"); | 674 | "zero-length directory entry"); |
675 | printk("kaddr=%p, de=%p\n", kaddr, de); | 675 | printk("kaddr=%p, de=%p\n", kaddr, de); |
676 | goto not_empty; | 676 | goto not_empty; |