diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2005-09-06 18:18:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:50 -0400 |
commit | 328b9227865026268261a24a97a578907b280415 (patch) | |
tree | 1e0cad4f422252a9c3add879cf847afbb9786cfe /fs/hfs/dir.c | |
parent | 717dd80e999cdc84fb611decec5c5054d37c40d2 (diff) |
[PATCH] hfs: NLS support
This adds NLS support to HFS. Using the kernel options iocharset and codepage
it's possible to map the disk encoding to a local mapping. If these options
are not used, it falls back to the old direct mapping.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hfs/dir.c')
-rw-r--r-- | fs/hfs/dir.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c index c55998262aed..e1f24befba58 100644 --- a/fs/hfs/dir.c +++ b/fs/hfs/dir.c | |||
@@ -28,7 +28,7 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, | |||
28 | dentry->d_op = &hfs_dentry_operations; | 28 | dentry->d_op = &hfs_dentry_operations; |
29 | 29 | ||
30 | hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); | 30 | hfs_find_init(HFS_SB(dir->i_sb)->cat_tree, &fd); |
31 | hfs_cat_build_key(fd.search_key, dir->i_ino, &dentry->d_name); | 31 | hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); |
32 | res = hfs_brec_read(&fd, &rec, sizeof(rec)); | 32 | res = hfs_brec_read(&fd, &rec, sizeof(rec)); |
33 | if (res) { | 33 | if (res) { |
34 | hfs_find_exit(&fd); | 34 | hfs_find_exit(&fd); |
@@ -56,7 +56,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
56 | struct inode *inode = filp->f_dentry->d_inode; | 56 | struct inode *inode = filp->f_dentry->d_inode; |
57 | struct super_block *sb = inode->i_sb; | 57 | struct super_block *sb = inode->i_sb; |
58 | int len, err; | 58 | int len, err; |
59 | char strbuf[HFS_NAMELEN + 1]; | 59 | char strbuf[HFS_MAX_NAMELEN]; |
60 | union hfs_cat_rec entry; | 60 | union hfs_cat_rec entry; |
61 | struct hfs_find_data fd; | 61 | struct hfs_find_data fd; |
62 | struct hfs_readdir_data *rd; | 62 | struct hfs_readdir_data *rd; |
@@ -66,7 +66,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
66 | return 0; | 66 | return 0; |
67 | 67 | ||
68 | hfs_find_init(HFS_SB(sb)->cat_tree, &fd); | 68 | hfs_find_init(HFS_SB(sb)->cat_tree, &fd); |
69 | hfs_cat_build_key(fd.search_key, inode->i_ino, NULL); | 69 | hfs_cat_build_key(sb, fd.search_key, inode->i_ino, NULL); |
70 | err = hfs_brec_find(&fd); | 70 | err = hfs_brec_find(&fd); |
71 | if (err) | 71 | if (err) |
72 | goto out; | 72 | goto out; |
@@ -111,7 +111,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
111 | } | 111 | } |
112 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); | 112 | hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); |
113 | type = entry.type; | 113 | type = entry.type; |
114 | len = hfs_mac2triv(strbuf, &fd.key->cat.CName); | 114 | len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName); |
115 | if (type == HFS_CDR_DIR) { | 115 | if (type == HFS_CDR_DIR) { |
116 | if (fd.entrylength < sizeof(struct hfs_cat_dir)) { | 116 | if (fd.entrylength < sizeof(struct hfs_cat_dir)) { |
117 | printk("HFS: small dir entry\n"); | 117 | printk("HFS: small dir entry\n"); |
@@ -307,7 +307,8 @@ static int hfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
307 | old_dir, &old_dentry->d_name, | 307 | old_dir, &old_dentry->d_name, |
308 | new_dir, &new_dentry->d_name); | 308 | new_dir, &new_dentry->d_name); |
309 | if (!res) | 309 | if (!res) |
310 | hfs_cat_build_key((btree_key *)&HFS_I(old_dentry->d_inode)->cat_key, | 310 | hfs_cat_build_key(old_dir->i_sb, |
311 | (btree_key *)&HFS_I(old_dentry->d_inode)->cat_key, | ||
311 | new_dir->i_ino, &new_dentry->d_name); | 312 | new_dir->i_ino, &new_dentry->d_name); |
312 | return res; | 313 | return res; |
313 | } | 314 | } |