aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-04-24 21:14:01 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-24 21:14:01 -0400
commit8d7c2c7a452200060c8c32470a7e967119c56f80 (patch)
tree33154fc777d057ad79778ebb58afba99d1696053
parenta7b45f1a8e9d1376490174ffb5230e30de3d92f2 (diff)
downloaddbfs-8d7c2c7a452200060c8c32470a7e967119c56f80.tar.gz
Rename project to dbfs, eliminate traces of ndbfs.
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac3
-rw-r--r--ndbfs.c169
4 files changed, 3 insertions, 177 deletions
diff --git a/.gitignore b/.gitignore
index 3a97f51..d9aea70 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,7 +20,6 @@ push
stamp-h1
# app-specific
-ndbfs
mkdbfs
dbfs
dbfs-config.h*
diff --git a/Makefile.am b/Makefile.am
index 85fa9dc..2045d80 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,12 +2,9 @@
## Toplevel Makefile.am
##
-INCLUDES = @GNET_CFLAGS@ @FUSE_CFLAGS@
+INCLUDES = @GLIB_CFLAGS@ @FUSE_CFLAGS@
-sbin_PROGRAMS = ndbfs dbfs mkdbfs
-
-ndbfs_SOURCES = ndbfs.c
-ndbfs_LDADD = @GNET_LIBS@ @FUSE_LIBS@
+sbin_PROGRAMS = dbfs mkdbfs
dbfs_SOURCES = dbfs.c dbfs.h dbfs-backend.c libdbfs.c
dbfs_LDADD = @GLIB_LIBS@ @FUSE_LIBS@ @DB_LIBS@
diff --git a/configure.ac b/configure.ac
index 1fcf322..cdbf8b5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
AC_INIT(fuse-db, 0.1, [Jeff Garzik <jgarzik@pobox.com>])
AC_PREREQ(2.52)
-AC_CONFIG_SRCDIR([ndbfs.c])
+AC_CONFIG_SRCDIR([dbfs.c])
AM_INIT_AUTOMAKE([gnu])
AC_CONFIG_HEADERS([dbfs-config.h])
@@ -57,7 +57,6 @@ dnl autoconf output generation
dnl --------------------------
AM_PATH_GLIB_2_0(2.0.0)
-AM_PATH_GNET_2_0(2.0.7)
PKG_CHECK_MODULES([FUSE], fuse)
AC_SUBST(DB_LIBS)
diff --git a/ndbfs.c b/ndbfs.c
deleted file mode 100644
index c990b13..0000000
--- a/ndbfs.c
+++ /dev/null
@@ -1,169 +0,0 @@
-
-#define FUSE_USE_VERSION 25
-
-#include <fuse.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <glib.h>
-
-enum {
- INO_SIZE = 128,
-};
-
-typedef struct {
- char buf[INO_SIZE];
-} dfs_ino_t;
-
-struct ndb_val {
- void *data;
- unsigned int len;
-};
-
-static gchar *pprefix(const char *pfx, const char *path_in)
-{
- gchar *path, *s;
-
- path = g_strdup(path_in);
- while ((*path) && (path[strlen(path) - 1] == '/'))
- path[strlen(path) - 1] = 0;
-
- s = g_strdup_printf("%s%s", pfx, path);
-
- g_free(path);
- return s;
-}
-
-static void ndb_free(struct ndb_val *val)
-{
- /* TODO */
-}
-
-static int ndb_lookup(const char *path, struct ndb_val **val)
-{
- /* TODO */
- *val = NULL;
- return -ENOMEM;
-}
-
-static int dfs_fill_stat(struct stat *stbuf, struct ndb_val *val)
-{
- /* TODO */
- return -EIO;
-}
-
-static int dfs_fill_dir(fuse_fill_dir_t filler, struct ndb_val *val)
-{
- /* TODO */
- return -EIO;
-}
-
-static int dfs_fill_data(char *buf, size_t size, off_t offset,
- struct ndb_val *val)
-{
- /* TODO */
- return -EIO;
-}
-
-static int dfs_getattr(const char *path, struct stat *stbuf)
-{
- int rc = -ENOENT;
- struct ndb_val *val = NULL;
- char *nspath;
-
- memset(stbuf, 0, sizeof(struct stat));
-
- nspath = pprefix("/meta", path);
- rc = ndb_lookup(nspath, &val);
- if (rc)
- goto out;
-
- rc = dfs_fill_stat(stbuf, val);
-
- ndb_free(val);
-
-out:
- g_free(nspath);
- return rc;
-}
-
-static int dfs_readlink(const char *path, char *buf, size_t size)
-{
- int rc = -ENOENT;
- struct ndb_val *val = NULL;
- char *nspath;
-
- nspath = pprefix("/symlink", path);
- rc = ndb_lookup(nspath, &val);
- if (rc)
- goto out;
-
- memcpy(buf, val->data, size < val->len ? size : val->len);
-
- ndb_free(val);
-
-out:
- g_free(nspath);
- return rc;
-}
-
-static int dfs_read(const char *path, char *buf, size_t size, off_t offset,
- struct fuse_file_info *fi)
-{
- struct ndb_val *val = NULL;
- char *nspath;
- int rc = 0;
-
- nspath = pprefix("/data", path);
- rc = ndb_lookup(path, &val);
- if (rc)
- goto out;
-
- rc = dfs_fill_data(buf, size, offset, val);
-
- ndb_free(val);
-
-out:
- g_free(nspath);
- return rc;
-}
-
-static int dfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
- off_t offset, struct fuse_file_info *fi)
-{
- struct ndb_val *val = NULL;
- char *nspath;
- int rc;
-
- nspath = pprefix("/dir", path);
- rc = ndb_lookup(nspath, &val);
- if (rc) {
- if (rc == -ENOENT)
- rc = -ENOTDIR;
- goto out;
- }
-
- filler(buf, ".", NULL, 0);
- filler(buf, "..", NULL, 0);
-
- rc = dfs_fill_dir(filler, val);
-
- ndb_free(val);
-
-out:
- g_free(nspath);
- return rc;
-}
-
-static const struct fuse_operations dfs_ops = {
- .getattr = dfs_getattr,
- .readlink = dfs_readlink,
- .read = dfs_read,
- .readdir = dfs_readdir,
-};
-
-int main(int argc, char *argv[])
-{
- return fuse_main(argc, argv, &dfs_ops);
-}