[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/fuse_kio
From:       Vlad Codrea <vladc6 () yahoo ! com>
Date:       2007-01-14 17:03:15
Message-ID: 1168794195.435173.23048.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 623375 by codrea:

Fix KIO-FUSE to compile with FUSE 2.6.1 and later.



 M  +1 -1      configure.in.in  
 M  +22 -6     fuse_kio/fuse_kio.cpp  
 M  +8 -6      fuse_kio/fuse_kio_ops.cpp  
 M  +6 -4      fuse_kio/fuse_kio_ops.h  


--- trunk/kdenonbeta/fuse_kio/configure.in.in #623374:623375
@@ -2,4 +2,4 @@
 
 AC_CHECK_HEADER([fuse.h],, [DO_NOT_COMPILE="$DO_NOT_COMPILE fuse_kio"])
 
-CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=11 -D_FILE_OFFSET_BITS=64"
+CPPFLAGS="$CPPFLAGS -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64"
--- trunk/kdenonbeta/fuse_kio/fuse_kio/fuse_kio.cpp #623374:623375
@@ -90,6 +90,8 @@
 int main(int argc, char *argv[])
 {
    struct fuse_operations ops;
+   struct fuse_args f_args = FUSE_ARGS_INIT(0, NULL);
+   struct fuse_chan *f_chan;
    memset(&ops, 0, sizeof(ops));
    ops.getattr=fuse_kio_getattr;
    ops.readlink=fuse_kio_readlink;
@@ -160,18 +162,33 @@
       if (!gateway)
          fusermountArgs[1]=base_url.prettyURL().latin1();
 
-      int fuse_fd = fuse_mount(mount_point.path().latin1(), (niceMTab?fusermountArgs:0));
+//      f_args = FUSE_ARGS_INIT(argc, argv);
+//      if (args->isSet("nice-mtab"))
+//      if (niceMTab)
+//         f_args = FUSE_ARGS_INIT(3, fusermountArgs);
+//      else
+//         f_args = FUSE_ARGS_INIT(0, NULL);
+
+//      if (fuse_parse_cmdline(&f_args, &mount_point.path().latin1(), NULL, NULL) == -1)
+//      {
+//         cout<<"fuse_parse_cmdline() failed"<<endl;
+//         exit(-1);
+//      }
+
+      f_chan = fuse_mount(mount_point.path().latin1(), &f_args);
+
+//      int fuse_fd = fuse_mount(mount_point.path().latin1(), (niceMTab?fusermountArgs:0));
 //      int fuse_fd = fuse_mount(mount_point.path().latin1(), fusermountArgs);
-      kdDebug()<<"fuse_mount(): "<<fuse_fd<<endl;
+//      kdDebug()<<"fuse_mount(): "<<fuse_fd<<endl;
 
-      if (fuse_fd<0)
+      if (f_chan == NULL)
       {
          cout<<"fuse_mount() failed"<<endl;
          exit(-1);
       }
 
       //fuse_handle = fuse_new(fuse_fd, FUSE_DEBUG, &ops);
-      fuse_handle = fuse_new(fuse_fd, 0, &ops);
+      fuse_handle = fuse_new(f_chan, &f_args, &ops, sizeof(ops), NULL);
       if (fuse_handle==0)
       {
          cout<<"fuse_new() failed"<<endl;
@@ -188,9 +205,8 @@
 
       //fuse_loop_mt(fuse_handle);
       fuse_loop(fuse_handle);
-      close(fuse_fd);
 
-      fuse_unmount(mount_point.path().latin1());
+      fuse_unmount(mount_point.path().latin1(), f_chan);
 
       delete fuseApp;
       fuseApp = 0;
--- trunk/kdenonbeta/fuse_kio/fuse_kio/fuse_kio_ops.cpp #623374:623375
@@ -126,7 +126,7 @@
       QRegExp regex("(^[^/]+)(://)(.*)");
       if (regex.search(dir)!=-1)
          dir=(regex.cap(1)+":__"+regex.cap(3));
-      filler(h, dir.latin1(), DT_DIR);
+      filler(h, dir.latin1(), DT_DIR, 0);
    }
 
    return 0;
@@ -304,7 +304,7 @@
          {
             type = DT_DIR;
          }
-         filler(h, item->name().latin1(), type);
+         filler(h, item->name().latin1(), type, 0);
       }
    }
 
@@ -313,7 +313,7 @@
 }
 
 
-int fuse_kio_open(const char *path, int flags)
+int fuse_kio_open(const char *path, struct fuse_file_info *fi)
 {
    kdDebug()<<"kio_open "<<path<<endl;
 
@@ -338,7 +338,7 @@
 }
 
 
-int fuse_kio_release(const char* path, int whatever)
+int fuse_kio_release(const char* path, struct fuse_file_info *fi)
 {
    kdDebug()<<"kio_release() "<<path<<endl;
 
@@ -356,7 +356,8 @@
 }
 
 
-int fuse_kio_read(const char *path, char *buf, size_t size, off_t offs)
+int fuse_kio_read(const char *path, char *buf, size_t size, off_t offs,
+                  struct fuse_file_info *fi)
 {
 //if we get here, the file *must* already have been opened
 
@@ -393,7 +394,8 @@
 }
 
 
-int fuse_kio_write(const char* path, const char* buf, size_t size, off_t offs)
+int fuse_kio_write(const char* path, const char* buf, size_t size, off_t offs,
+                   struct fuse_file_info *fi)
 {
    FileProxy *fp = fuseApp->fileProxy(path);
 
--- trunk/kdenonbeta/fuse_kio/fuse_kio/fuse_kio_ops.h #623374:623375
@@ -25,10 +25,12 @@
 int fuse_kio_getattr(const char *path, struct stat *stbuf);
 int fuse_kio_readlink(const char *path, char *buf, size_t size);
 int fuse_kio_getdir(const char *path, fuse_dirh_t h, fuse_dirfil_t filler);
-int fuse_kio_open(const char *path, int flags);
-int fuse_kio_release(const char* path, int whatever);
-int fuse_kio_read(const char *path, char *buf, size_t size, off_t offs);
-int fuse_kio_write(const char *path, const char *buf, size_t size, off_t offs);
+int fuse_kio_open(const char *path, struct fuse_file_info *fi);
+int fuse_kio_release(const char* path, struct fuse_file_info *fi);
+int fuse_kio_read(const char *path, char *buf, size_t size, off_t offs,
+                  struct fuse_file_info *fi);
+int fuse_kio_write(const char *path, const char *buf, size_t size, off_t offs,
+                   struct fuse_file_info *fi);
 int fuse_kio_truncate(const char *path, off_t size);
 int fuse_kio_mknod(const char *path, mode_t mode, dev_t rdev);
 int fuse_kio_unlink(const char *path);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic