diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2013-04-19 12:27:21 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-04-22 19:56:21 -0400 |
commit | e66509f03e36ef4750bfab8f3a5cf632b313a39b (patch) | |
tree | 846716d7314bf03fe3657eaedd765e00983ceca2 | |
parent | 66348b723bcbf57c2d2630a0c83b77c136e61029 (diff) |
f2fs: make is_multimedia_file code align with its name
The code conditions put inside the function is_multimedia_file are
reverse to the name i.e, we need to negate the return to actually
check if the file is a multimedia file. So, change the code and usage
path to align both the name and comparision conditions.
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r-- | fs/f2fs/namei.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 841f6b486bd6..1dbf11d2bc87 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c | |||
@@ -83,7 +83,7 @@ static int is_multimedia_file(const unsigned char *s, const char *sub) | |||
83 | int ret; | 83 | int ret; |
84 | 84 | ||
85 | if (sublen > slen) | 85 | if (sublen > slen) |
86 | return 1; | 86 | return 0; |
87 | 87 | ||
88 | ret = memcmp(s + slen - sublen, sub, sublen); | 88 | ret = memcmp(s + slen - sublen, sub, sublen); |
89 | if (ret) { /* compare upper case */ | 89 | if (ret) { /* compare upper case */ |
@@ -91,10 +91,10 @@ static int is_multimedia_file(const unsigned char *s, const char *sub) | |||
91 | char upper_sub[8]; | 91 | char upper_sub[8]; |
92 | for (i = 0; i < sublen && i < sizeof(upper_sub); i++) | 92 | for (i = 0; i < sublen && i < sizeof(upper_sub); i++) |
93 | upper_sub[i] = toupper(sub[i]); | 93 | upper_sub[i] = toupper(sub[i]); |
94 | return memcmp(s + slen - sublen, upper_sub, sublen); | 94 | return !memcmp(s + slen - sublen, upper_sub, sublen); |
95 | } | 95 | } |
96 | 96 | ||
97 | return ret; | 97 | return !ret; |
98 | } | 98 | } |
99 | 99 | ||
100 | /* | 100 | /* |
@@ -108,7 +108,7 @@ static inline void set_cold_files(struct f2fs_sb_info *sbi, struct inode *inode, | |||
108 | 108 | ||
109 | int count = le32_to_cpu(sbi->raw_super->extension_count); | 109 | int count = le32_to_cpu(sbi->raw_super->extension_count); |
110 | for (i = 0; i < count; i++) { | 110 | for (i = 0; i < count; i++) { |
111 | if (!is_multimedia_file(name, extlist[i])) { | 111 | if (is_multimedia_file(name, extlist[i])) { |
112 | set_cold_file(inode); | 112 | set_cold_file(inode); |
113 | break; | 113 | break; |
114 | } | 114 | } |