aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hpfs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hpfs/dir.c')
-rw-r--r--fs/hpfs/dir.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 8865c94f55f6..2338130cceba 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/smp_lock.h> 9#include <linux/smp_lock.h>
10#include <linux/slab.h>
10#include "hpfs_fn.h" 11#include "hpfs_fn.h"
11 12
12static int hpfs_dir_release(struct inode *inode, struct file *filp) 13static int hpfs_dir_release(struct inode *inode, struct file *filp)
@@ -59,7 +60,7 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
59 struct hpfs_dirent *de; 60 struct hpfs_dirent *de;
60 int lc; 61 int lc;
61 long old_pos; 62 long old_pos;
62 char *tempname; 63 unsigned char *tempname;
63 int c1, c2 = 0; 64 int c1, c2 = 0;
64 int ret = 0; 65 int ret = 0;
65 66
@@ -158,11 +159,11 @@ static int hpfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
158 tempname = hpfs_translate_name(inode->i_sb, de->name, de->namelen, lc, de->not_8x3); 159 tempname = hpfs_translate_name(inode->i_sb, de->name, de->namelen, lc, de->not_8x3);
159 if (filldir(dirent, tempname, de->namelen, old_pos, de->fnode, DT_UNKNOWN) < 0) { 160 if (filldir(dirent, tempname, de->namelen, old_pos, de->fnode, DT_UNKNOWN) < 0) {
160 filp->f_pos = old_pos; 161 filp->f_pos = old_pos;
161 if (tempname != (char *)de->name) kfree(tempname); 162 if (tempname != de->name) kfree(tempname);
162 hpfs_brelse4(&qbh); 163 hpfs_brelse4(&qbh);
163 goto out; 164 goto out;
164 } 165 }
165 if (tempname != (char *)de->name) kfree(tempname); 166 if (tempname != de->name) kfree(tempname);
166 hpfs_brelse4(&qbh); 167 hpfs_brelse4(&qbh);
167 } 168 }
168out: 169out:
@@ -187,7 +188,7 @@ out:
187 188
188struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) 189struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
189{ 190{
190 const char *name = dentry->d_name.name; 191 const unsigned char *name = dentry->d_name.name;
191 unsigned len = dentry->d_name.len; 192 unsigned len = dentry->d_name.len;
192 struct quad_buffer_head qbh; 193 struct quad_buffer_head qbh;
193 struct hpfs_dirent *de; 194 struct hpfs_dirent *de;
@@ -197,7 +198,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name
197 struct hpfs_inode_info *hpfs_result; 198 struct hpfs_inode_info *hpfs_result;
198 199
199 lock_kernel(); 200 lock_kernel();
200 if ((err = hpfs_chk_name((char *)name, &len))) { 201 if ((err = hpfs_chk_name(name, &len))) {
201 if (err == -ENAMETOOLONG) { 202 if (err == -ENAMETOOLONG) {
202 unlock_kernel(); 203 unlock_kernel();
203 return ERR_PTR(-ENAMETOOLONG); 204 return ERR_PTR(-ENAMETOOLONG);
@@ -209,7 +210,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name
209 * '.' and '..' will never be passed here. 210 * '.' and '..' will never be passed here.
210 */ 211 */
211 212
212 de = map_dirent(dir, hpfs_i(dir)->i_dno, (char *) name, len, NULL, &qbh); 213 de = map_dirent(dir, hpfs_i(dir)->i_dno, name, len, NULL, &qbh);
213 214
214 /* 215 /*
215 * This is not really a bailout, just means file not found. 216 * This is not really a bailout, just means file not found.
@@ -250,7 +251,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, struct name
250 hpfs_result = hpfs_i(result); 251 hpfs_result = hpfs_i(result);
251 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino; 252 if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino;
252 253
253 hpfs_decide_conv(result, (char *)name, len); 254 hpfs_decide_conv(result, name, len);
254 255
255 if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) { 256 if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) {
256 hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures"); 257 hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures");