From e2e9041cdb2c8fe09af3eb4ca6e70e6675fd1c82 Mon Sep 17 00:00:00 2001 From: franklahm Date: Tue, 26 Jan 2010 18:13:48 +0000 Subject: [PATCH 1/1] Remove mtab CNID backend --- configure.in | 3 +- libatalk/cnid/Makefile.am | 6 +- libatalk/cnid/mtab/.cvsignore | 6 -- libatalk/cnid/mtab/Makefile.am | 10 --- libatalk/cnid/mtab/README | 1 - libatalk/cnid/mtab/cnid_mtab.c | 137 --------------------------------- libatalk/cnid/mtab/cnid_mtab.h | 32 -------- macros/cnid-backend.m4 | 26 ------- 8 files changed, 2 insertions(+), 219 deletions(-) delete mode 100644 libatalk/cnid/mtab/.cvsignore delete mode 100644 libatalk/cnid/mtab/Makefile.am delete mode 100644 libatalk/cnid/mtab/README delete mode 100644 libatalk/cnid/mtab/cnid_mtab.c delete mode 100644 libatalk/cnid/mtab/cnid_mtab.h diff --git a/configure.in b/configure.in index ef3b0734..eaa9488f 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -dnl $Id: configure.in,v 1.236 2010-01-04 10:02:18 franklahm Exp $ +dnl $Id: configure.in,v 1.237 2010-01-26 18:13:48 franklahm Exp $ dnl configure.in for netatalk AC_INIT(etc/afpd/main.c) @@ -1244,7 +1244,6 @@ AC_OUTPUT([Makefile libatalk/cnid/Makefile libatalk/cnid/cdb/Makefile libatalk/cnid/last/Makefile - libatalk/cnid/mtab/Makefile libatalk/cnid/dbd/Makefile libatalk/cnid/tdb/Makefile libatalk/compat/Makefile diff --git a/libatalk/cnid/Makefile.am b/libatalk/cnid/Makefile.am index 1454d91c..d1051e67 100644 --- a/libatalk/cnid/Makefile.am +++ b/libatalk/cnid/Makefile.am @@ -1,6 +1,6 @@ # Makefile.am for libatalk/cnid/ -SUBDIRS = last mtab cdb dbd tdb +SUBDIRS = last cdb dbd tdb noinst_LTLIBRARIES = libcnid.la LIBCNID_DEPS = dbd/libcnid_dbd.la @@ -17,10 +17,6 @@ if USE_TDB_BACKEND LIBCNID_DEPS += tdb/libcnid_tdb.la endif -if USE_MTAB_BACKEND -LIBCNID_DEPS += mtab/libcnid_mtab.la -endif - libcnid_la_SOURCES = cnid.c cnid_init.c libcnid_la_LIBADD = $(LIBCNID_DEPS) diff --git a/libatalk/cnid/mtab/.cvsignore b/libatalk/cnid/mtab/.cvsignore deleted file mode 100644 index 0d0371d7..00000000 --- a/libatalk/cnid/mtab/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -Makefile -Makefile.in -*.lo -*.la -.deps -.libs diff --git a/libatalk/cnid/mtab/Makefile.am b/libatalk/cnid/mtab/Makefile.am deleted file mode 100644 index 0d366c0e..00000000 --- a/libatalk/cnid/mtab/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile.am for libatalk/cnid/ - -if USE_MTAB_BACKEND -noinst_LTLIBRARIES = libcnid_mtab.la -endif - -libcnid_mtab_la_SOURCES = cnid_mtab.c \ - cnid_mtab.h - -EXTRA_DIST = README diff --git a/libatalk/cnid/mtab/README b/libatalk/cnid/mtab/README deleted file mode 100644 index 19e634f9..00000000 --- a/libatalk/cnid/mtab/README +++ /dev/null @@ -1 +0,0 @@ -There are still things to do. See ../last/README for details. diff --git a/libatalk/cnid/mtab/cnid_mtab.c b/libatalk/cnid/mtab/cnid_mtab.c deleted file mode 100644 index 237f94ff..00000000 --- a/libatalk/cnid/mtab/cnid_mtab.c +++ /dev/null @@ -1,137 +0,0 @@ - -/* - * $Id: cnid_mtab.c,v 1.4 2009-11-24 12:18:20 didg Exp $ - * - * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) - * All Rights Reserved. See COPYRIGHT. - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif /* HAVE_CONFIG_H */ - -#ifdef CNID_BACKEND_MTAB - -#include "cnid_mtab.h" -#include -#include - -#ifndef AFS -#define CNID_XOR(a) (((a) >> 16) ^ (a)) -#define CNID_DEV(a) ((((CNID_XOR(major((a)->st_dev)) & 0xf) << 3) |\ - (CNID_XOR(minor((a)->st_dev)) & 0x7)) << 24) -#define CNID_INODE(a) (((a)->st_ino ^ (((a)->st_ino & 0xff000000) >> 8)) \ - & 0x00ffffff) -#define CNID_FILE(a) (((a) & 0x1) << 31) -#define CNID(a,b) (CNID_DEV(a) | CNID_INODE(a) | CNID_FILE(b)) -#else -#define CNID(a,b) (((a)->st_ino & 0x7fffffff) | CNID_FILE(b)) -#endif - -/* ------------------------ */ -cnid_t cnid_mtab_add(struct _cnid_db *cdb, const struct stat *st, - const cnid_t did, char *name, const size_t len, cnid_t hint) -{ - struct stat lst; - const struct stat *lstp; - - lstp = lstat(name, &lst) < 0 ? st : &lst; - - return htonl(CNID(lstp, 1)); -} - - - -void cnid_mtab_close(struct _cnid_db *cdb) -{ - free(cdb->volpath); - free(cdb); -} - - - -int cnid_mtab_delete(struct _cnid_db *cdb, const cnid_t id) -{ - return CNID_INVALID; -} - - - -/* Return CNID for a given did/name. */ -cnid_t cnid_mtab_get(struct _cnid_db *cdb, const cnid_t did, char *name, const size_t len) -{ - return CNID_INVALID; -} - - -cnid_t cnid_mtab_lookup(struct _cnid_db *cdb, const struct stat *st, const cnid_t did, char *name, const size_t len) -{ - return CNID_INVALID; -} - - -static struct _cnid_db *cnid_mtab_new(const char *volpath) -{ - struct _cnid_db *cdb; - - if ((cdb = (struct _cnid_db *) calloc(1, sizeof(struct _cnid_db))) == NULL) - return NULL; - - if ((cdb->volpath = strdup(volpath)) == NULL) { - free(cdb); - return NULL; - } - - cdb->flags = 0; - cdb->cnid_add = cnid_mtab_add; - cdb->cnid_delete = cnid_mtab_delete; - cdb->cnid_get = cnid_mtab_get; - cdb->cnid_lookup = cnid_mtab_lookup; - cdb->cnid_nextid = NULL; //cnid_mtab_nextid; - cdb->cnid_resolve = cnid_mtab_resolve; - cdb->cnid_update = cnid_mtab_update; - cdb->cnid_close = cnid_mtab_close; - - return cdb; -} - -struct _cnid_db *cnid_mtab_open(const char *dir, mode_t mask, u_int32_t flags _U_) -{ - struct _cnid_db *cdb; - - if (!dir) { - return NULL; - } - - if ((cdb = cnid_mtab_new(dir)) == NULL) { - LOG(log_error, logtype_default, "cnid_open: Unable to allocate memory for database"); - return NULL; - } - - cdb->_private = NULL; - return cdb; -} - -struct _cnid_module cnid_mtab_module = { - "mtab", - {NULL, NULL}, - cnid_mtab_open, -}; - - -/* Return the did/name pair corresponding to a CNID. */ -char *cnid_mtab_resolve(struct _cnid_db *cdb, cnid_t * id, void *buffer, size_t len) -{ - return NULL; -} - - -int cnid_mtab_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st, - const cnid_t did, char *name, const size_t len - /*, const char *info, const int infolen */ ) -{ - return 0; -} - -#endif /* CNID_BACKEND_MTAB */ diff --git a/libatalk/cnid/mtab/cnid_mtab.h b/libatalk/cnid/mtab/cnid_mtab.h deleted file mode 100644 index 672e36ec..00000000 --- a/libatalk/cnid/mtab/cnid_mtab.h +++ /dev/null @@ -1,32 +0,0 @@ - -/* - * interface for database access to cnids. i do it this way to abstract - * things a bit in case we want to change the underlying implementation. - */ - -#ifndef _ATALK_CNID_MTAB__H -#define _ATALK_CNID_MTAB__H 1 - -#include -#include -#include -#include - -#include -#include - -extern struct _cnid_module cnid_mtab_module; - -extern struct _cnid_db *cnid_mtab_open (const char *, mode_t); -extern void cnid_mtab_close (struct _cnid_db *); -extern cnid_t cnid_mtab_add (struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t, cnid_t); -extern cnid_t cnid_mtab_get (struct _cnid_db *, const cnid_t, char *, const size_t); -extern char *cnid_mtab_resolve (struct _cnid_db *, cnid_t *, void *, size_t); -extern cnid_t cnid_mtab_lookup (struct _cnid_db *, const struct stat *, const cnid_t, - char *, const size_t); -extern int cnid_mtab_update (struct _cnid_db *, const cnid_t, const struct stat *, - const cnid_t, char *, size_t); -extern int cnid_mtab_delete (struct _cnid_db *, const cnid_t); - -#endif /* include/atalk/cnid_mtab.h */ diff --git a/macros/cnid-backend.m4 b/macros/cnid-backend.m4 index 8bfb2deb..e7f2101b 100644 --- a/macros/cnid-backend.m4 +++ b/macros/cnid-backend.m4 @@ -106,32 +106,6 @@ AC_DEFUN([AC_NETATALK_CNID], [ fi AM_CONDITIONAL(USE_TDB_BACKEND, test x"$use_tdb_backend" = x"yes") - dnl Determine whether or not to use MTAB DID scheme - AC_MSG_CHECKING([whether or not to use MTAB DID scheme]) - AC_ARG_WITH(cnid-mtab-backend, - [ --with-cnid-mtab-backend build MTAB CNID scheme], - [ - if test x"$withval" = x"no"; then - use_mtab_backend=no - else - use_mtab_backend=yes - fi - ],[ - use_mtab_backend=no - ]) - - if test $use_mtab_backend = yes; then - AC_MSG_RESULT([yes]) - AC_DEFINE(CNID_BACKEND_MTAB, 1, [Define if CNID MTAB scheme backend should be compiled.]) - if test x"$DEFAULT_CNID_SCHEME" = x; then - DEFAULT_CNID_SCHEME=mtab - fi - compiled_backends="$compiled_backends mtab" - else - AC_MSG_RESULT([no]) - fi - AM_CONDITIONAL(USE_MTAB_BACKEND, test x"$use_mtab_backend" = x"yes") - dnl Set default DID scheme AC_MSG_CHECKING([default DID scheme]) AC_ARG_WITH(cnid-default-backend, -- 2.39.2