]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cfuse: remove high level fuse interface
authorSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 15:43:00 +0000 (07:43 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 8 Feb 2011 15:43:00 +0000 (07:43 -0800)
Untested, unused, and inferior to the lowlevel implementation.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
debian/copyright
src/Makefile.am
src/cfuse.cc
src/client/fuse.cc [deleted file]
src/client/fuse.h [deleted file]
src/config.cc
src/config.h

index f8869a86999c375cb27aac327209e1b1750e5275..95d227b5ccbc44f73b87be098153c735c62d2b9a 100644 (file)
@@ -7,12 +7,6 @@ Files: *
 Copyright: (c) 2004-2010 by Sage Weil <sage@newdream.net>
 License: LGPL2.1 (see /usr/share/common-licenses/LGPL-2.1)
 
-Files: src/client/fuse.cc
-Copyright: 
-    Copyright (C) 2001-2005  Miklos Szeredi <miklos@szeredi.hu>
-    Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
-License: GPL
-
 Files: src/rbd.cc
 Copyright:
     Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
index a1050db94647fd8277c801d38deeaf2476f06c38..16864ff2f97aec928706dce0d994ac6149d95cd7 100644 (file)
@@ -110,7 +110,7 @@ core: cmon cosd cmds ceph cephfs librados-config cconf monmaptool osdmaptool cru
 
 # fuse targets?
 if WITH_FUSE
-cfuse_SOURCES = cfuse.cc msg/SimpleMessenger.cc client/fuse.cc client/fuse_ll.cc
+cfuse_SOURCES = cfuse.cc msg/SimpleMessenger.cc client/fuse_ll.cc
 cfuse_LDADD = -lfuse libclient.a libosdc.a libcrush.a libcommon.a -lpthread -lm $(CRYPTOPP_LIBS)
 cfuse_CXXFLAGS = ${AM_CXXFLAGS}
 bin_PROGRAMS += cfuse
@@ -608,7 +608,6 @@ noinst_HEADERS = \
         client/Client.h\
         client/SyntheticClient.h\
         client/Trace.h\
-        client/fuse.h\
         client/fuse_ll.h\
        client/ioctl.h\
        client/libceph.h\
index e7de35ac4a6e097ad263e41e7269ba260f2db6bd..3af328ff1b831c12bcd8ace26fd05dc75ffc19df 100644 (file)
@@ -20,7 +20,6 @@ using namespace std;
 #include "config.h"
 
 #include "client/Client.h"
-#include "client/fuse.h"
 #include "client/fuse_ll.h"
 
 #include "msg/SimpleMessenger.h"
@@ -135,10 +134,7 @@ int main(int argc, const char **argv, const char *envp[]) {
     
     dout_create_rank_symlink(client->get_nodeid().v);
     cerr << "cfuse[" << getpid() << "]: starting fuse" << std::endl;
-    if (g_conf.fuse_ll)
-      r = ceph_fuse_ll_main(client, argc, argv, fd[1]);
-    else
-      r = ceph_fuse_main(client, argc, argv);
+    r = ceph_fuse_ll_main(client, argc, argv, fd[1]);
     cerr << "cfuse[" << getpid() << "]: fuse finished with error " << r << std::endl;
     
     client->unmount();
diff --git a/src/client/fuse.cc b/src/client/fuse.cc
deleted file mode 100644 (file)
index 81ddfd6..0000000
+++ /dev/null
@@ -1,304 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2010 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GPL.
- * 
- */
-
-
-/*
-    FUSE: Filesystem in Userspace
-    Copyright (C) 2001-2005  Miklos Szeredi <miklos@szeredi.hu>
-
-    This program can be distributed under the terms of the GNU GPL.
-    See the file COPYING.
-*/
-
-
-// fuse crap
-#ifdef linux
-/* For pread()/pwrite() */
-#define _XOPEN_SOURCE 500
-#endif
-
-#define FUSE_USE_VERSION 26
-
-#include <fuse.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <errno.h>
-#include <sys/statvfs.h>
-
-
-// ceph stuff
-#include "include/types.h"
-
-#include "Client.h"
-
-#include "config.h"
-
-// globals
-static Client *client;     // the ceph client
-
-
-
-// ------
-// fuse hooks
-
-static int ceph_getattr(const char *path, struct stat *stbuf)
-{
-  return client->lstat(path, stbuf);
-}
-
-static int ceph_readlink(const char *path, char *buf, size_t size)
-{
-  int res;
-
-  res = client->readlink(path, buf, size - 1);
-  if (res < 0) return res;
-  
-  buf[res] = '\0';
-  return 0;
-}
-
-static int ceph_mknod(const char *path, mode_t mode, dev_t rdev) 
-{
-  return client->mknod(path, mode);
-}
-
-static int ceph_mkdir(const char *path, mode_t mode)
-{
-  return client->mkdir(path, mode);
-}
-
-static int ceph_unlink(const char *path)
-{
-  return client->unlink(path);
-}
-
-static int ceph_rmdir(const char *path)
-{
-  return client->rmdir(path);
-}
-
-static int ceph_symlink(const char *from, const char *to)
-{
-  return client->symlink(from, to);
-}
-
-static int ceph_rename(const char *from, const char *to)
-{
-  return client->rename(from, to);
-}
-
-static int ceph_link(const char *from, const char *to)
-{
-  return client->link(from, to);
-}
-
-static int ceph_chmod(const char *path, mode_t mode)
-{
-  return client->chmod(path, mode);
-}
-
-static int ceph_chown(const char *path, uid_t uid, gid_t gid)
-{
-  return client->chown(path, uid, gid);
-}
-
-static int ceph_truncate(const char *path, off_t size)
-{
-  return client->truncate(path, size);      
-}
-
-static int ceph_utime(const char *path, struct utimbuf *buf)
-{
-  return client->utime(path, buf);
-}
-
-
-// ------------------
-// file i/o
-
-static int ceph_open(const char *path, struct fuse_file_info *fi)
-{
-  int res;
-  
-  res = client->open(path, fi->flags, 0);
-  if (res < 0) return res;
-  fi->fh = res;
-  return 0;  // fuse wants 0 onsucess
-}
-
-static int ceph_read(const char *path, char *buf, size_t size, off_t offset,
-                     struct fuse_file_info *fi)
-{
-  int fd = fi->fh;
-  return client->read(fd, buf, size, offset);
-}
-
-static int ceph_write(const char *path, const char *buf, size_t size,
-                     off_t offset, struct fuse_file_info *fi)
-{
-  int fd = fi->fh;
-  return client->write(fd, buf, size, offset);
-}
-
-static int ceph_flush(const char *path, struct fuse_file_info *fi)
-{
-  //int fh = fi->fh;
-  //return client->flush(fh);
-  return 0;
-}
-
-static int ceph_statfs(const char *path, struct statvfs *stbuf)
-{
-  return client->statfs(path, stbuf);
-}
-
-static int ceph_release(const char *path, struct fuse_file_info *fi)
-{
-  int fd = fi->fh;
-  int r = client->close(fd);  // close the file
-  return r;
-}
-
-static int ceph_fsync(const char *path, int isdatasync,
-                     struct fuse_file_info *fi)
-{
-  int fd = fi->fh;
-  return client->fsync(fd, isdatasync ? true:false);
-}
-
-
-// ---------------------
-// directory i/o
-
-static int ceph_opendir(const char *path, struct fuse_file_info *fi)
-{
-  DIR *dirp;
-  int r = client->opendir(path, &dirp);
-  if (r < 0) return r;
-  fi->fh = (uint64_t)(void*)dirp;
-  return 0;
-}
-
-static int ceph_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t off, fuse_file_info *fi)
-{
-  DIR *dirp = (DIR*)fi->fh;
-  
-  client->seekdir(dirp, off);
-
-  int res = 0;
-  struct dirent de;
-  struct stat st;
-  int stmask = 0;
-  while (res == 0) {
-    int r = client->readdirplus_r(dirp, &de, &st, &stmask);
-    if (r != 0) break;
-    int stneed = CEPH_STAT_CAP_TYPE;
-    res = filler(buf,
-                 de.d_name,
-                ((stmask & stneed) == stneed) ? &st:0,
-                client->telldir(dirp));
-  }
-  return 0;
-}
-
-static int ceph_releasedir(const char *path, struct fuse_file_info *fi)
-{
-  DIR *dirp = (DIR*)fi->fh;
-  int r = client->closedir(dirp);  // close the file
-  return r;
-}
-
-
-
-
-
-const static struct fuse_operations ceph_oper = {
-  getattr: ceph_getattr,
-  readlink: ceph_readlink,
-  getdir: 0,
-  mknod: ceph_mknod,
-  mkdir: ceph_mkdir,
-  unlink: ceph_unlink,
-  rmdir: ceph_rmdir,
-  symlink: ceph_symlink,
-  rename: ceph_rename,
-  link: ceph_link,
-  chmod: ceph_chmod,
-  chown: ceph_chown,
-  truncate: ceph_truncate,
-  utime: ceph_utime,
-  open: ceph_open,
-  read: ceph_read,
-  write: ceph_write,
-  statfs: ceph_statfs,
-  flush: ceph_flush,   
-  release: ceph_release,
-  fsync: ceph_fsync,
-  setxattr: 0,
-  getxattr: 0,
-  listxattr: 0,
-  removexattr: 0,
-  opendir: ceph_opendir,
-  readdir: ceph_readdir,
-  releasedir: ceph_releasedir  
-};
-
-
-int ceph_fuse_main(Client *c, int argc, const char *argv[])
-{
-  // init client
-  client = c;
-
-  // set up fuse argc/argv
-  int newargc = 0;
-  const char **newargv = (const char **) malloc((argc + 10) * sizeof(char *));
-  newargv[newargc++] = argv[0];
-  
-  // allow other (all!) users to see my file system
-  // NOTE: echo user_allow_other >> /etc/fuse.conf
-  // NB: seems broken on Darwin
-#ifndef DARWIN
-  newargv[newargc++] = "-o";
-  newargv[newargc++] = "allow_other";
-#endif // DARWIN
-  
-  // use inos
-  newargv[newargc++] = "-o";
-  newargv[newargc++] = "use_ino";
-
-  // large reads, direct_io (no kernel cachine)
-  //newargv[newargc++] = "-o";
-  //newargv[newargc++] = "large_read";
-  if (g_conf.fuse_direct_io) {
-    newargv[newargc++] = "-o";
-    newargv[newargc++] = "direct_io";
-  }
-
-  // disable stupid fuse unlink hiding thing
-  newargv[newargc++] = "-o";
-  newargv[newargc++] = "hard_remove";
-
-  // force into foreground
-  //   -> we can watch stdout this way!!
-  newargv[newargc++] = "-f";
-  
-  // copy rest of cmdline (hopefully, the mount point!)
-  for (int argctr = 1; argctr < argc; argctr++) newargv[newargc++] = argv[argctr];
-  
-  // go fuse go
-  cout << "ok, calling fuse_main" << std::endl;
-  int r = fuse_main(newargc, (char**)newargv, &ceph_oper, 0);
-  return r;
-}
diff --git a/src/client/fuse.h b/src/client/fuse.h
deleted file mode 100644 (file)
index f906f78..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
- *
- * This is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1, as published by the Free Software 
- * Foundation.  See file COPYING.
- * 
- */
-
-
-
-/* ceph_fuse_main
- * - start up fuse glue, attached to Client* cl.
- * - argc, argv should include a mount point, and 
- *   any weird fuse options you want.  by default,
- *   we will put fuse in the foreground so that it
- *   won't fork and we can see stdout.
- */
-int ceph_fuse_main(Client *cl, int argc, const char *argv[]);
index af708e2726be144c9922e2c5edf80c658a531393..8e2e26b9dad0b18be72b675ca9f6706a316eff4f 100644 (file)
@@ -340,7 +340,6 @@ static struct config_option config_optionsp[] = {
        OPTION(client_mountpoint, 'r', OPT_STR, "/"),
        OPTION(client_notify_timeout, 0, OPT_INT, 10), // in seconds
        OPTION(fuse_direct_io, 0, OPT_INT, 0),
-       OPTION(fuse_ll, 0, OPT_BOOL, true),
        OPTION(client_oc, 0, OPT_BOOL, true),
        OPTION(client_oc_size, 0, OPT_INT, 1024*1024* 200),    // MB * n
        OPTION(client_oc_max_dirty, 0, OPT_INT, 1024*1024* 100),    // MB * n  (dirty OR tx.. bigish)
index 7b2b865336b32c4273fc63096ad4535c82947046..614e1f4417d745670888ccd85549abc73fbc62eb 100644 (file)
@@ -210,7 +210,6 @@ struct md_config_t {
   const char *client_snapdir;
   const char *client_mountpoint;
   int fuse_direct_io;
-  bool fuse_ll;
 
   // objectcacher
   bool     client_oc;