libfuse: remove deprecated fuse_operations.getdir()
authorMiklos Szeredi <mszeredi@suse.cz>
Fri, 8 Feb 2013 07:03:02 +0000 (08:03 +0100)
committerMiklos Szeredi <mszeredi@suse.cz>
Fri, 8 Feb 2013 07:03:02 +0000 (08:03 +0100)
ChangeLog
include/fuse.h
lib/fuse.c

index a2ddbb08da39f2d35224473cf48121b5811135ac..b102d7e9e67a3b0bb895738000d7b8ddc6e4c5d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
        - fuse_teardown()
        - fuse_exited()
        - fuse_lowlevel_is_lib_option()
+       - fuse_operations.getdir()
 
 2013-02-06  Miklos Szeredi <miklos@szeredi.hu>
 
index fe8a3319f84886fa54f7f737ca60d6a9d4404405..dfad3713184f80851b0a90816ca6598ec5aa869e 100644 (file)
@@ -51,11 +51,6 @@ struct fuse_cmd;
 typedef int (*fuse_fill_dir_t) (void *buf, const char *name,
                                const struct stat *stbuf, off_t off);
 
-/* Used by deprecated getdir() method */
-typedef struct fuse_dirhandle *fuse_dirh_t;
-typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type,
-                             ino_t ino);
-
 /**
  * The file system operations:
  *
@@ -121,9 +116,6 @@ struct fuse_operations {
         */
        int (*readlink) (const char *, char *, size_t);
 
-       /* Deprecated, use readdir() instead */
-       int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t);
-
        /** Create a file node
         *
         * This is called for creation of all non-directory, non-symlink
@@ -298,17 +290,13 @@ struct fuse_operations {
        int (*opendir) (const char *, struct fuse_file_info *);
 
        /** Read directory
-        *
-        * This supersedes the old getdir() interface.  New applications
-        * should use this.
         *
         * The filesystem may choose between two modes of operation:
         *
         * 1) The readdir implementation ignores the offset parameter, and
         * passes zero to the filler function's offset.  The filler
         * function will not return '1' (unless an error happens), so the
-        * whole directory is read in a single readdir operation.  This
-        * works just like the old getdir() method.
+        * whole directory is read in a single readdir operation.
         *
         * 2) The readdir implementation keeps track of the offsets of the
         * directory entries.  It uses the offset parameter and always
index 76e98b19d885da850cc7642d2456b12f853de3bc..6360cb9c8b410459fc5fddb66469c63951f5062d 100644 (file)
@@ -203,12 +203,6 @@ struct fuse_dh {
        fuse_ino_t nodeid;
 };
 
-/* old dir handle */
-struct fuse_dirhandle {
-       fuse_fill_dir_t filler;
-       void *buf;
-};
-
 struct fuse_context_i {
        struct fuse_context ctx;
        fuse_req_t req;
@@ -1853,20 +1847,6 @@ int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
        }
 }
 
-static int fill_dir_old(struct fuse_dirhandle *dh, const char *name, int type,
-                       ino_t ino)
-{
-       int res;
-       struct stat stbuf;
-
-       memset(&stbuf, 0, sizeof(stbuf));
-       stbuf.st_mode = type << 12;
-       stbuf.st_ino = ino;
-
-       res = dh->filler(dh->buf, name, &stbuf, 0);
-       return res ? -ENOMEM : 0;
-}
-
 int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
                    fuse_fill_dir_t filler, off_t off,
                    struct fuse_file_info *fi)
@@ -1879,16 +1859,6 @@ int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
                                (unsigned long long) off);
 
                return fs->op.readdir(path, buf, filler, off, fi);
-       } else if (fs->op.getdir) {
-               struct fuse_dirhandle dh;
-
-               if (fs->debug)
-                       fprintf(stderr, "getdir[%llu]\n",
-                               (unsigned long long) fi->fh);
-
-               dh.filler = filler;
-               dh.buf = buf;
-               return fs->op.getdir(path, &dh, fill_dir_old);
        } else {
                return -ENOSYS;
        }