summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-26 16:42:41 -0700
committerSage Weil <sage@inktank.com>2013-07-26 16:58:14 -0700
commit14a3e2ddce1487e47498249c3f63d7df57b55ec5 (patch)
tree73ac6844d9b455afc4c814c23f4e1aca533f8949
parent6faf8b680d1474b0f47fc87cde8e406ce985d60f (diff)
downloadceph-14a3e2ddce1487e47498249c3f63d7df57b55ec5.tar.gz
remove unused fiemap code
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--COPYING5
-rw-r--r--debian/copyright5
-rw-r--r--src/Makefile.am3
-rw-r--r--src/common/fiemap.cc96
-rw-r--r--src/include/fiemap.h27
-rw-r--r--src/os/FileStore.cc2
-rw-r--r--src/rbd.cc2
7 files changed, 2 insertions, 138 deletions
diff --git a/COPYING b/COPYING
index b374bdc1801..fe6ffaac0f8 100644
--- a/COPYING
+++ b/COPYING
@@ -15,11 +15,6 @@ Copyright:
Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
License: GPL2
-Files: src/common/fiemap.cc
-Copyright:
- Copyright (C) 2010 Canonical
-License: GPL2
-
Files: src/mount/canonicalize.c
Copyright: Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
License: LGPL2 or later
diff --git a/debian/copyright b/debian/copyright
index 4295a1564f9..e94a11b9962 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -16,11 +16,6 @@ Copyright:
Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
License: GPL2
-Files: src/common/fiemap.cc
-Copyright:
- Copyright (C) 2010 Canonical
-License: GPL2
-
Files: src/mount/canonicalize.c
Copyright: Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
License: LGPL2 or later
diff --git a/src/Makefile.am b/src/Makefile.am
index 307abf2f965..a9bbde32686 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -504,7 +504,7 @@ ceph_radosacl_SOURCES = radosacl.cc
ceph_radosacl_LDADD = librados.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)
bin_DEBUGPROGRAMS += ceph_scratchtool ceph_scratchtoolpp ceph_radosacl
-rbd_SOURCES = rbd.cc common/fiemap.cc common/secret.c common/TextTable.cc common/util.cc
+rbd_SOURCES = rbd.cc common/secret.c common/TextTable.cc common/util.cc
rbd_CXXFLAGS = ${AM_CXXFLAGS}
rbd_LDADD = librbd.la librados.la $(LIBGLOBAL_LDA) -lkeyutils
if LINUX
@@ -1895,7 +1895,6 @@ noinst_HEADERS = \
include/encoding.h\
include/err.h\
include/error.h\
- include/fiemap.h\
include/filepath.h\
include/frag.h\
include/hash.h\
diff --git a/src/common/fiemap.cc b/src/common/fiemap.cc
deleted file mode 100644
index a1d5fbe9396..00000000000
--- a/src/common/fiemap.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2010 Canonical
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * Author Colin Ian King, colin.king@canonical.com
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-
-#if defined(__linux__)
-#include <linux/fs.h>
-#endif
-#include "include/inttypes.h"
-#include "include/fiemap.h"
-
-struct fiemap *read_fiemap(int fd)
-{
- struct fiemap *fiemap;
- struct fiemap *_realloc_fiemap = NULL;
- int extents_size;
- int r;
-
- if ((fiemap = (struct fiemap*)malloc(sizeof(struct fiemap))) == NULL) {
- fprintf(stderr, "Out of memory allocating fiemap\n");
- return NULL;
- }
- memset(fiemap, 0, sizeof(struct fiemap));
-
- fiemap->fm_start = 0;
- fiemap->fm_length = ~0; /* Lazy */
- fiemap->fm_flags = 0;
- fiemap->fm_extent_count = 0;
- fiemap->fm_mapped_extents = 0;
-
- /* Find out how many extents there are */
- r = ioctl(fd, FS_IOC_FIEMAP, fiemap);
- if (r < 0) {
- goto done_err;
- }
-
- if (!fiemap->fm_mapped_extents) {
- goto done_err;
- }
-
- /* Read in the extents */
- extents_size = sizeof(struct fiemap_extent) * (fiemap->fm_mapped_extents);
-
- /* Resize fiemap to allow us to read in the extents */
-
- if ((_realloc_fiemap = (struct fiemap*)realloc(fiemap,sizeof(struct fiemap) +
- extents_size)) == NULL) {
- fprintf(stderr, "Out of memory allocating fiemap\n");
- goto done_err;
- } else {
- fiemap = _realloc_fiemap;
- }
-
- memset(fiemap->fm_extents, 0, extents_size);
- fiemap->fm_extent_count = fiemap->fm_mapped_extents;
- fiemap->fm_mapped_extents = 0;
-
- if (ioctl(fd, FS_IOC_FIEMAP, fiemap) < 0) {
- fprintf(stderr, "fiemap ioctl() failed\n");
- goto done_err;
- }
-
- return fiemap;
-done_err:
- free(fiemap);
- return NULL;
-}
-
diff --git a/src/include/fiemap.h b/src/include/fiemap.h
deleted file mode 100644
index 846adb155ff..00000000000
--- a/src/include/fiemap.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef __CEPH_FIEMAP_H
-#define __CEPH_FIEMAP_H
-
-#include "acconfig.h"
-
-/*
- * the header is missing on most systems. for the time being at
- * least, include our own copy in the repo.
- */
-#ifdef HAVE_FIEMAP_H
-# include <linux/fiemap.h>
-#else
-# include "linux_fiemap.h"
-#endif
-
-#if defined(__linux__)
-#include <linux/ioctl.h>
-#elif defined(__FreeBSD__)
-#include <sys/ioctl.h>
-#endif
-#ifndef FS_IOC_FIEMAP
-# define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
-#endif
-
-extern "C" struct fiemap *read_fiemap(int fd);
-
-#endif
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 28f81b7547f..108a857ab9f 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -36,7 +36,7 @@
#endif
#include "include/compat.h"
-#include "include/fiemap.h"
+#include "include/linux_fiemap.h"
#include "common/xattr.h"
#include "chain_xattr.h"
diff --git a/src/rbd.cc b/src/rbd.cc
index c9b2f0a272c..7f90c1f118e 100644
--- a/src/rbd.cc
+++ b/src/rbd.cc
@@ -60,8 +60,6 @@
#include <sys/param.h>
#endif
-#include "include/fiemap.h"
-
#define MAX_SECRET_LEN 1000
#define MAX_POOL_NAME_SIZE 128