Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330139
b: refs/heads/master
c: f08b498
h: refs/heads/master
i:
  330137: 726ccee
  330135: e41d4e5
v: v3
  • Loading branch information
Cruz Julian Bishop authored and Linus Torvalds committed Oct 5, 2012
1 parent 0580ce7 commit 9d8f12c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f36f6100a29ef5a48f451d7123d0e57850b1f0f
refs/heads/master: f08b4988f229fb41a4995829dc0db34c5e35dfbb
23 changes: 14 additions & 9 deletions trunk/fs/fat/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/time.h>
#include <linux/buffer_head.h>
#include <linux/compat.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <linux/kernel.h>
#include "fat.h"

Expand Down Expand Up @@ -123,7 +123,8 @@ static inline int fat_get_entry(struct inode *dir, loff_t *pos,
{
/* Fast stuff first */
if (*bh && *de &&
(*de - (struct msdos_dir_entry *)(*bh)->b_data) < MSDOS_SB(dir->i_sb)->dir_per_block - 1) {
(*de - (struct msdos_dir_entry *)(*bh)->b_data) <
MSDOS_SB(dir->i_sb)->dir_per_block - 1) {
*pos += sizeof(struct msdos_dir_entry);
(*de)++;
return 0;
Expand Down Expand Up @@ -155,7 +156,8 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii,

while (*ip && ((len - NLS_MAX_CHARSET_SIZE) > 0)) {
ec = *ip++;
if ((charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE)) > 0) {
charlen = nls->uni2char(ec, op, NLS_MAX_CHARSET_SIZE);
if (charlen > 0) {
op += charlen;
len -= charlen;
} else {
Expand All @@ -172,12 +174,12 @@ static int uni16_to_x8(struct super_block *sb, unsigned char *ascii,
}

if (unlikely(*ip)) {
fat_msg(sb, KERN_WARNING, "filename was truncated while "
"converting.");
fat_msg(sb, KERN_WARNING,
"filename was truncated while converting.");
}

*op = 0;
return (op - ascii);
return op - ascii;
}

static inline int fat_uni_to_x8(struct super_block *sb, const wchar_t *uni,
Expand Down Expand Up @@ -205,7 +207,8 @@ fat_short2uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni)
}

static inline int
fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *uni)
fat_short2lower_uni(struct nls_table *t, unsigned char *c,
int clen, wchar_t *uni)
{
int charlen;
wchar_t wc;
Expand All @@ -220,7 +223,8 @@ fat_short2lower_uni(struct nls_table *t, unsigned char *c, int clen, wchar_t *un
if (!nc)
nc = *c;

if ( (charlen = t->char2uni(&nc, 1, uni)) < 0) {
charlen = t->char2uni(&nc, 1, uni);
if (charlen < 0) {
*uni = 0x003f; /* a question mark */
charlen = 1;
}
Expand Down Expand Up @@ -573,7 +577,8 @@ static int __fat_readdir(struct inode *inode, struct file *filp, void *dirent,
/* Fake . and .. for the root directory. */
if (inode->i_ino == MSDOS_ROOT_INO) {
while (cpos < 2) {
if (filldir(dirent, "..", cpos+1, cpos, MSDOS_ROOT_INO, DT_DIR) < 0)
if (filldir(dirent, "..", cpos+1, cpos,
MSDOS_ROOT_INO, DT_DIR) < 0)
goto out;
cpos++;
filp->f_pos++;
Expand Down

0 comments on commit 9d8f12c

Please sign in to comment.