diff options
Diffstat (limited to 'fs/befs/linuxvfs.c')
-rw-r--r-- | fs/befs/linuxvfs.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index d626756ff721..a16fbd4e8241 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -133,14 +133,6 @@ befs_get_block(struct inode *inode, sector_t block, | |||
133 | 133 | ||
134 | befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld", | 134 | befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld", |
135 | (unsigned long)inode->i_ino, (long)block); | 135 | (unsigned long)inode->i_ino, (long)block); |
136 | |||
137 | if (block < 0) { | ||
138 | befs_error(sb, "befs_get_block() was asked for a block " | ||
139 | "number less than zero: block %ld in inode %lu", | ||
140 | (long)block, (unsigned long)inode->i_ino); | ||
141 | return -EIO; | ||
142 | } | ||
143 | |||
144 | if (create) { | 136 | if (create) { |
145 | befs_error(sb, "befs_get_block() was asked to write to " | 137 | befs_error(sb, "befs_get_block() was asked to write to " |
146 | "block %ld in inode %lu", (long)block, | 138 | "block %ld in inode %lu", (long)block, |
@@ -396,9 +388,8 @@ static struct inode *befs_iget(struct super_block *sb, unsigned long ino) | |||
396 | if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){ | 388 | if (S_ISLNK(inode->i_mode) && !(befs_ino->i_flags & BEFS_LONG_SYMLINK)){ |
397 | inode->i_size = 0; | 389 | inode->i_size = 0; |
398 | inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; | 390 | inode->i_blocks = befs_sb->block_size / VFS_BLOCK_SIZE; |
399 | strncpy(befs_ino->i_data.symlink, raw_inode->data.symlink, | 391 | strlcpy(befs_ino->i_data.symlink, raw_inode->data.symlink, |
400 | BEFS_SYMLINK_LEN - 1); | 392 | BEFS_SYMLINK_LEN); |
401 | befs_ino->i_data.symlink[BEFS_SYMLINK_LEN - 1] = '\0'; | ||
402 | } else { | 393 | } else { |
403 | int num_blks; | 394 | int num_blks; |
404 | 395 | ||
@@ -591,21 +582,21 @@ befs_utf2nls(struct super_block *sb, const char *in, | |||
591 | /** | 582 | /** |
592 | * befs_nls2utf - Convert NLS string to utf8 encodeing | 583 | * befs_nls2utf - Convert NLS string to utf8 encodeing |
593 | * @sb: Superblock | 584 | * @sb: Superblock |
594 | * @src: Input string buffer in NLS format | 585 | * @in: Input string buffer in NLS format |
595 | * @srclen: Length of input string in bytes | 586 | * @in_len: Length of input string in bytes |
596 | * @dest: The output string in UTF-8 format | 587 | * @out: The output string in UTF-8 format |
597 | * @destlen: Length of the output buffer | 588 | * @out_len: Length of the output buffer |
598 | * | 589 | * |
599 | * Converts input string @src, which is in the format of the loaded NLS map, | 590 | * Converts input string @in, which is in the format of the loaded NLS map, |
600 | * into a utf8 string. | 591 | * into a utf8 string. |
601 | * | 592 | * |
602 | * The destination string @dest is allocated by this function and the caller is | 593 | * The destination string @out is allocated by this function and the caller is |
603 | * responsible for freeing it with kfree() | 594 | * responsible for freeing it with kfree() |
604 | * | 595 | * |
605 | * On return, *@destlen is the length of @dest in bytes. | 596 | * On return, *@out_len is the length of @out in bytes. |
606 | * | 597 | * |
607 | * On success, the return value is the number of utf8 characters written to | 598 | * On success, the return value is the number of utf8 characters written to |
608 | * the output buffer @dest. | 599 | * the output buffer @out. |
609 | * | 600 | * |
610 | * On Failure, a negative number coresponding to the error code is returned. | 601 | * On Failure, a negative number coresponding to the error code is returned. |
611 | */ | 602 | */ |