diff options
Diffstat (limited to 'fs/ncpfs/dir.c')
-rw-r--r-- | fs/ncpfs/dir.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 28f136d4aaec..f6946bb5cb55 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -21,9 +21,7 @@ | |||
21 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
22 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
23 | 23 | ||
24 | #include <linux/ncp_fs.h> | 24 | #include "ncp_fs.h" |
25 | |||
26 | #include "ncplib_kernel.h" | ||
27 | 25 | ||
28 | static void ncp_read_volume_list(struct file *, void *, filldir_t, | 26 | static void ncp_read_volume_list(struct file *, void *, filldir_t, |
29 | struct ncp_cache_control *); | 27 | struct ncp_cache_control *); |
@@ -82,7 +80,7 @@ static int ncp_compare_dentry(const struct dentry *, const struct inode *, | |||
82 | unsigned int, const char *, const struct qstr *); | 80 | unsigned int, const char *, const struct qstr *); |
83 | static int ncp_delete_dentry(const struct dentry *); | 81 | static int ncp_delete_dentry(const struct dentry *); |
84 | 82 | ||
85 | static const struct dentry_operations ncp_dentry_operations = | 83 | const struct dentry_operations ncp_dentry_operations = |
86 | { | 84 | { |
87 | .d_revalidate = ncp_lookup_validate, | 85 | .d_revalidate = ncp_lookup_validate, |
88 | .d_hash = ncp_hash_dentry, | 86 | .d_hash = ncp_hash_dentry, |
@@ -90,14 +88,6 @@ static const struct dentry_operations ncp_dentry_operations = | |||
90 | .d_delete = ncp_delete_dentry, | 88 | .d_delete = ncp_delete_dentry, |
91 | }; | 89 | }; |
92 | 90 | ||
93 | const struct dentry_operations ncp_root_dentry_operations = | ||
94 | { | ||
95 | .d_hash = ncp_hash_dentry, | ||
96 | .d_compare = ncp_compare_dentry, | ||
97 | .d_delete = ncp_delete_dentry, | ||
98 | }; | ||
99 | |||
100 | |||
101 | #define ncp_namespace(i) (NCP_SERVER(i)->name_space[NCP_FINFO(i)->volNumber]) | 91 | #define ncp_namespace(i) (NCP_SERVER(i)->name_space[NCP_FINFO(i)->volNumber]) |
102 | 92 | ||
103 | static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator) | 93 | static inline int ncp_preserve_entry_case(struct inode *i, __u32 nscreator) |
@@ -309,6 +299,9 @@ ncp_lookup_validate(struct dentry *dentry, struct nameidata *nd) | |||
309 | int res, val = 0, len; | 299 | int res, val = 0, len; |
310 | __u8 __name[NCP_MAXPATHLEN + 1]; | 300 | __u8 __name[NCP_MAXPATHLEN + 1]; |
311 | 301 | ||
302 | if (dentry == dentry->d_sb->s_root) | ||
303 | return 1; | ||
304 | |||
312 | if (nd->flags & LOOKUP_RCU) | 305 | if (nd->flags & LOOKUP_RCU) |
313 | return -ECHILD; | 306 | return -ECHILD; |
314 | 307 | ||
@@ -637,7 +630,6 @@ ncp_fill_cache(struct file *filp, void *dirent, filldir_t filldir, | |||
637 | entry->ino = iunique(dir->i_sb, 2); | 630 | entry->ino = iunique(dir->i_sb, 2); |
638 | inode = ncp_iget(dir->i_sb, entry); | 631 | inode = ncp_iget(dir->i_sb, entry); |
639 | if (inode) { | 632 | if (inode) { |
640 | d_set_d_op(newdent, &ncp_dentry_operations); | ||
641 | d_instantiate(newdent, inode); | 633 | d_instantiate(newdent, inode); |
642 | if (!hashed) | 634 | if (!hashed) |
643 | d_rehash(newdent); | 635 | d_rehash(newdent); |
@@ -893,7 +885,6 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, struc | |||
893 | if (inode) { | 885 | if (inode) { |
894 | ncp_new_dentry(dentry); | 886 | ncp_new_dentry(dentry); |
895 | add_entry: | 887 | add_entry: |
896 | d_set_d_op(dentry, &ncp_dentry_operations); | ||
897 | d_add(dentry, inode); | 888 | d_add(dentry, inode); |
898 | error = 0; | 889 | error = 0; |
899 | } | 890 | } |