Commit 04a9f0d7 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: get_UCSname does not need nls_tab argument

This is a minor code cleanup.  get_UCSname can get nls_tab by
following the dentry to the superblock.  This makes the calling code
simpler and prettier.
parent 469c5855
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "jfs_types.h" #include "jfs_incore.h"
#include "jfs_filsys.h" #include "jfs_filsys.h"
#include "jfs_unicode.h" #include "jfs_unicode.h"
#include "jfs_debug.h" #include "jfs_debug.h"
...@@ -82,9 +82,9 @@ int jfs_strtoUCS(wchar_t * to, ...@@ -82,9 +82,9 @@ int jfs_strtoUCS(wchar_t * to,
* FUNCTION: Allocate and translate to unicode string * FUNCTION: Allocate and translate to unicode string
* *
*/ */
int get_UCSname(struct component_name * uniName, struct dentry *dentry, int get_UCSname(struct component_name * uniName, struct dentry *dentry)
struct nls_table *nls_tab)
{ {
struct nls_table *nls_tab = JFS_SBI(dentry->d_sb)->nls_tab;
int length = dentry->d_name.len; int length = dentry->d_name.len;
if (length > JFS_NAME_MAX) if (length > JFS_NAME_MAX)
......
...@@ -30,8 +30,7 @@ typedef struct { ...@@ -30,8 +30,7 @@ typedef struct {
extern signed char UniUpperTable[512]; extern signed char UniUpperTable[512];
extern UNICASERANGE UniUpperRange[]; extern UNICASERANGE UniUpperRange[];
extern int get_UCSname(struct component_name *, struct dentry *, extern int get_UCSname(struct component_name *, struct dentry *);
struct nls_table *);
extern int jfs_strfromUCS_le(char *, const wchar_t *, int, struct nls_table *); extern int jfs_strfromUCS_le(char *, const wchar_t *, int, struct nls_table *);
#define free_UCSname(COMP) kfree((COMP)->name) #define free_UCSname(COMP) kfree((COMP)->name)
......
...@@ -78,7 +78,7 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode, ...@@ -78,7 +78,7 @@ int jfs_create(struct inode *dip, struct dentry *dentry, int mode,
* search parent directory for entry/freespace * search parent directory for entry/freespace
* (dtSearch() returns parent directory page pinned) * (dtSearch() returns parent directory page pinned)
*/ */
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out1; goto out1;
/* /*
...@@ -204,7 +204,7 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode) ...@@ -204,7 +204,7 @@ int jfs_mkdir(struct inode *dip, struct dentry *dentry, int mode)
* search parent directory for entry/freespace * search parent directory for entry/freespace
* (dtSearch() returns parent directory page pinned) * (dtSearch() returns parent directory page pinned)
*/ */
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out1; goto out1;
/* /*
...@@ -332,7 +332,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry) ...@@ -332,7 +332,7 @@ int jfs_rmdir(struct inode *dip, struct dentry *dentry)
goto out; goto out;
} }
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) { if ((rc = get_UCSname(&dname, dentry))) {
goto out; goto out;
} }
...@@ -451,7 +451,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry) ...@@ -451,7 +451,7 @@ int jfs_unlink(struct inode *dip, struct dentry *dentry)
jfs_info("jfs_unlink: dip:0x%p name:%s", dip, dentry->d_name.name); jfs_info("jfs_unlink: dip:0x%p name:%s", dip, dentry->d_name.name);
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out; goto out;
IWRITE_LOCK(ip); IWRITE_LOCK(ip);
...@@ -786,7 +786,7 @@ int jfs_link(struct dentry *old_dentry, ...@@ -786,7 +786,7 @@ int jfs_link(struct dentry *old_dentry,
/* /*
* scan parent directory for entry/freespace * scan parent directory for entry/freespace
*/ */
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(ip->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out; goto out;
if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE))) if ((rc = dtSearch(dir, &dname, &ino, &btstack, JFS_CREATE)))
...@@ -866,7 +866,7 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name) ...@@ -866,7 +866,7 @@ int jfs_symlink(struct inode *dip, struct dentry *dentry, const char *name)
* (dtSearch() returns parent directory page pinned) * (dtSearch() returns parent directory page pinned)
*/ */
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dip->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out1; goto out1;
/* /*
...@@ -1069,12 +1069,10 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1069,12 +1069,10 @@ int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
old_ip = old_dentry->d_inode; old_ip = old_dentry->d_inode;
new_ip = new_dentry->d_inode; new_ip = new_dentry->d_inode;
if ((rc = get_UCSname(&old_dname, old_dentry, if ((rc = get_UCSname(&old_dname, old_dentry)))
JFS_SBI(old_dir->i_sb)->nls_tab)))
goto out1; goto out1;
if ((rc = get_UCSname(&new_dname, new_dentry, if ((rc = get_UCSname(&new_dname, new_dentry)))
JFS_SBI(old_dir->i_sb)->nls_tab)))
goto out2; goto out2;
/* /*
...@@ -1329,7 +1327,7 @@ int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) ...@@ -1329,7 +1327,7 @@ int jfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
jfs_info("jfs_mknod: %s", dentry->d_name.name); jfs_info("jfs_mknod: %s", dentry->d_name.name);
if ((rc = get_UCSname(&dname, dentry, JFS_SBI(dir->i_sb)->nls_tab))) if ((rc = get_UCSname(&dname, dentry)))
goto out; goto out;
ip = ialloc(dir, mode); ip = ialloc(dir, mode);
...@@ -1411,8 +1409,7 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc ...@@ -1411,8 +1409,7 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
else if (strcmp(name, "..") == 0) else if (strcmp(name, "..") == 0)
inum = PARENT(dip); inum = PARENT(dip);
else { else {
if ((rc = if ((rc = get_UCSname(&key, dentry)))
get_UCSname(&key, dentry, JFS_SBI(dip->i_sb)->nls_tab)))
return ERR_PTR(rc); return ERR_PTR(rc);
rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP); rc = dtSearch(dip, &key, &inum, &btstack, JFS_LOOKUP);
free_UCSname(&key); free_UCSname(&key);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment