Commit 08049707 authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

ufs: pass qstr instead of dentry where necessary for NFS

Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Cc: Evgeniy Dushistov <dushistov@mail.ru>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 48bde86d
...@@ -70,13 +70,13 @@ static inline unsigned long ufs_dir_pages(struct inode *inode) ...@@ -70,13 +70,13 @@ static inline unsigned long ufs_dir_pages(struct inode *inode)
return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT; return (inode->i_size+PAGE_CACHE_SIZE-1)>>PAGE_CACHE_SHIFT;
} }
ino_t ufs_inode_by_name(struct inode *dir, struct dentry *dentry) ino_t ufs_inode_by_name(struct inode *dir, struct qstr *qstr)
{ {
ino_t res = 0; ino_t res = 0;
struct ufs_dir_entry *de; struct ufs_dir_entry *de;
struct page *page; struct page *page;
de = ufs_find_entry(dir, dentry, &page); de = ufs_find_entry(dir, qstr, &page);
if (de) { if (de) {
res = fs32_to_cpu(dir->i_sb, de->d_ino); res = fs32_to_cpu(dir->i_sb, de->d_ino);
ufs_put_page(page); ufs_put_page(page);
...@@ -249,12 +249,12 @@ struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p) ...@@ -249,12 +249,12 @@ struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p)
* (as a parameter - res_dir). Page is returned mapped and unlocked. * (as a parameter - res_dir). Page is returned mapped and unlocked.
* Entry is guaranteed to be valid. * Entry is guaranteed to be valid.
*/ */
struct ufs_dir_entry *ufs_find_entry(struct inode *dir, struct dentry *dentry, struct ufs_dir_entry *ufs_find_entry(struct inode *dir, struct qstr *qstr,
struct page **res_page) struct page **res_page)
{ {
struct super_block *sb = dir->i_sb; struct super_block *sb = dir->i_sb;
const char *name = dentry->d_name.name; const char *name = qstr->name;
int namelen = dentry->d_name.len; int namelen = qstr->len;
unsigned reclen = UFS_DIR_REC_LEN(namelen); unsigned reclen = UFS_DIR_REC_LEN(namelen);
unsigned long start, n; unsigned long start, n;
unsigned long npages = ufs_dir_pages(dir); unsigned long npages = ufs_dir_pages(dir);
......
...@@ -56,7 +56,7 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, stru ...@@ -56,7 +56,7 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, stru
return ERR_PTR(-ENAMETOOLONG); return ERR_PTR(-ENAMETOOLONG);
lock_kernel(); lock_kernel();
ino = ufs_inode_by_name(dir, dentry); ino = ufs_inode_by_name(dir, &dentry->d_name);
if (ino) { if (ino) {
inode = ufs_iget(dir->i_sb, ino); inode = ufs_iget(dir->i_sb, ino);
if (IS_ERR(inode)) { if (IS_ERR(inode)) {
...@@ -237,7 +237,7 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry) ...@@ -237,7 +237,7 @@ static int ufs_unlink(struct inode *dir, struct dentry *dentry)
struct page *page; struct page *page;
int err = -ENOENT; int err = -ENOENT;
de = ufs_find_entry(dir, dentry, &page); de = ufs_find_entry(dir, &dentry->d_name, &page);
if (!de) if (!de)
goto out; goto out;
...@@ -281,7 +281,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -281,7 +281,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct ufs_dir_entry *old_de; struct ufs_dir_entry *old_de;
int err = -ENOENT; int err = -ENOENT;
old_de = ufs_find_entry(old_dir, old_dentry, &old_page); old_de = ufs_find_entry(old_dir, &old_dentry->d_name, &old_page);
if (!old_de) if (!old_de)
goto out; goto out;
...@@ -301,7 +301,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -301,7 +301,7 @@ static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry,
goto out_dir; goto out_dir;
err = -ENOENT; err = -ENOENT;
new_de = ufs_find_entry(new_dir, new_dentry, &new_page); new_de = ufs_find_entry(new_dir, &new_dentry->d_name, &new_page);
if (!new_de) if (!new_de)
goto out_dir; goto out_dir;
inode_inc_link_count(old_inode); inode_inc_link_count(old_inode);
......
...@@ -86,9 +86,9 @@ extern void ufs_put_cylinder (struct super_block *, unsigned); ...@@ -86,9 +86,9 @@ extern void ufs_put_cylinder (struct super_block *, unsigned);
/* dir.c */ /* dir.c */
extern const struct inode_operations ufs_dir_inode_operations; extern const struct inode_operations ufs_dir_inode_operations;
extern int ufs_add_link (struct dentry *, struct inode *); extern int ufs_add_link (struct dentry *, struct inode *);
extern ino_t ufs_inode_by_name(struct inode *, struct dentry *); extern ino_t ufs_inode_by_name(struct inode *, struct qstr *);
extern int ufs_make_empty(struct inode *, struct inode *); extern int ufs_make_empty(struct inode *, struct inode *);
extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct dentry *, struct page **); extern struct ufs_dir_entry *ufs_find_entry(struct inode *, struct qstr *, struct page **);
extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *); extern int ufs_delete_entry(struct inode *, struct ufs_dir_entry *, struct page *);
extern int ufs_empty_dir (struct inode *); extern int ufs_empty_dir (struct inode *);
extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **); extern struct ufs_dir_entry *ufs_dotdot(struct inode *, struct page **);
......
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