fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / ncpfs / dir.c
index 2dc2d86..7374777 100644 (file)
@@ -10,7 +10,6 @@
  *
  */
 
-#include <linux/config.h>
 
 #include <linux/time.h>
 #include <linux/errno.h>
@@ -49,11 +48,14 @@ extern int ncp_symlink(struct inode *, struct dentry *, const char *);
 #define ncp_symlink NULL
 #endif
                      
-struct file_operations ncp_dir_operations =
+const struct file_operations ncp_dir_operations =
 {
        .read           = generic_read_dir,
        .readdir        = ncp_readdir,
        .ioctl          = ncp_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = ncp_compat_ioctl,
+#endif
 };
 
 struct inode_operations ncp_dir_inode_operations =
@@ -365,7 +367,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
        spin_lock(&dcache_lock);
        next = parent->d_subdirs.next;
        while (next != &parent->d_subdirs) {
-               dent = list_entry(next, struct dentry, d_child);
+               dent = list_entry(next, struct dentry, d_u.d_child);
                if ((unsigned long)dent->d_fsdata == fpos) {
                        if (dent->d_inode)
                                dget_locked(dent);
@@ -400,7 +402,7 @@ static time_t ncp_obtain_mtime(struct dentry *dentry)
 
 static int ncp_readdir(struct file *filp, void *dirent, filldir_t filldir)
 {
-       struct dentry *dentry = filp->f_dentry;
+       struct dentry *dentry = filp->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        struct page *page = NULL;
        struct ncp_server *server = NCP_SERVER(inode);
@@ -552,7 +554,7 @@ static int
 ncp_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
                struct ncp_cache_control *ctrl, struct ncp_entry_info *entry)
 {
-       struct dentry *newdent, *dentry = filp->f_dentry;
+       struct dentry *newdent, *dentry = filp->f_path.dentry;
        struct inode *newino, *inode = dentry->d_inode;
        struct ncp_cache_control ctl = *ctrl;
        struct qstr qname;
@@ -647,7 +649,7 @@ static void
 ncp_read_volume_list(struct file *filp, void *dirent, filldir_t filldir,
                        struct ncp_cache_control *ctl)
 {
-       struct dentry *dentry = filp->f_dentry;
+       struct dentry *dentry = filp->f_path.dentry;
        struct inode *inode = dentry->d_inode;
        struct ncp_server *server = NCP_SERVER(inode);
        struct ncp_volume_info info;
@@ -683,7 +685,7 @@ static void
 ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
                                                struct ncp_cache_control *ctl)
 {
-       struct dentry *dentry = filp->f_dentry;
+       struct dentry *dentry = filp->f_path.dentry;
        struct inode *dir = dentry->d_inode;
        struct ncp_server *server = NCP_SERVER(dir);
        struct nw_search_sequence seq;
@@ -705,18 +707,6 @@ ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
                DPRINTK("ncp_do_readdir: init failed, err=%d\n", err);
                return;
        }
-#ifdef USE_OLD_SLOW_DIRECTORY_LISTING
-       for (;;) {
-               err = ncp_search_for_file_or_subdir(server, &seq, &entry.i);
-               if (err) {
-                       DPRINTK("ncp_do_readdir: search failed, err=%d\n", err);
-                       break;
-               }
-               entry.volume = entry.i.volNumber;
-               if (!ncp_fill_cache(filp, dirent, filldir, ctl, &entry))
-                       break;
-       }
-#else
        /* We MUST NOT use server->buffer_size handshaked with server if we are
           using UDP, as for UDP server uses max. buffer size determined by
           MTU, and for TCP server uses hardwired value 65KB (== 66560 bytes). 
@@ -754,7 +744,6 @@ ncp_do_readdir(struct file *filp, void *dirent, filldir_t filldir,
                }
        } while (more);
        vfree(buf);
-#endif
        return;
 }