diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-04 11:15:33 -0500 |
commit | 0f2cc4ecd81dc1917a041dc93db0ada28f8356fa (patch) | |
tree | f128b50f48f50f0cda6d2b20b53e9ad6e2dfded3 /fs/hpfs/name.c | |
parent | 1fae4cfb97302289bb5df6a8195eb28385d0b002 (diff) | |
parent | 9643f5d94aadd47a5fa9754fb60f2c957de05903 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (52 commits)
init: Open /dev/console from rootfs
mqueue: fix typo "failues" -> "failures"
mqueue: only set error codes if they are really necessary
mqueue: simplify do_open() error handling
mqueue: apply mathematics distributivity on mq_bytes calculation
mqueue: remove unneeded info->messages initialization
mqueue: fix mq_open() file descriptor leak on user-space processes
fix race in d_splice_alias()
set S_DEAD on unlink() and non-directory rename() victims
vfs: add NOFOLLOW flag to umount(2)
get rid of ->mnt_parent in tomoyo/realpath
hppfs can use existing proc_mnt, no need for do_kern_mount() in there
Mirror MS_KERNMOUNT in ->mnt_flags
get rid of useless vfsmount_lock use in put_mnt_ns()
Take vfsmount_lock to fs/internal.h
get rid of insanity with namespace roots in tomoyo
take check for new events in namespace (guts of mounts_poll()) to namespace.c
Don't mess with generic_permission() under ->d_lock in hpfs
sanitize const/signedness for udf
nilfs: sanitize const/signedness in dealing with ->d_name.name
...
Fix up fairly trivial (famous last words...) conflicts in
drivers/infiniband/core/uverbs_main.c and security/tomoyo/realpath.c
Diffstat (limited to 'fs/hpfs/name.c')
-rw-r--r-- | fs/hpfs/name.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/hpfs/name.c b/fs/hpfs/name.c index 1f4a964384eb..f24736d7a439 100644 --- a/fs/hpfs/name.c +++ b/fs/hpfs/name.c | |||
@@ -8,16 +8,16 @@ | |||
8 | 8 | ||
9 | #include "hpfs_fn.h" | 9 | #include "hpfs_fn.h" |
10 | 10 | ||
11 | static char *text_postfix[]={ | 11 | static const char *text_postfix[]={ |
12 | ".ASM", ".BAS", ".BAT", ".C", ".CC", ".CFG", ".CMD", ".CON", ".CPP", ".DEF", | 12 | ".ASM", ".BAS", ".BAT", ".C", ".CC", ".CFG", ".CMD", ".CON", ".CPP", ".DEF", |
13 | ".DOC", ".DPR", ".ERX", ".H", ".HPP", ".HTM", ".HTML", ".JAVA", ".LOG", ".PAS", | 13 | ".DOC", ".DPR", ".ERX", ".H", ".HPP", ".HTM", ".HTML", ".JAVA", ".LOG", ".PAS", |
14 | ".RC", ".TEX", ".TXT", ".Y", ""}; | 14 | ".RC", ".TEX", ".TXT", ".Y", ""}; |
15 | 15 | ||
16 | static char *text_prefix[]={ | 16 | static const char *text_prefix[]={ |
17 | "AUTOEXEC.", "CHANGES", "COPYING", "CONFIG.", "CREDITS", "FAQ", "FILE_ID.DIZ", | 17 | "AUTOEXEC.", "CHANGES", "COPYING", "CONFIG.", "CREDITS", "FAQ", "FILE_ID.DIZ", |
18 | "MAKEFILE", "READ.ME", "README", "TERMCAP", ""}; | 18 | "MAKEFILE", "READ.ME", "README", "TERMCAP", ""}; |
19 | 19 | ||
20 | void hpfs_decide_conv(struct inode *inode, unsigned char *name, unsigned len) | 20 | void hpfs_decide_conv(struct inode *inode, const unsigned char *name, unsigned len) |
21 | { | 21 | { |
22 | struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); | 22 | struct hpfs_inode_info *hpfs_inode = hpfs_i(inode); |
23 | int i; | 23 | int i; |
@@ -71,7 +71,7 @@ static inline unsigned char locase(unsigned char *dir, unsigned char a) | |||
71 | return dir[a]; | 71 | return dir[a]; |
72 | } | 72 | } |
73 | 73 | ||
74 | int hpfs_chk_name(unsigned char *name, unsigned *len) | 74 | int hpfs_chk_name(const unsigned char *name, unsigned *len) |
75 | { | 75 | { |
76 | int i; | 76 | int i; |
77 | if (*len > 254) return -ENAMETOOLONG; | 77 | if (*len > 254) return -ENAMETOOLONG; |
@@ -83,10 +83,10 @@ int hpfs_chk_name(unsigned char *name, unsigned *len) | |||
83 | return 0; | 83 | return 0; |
84 | } | 84 | } |
85 | 85 | ||
86 | char *hpfs_translate_name(struct super_block *s, unsigned char *from, | 86 | unsigned char *hpfs_translate_name(struct super_block *s, unsigned char *from, |
87 | unsigned len, int lc, int lng) | 87 | unsigned len, int lc, int lng) |
88 | { | 88 | { |
89 | char *to; | 89 | unsigned char *to; |
90 | int i; | 90 | int i; |
91 | if (hpfs_sb(s)->sb_chk >= 2) if (hpfs_is_name_long(from, len) != lng) { | 91 | if (hpfs_sb(s)->sb_chk >= 2) if (hpfs_is_name_long(from, len) != lng) { |
92 | printk("HPFS: Long name flag mismatch - name "); | 92 | printk("HPFS: Long name flag mismatch - name "); |
@@ -103,8 +103,9 @@ char *hpfs_translate_name(struct super_block *s, unsigned char *from, | |||
103 | return to; | 103 | return to; |
104 | } | 104 | } |
105 | 105 | ||
106 | int hpfs_compare_names(struct super_block *s, unsigned char *n1, unsigned l1, | 106 | int hpfs_compare_names(struct super_block *s, |
107 | unsigned char *n2, unsigned l2, int last) | 107 | const unsigned char *n1, unsigned l1, |
108 | const unsigned char *n2, unsigned l2, int last) | ||
108 | { | 109 | { |
109 | unsigned l = l1 < l2 ? l1 : l2; | 110 | unsigned l = l1 < l2 ? l1 : l2; |
110 | unsigned i; | 111 | unsigned i; |
@@ -120,7 +121,7 @@ int hpfs_compare_names(struct super_block *s, unsigned char *n1, unsigned l1, | |||
120 | return 0; | 121 | return 0; |
121 | } | 122 | } |
122 | 123 | ||
123 | int hpfs_is_name_long(unsigned char *name, unsigned len) | 124 | int hpfs_is_name_long(const unsigned char *name, unsigned len) |
124 | { | 125 | { |
125 | int i,j; | 126 | int i,j; |
126 | for (i = 0; i < len && name[i] != '.'; i++) | 127 | for (i = 0; i < len && name[i] != '.'; i++) |
@@ -134,7 +135,7 @@ int hpfs_is_name_long(unsigned char *name, unsigned len) | |||
134 | 135 | ||
135 | /* OS/2 clears dots and spaces at the end of file name, so we have to */ | 136 | /* OS/2 clears dots and spaces at the end of file name, so we have to */ |
136 | 137 | ||
137 | void hpfs_adjust_length(unsigned char *name, unsigned *len) | 138 | void hpfs_adjust_length(const unsigned char *name, unsigned *len) |
138 | { | 139 | { |
139 | if (!*len) return; | 140 | if (!*len) return; |
140 | if (*len == 1 && name[0] == '.') return; | 141 | if (*len == 1 && name[0] == '.') return; |