[sheepdog] [PATCH 2/5] sheep: remove unused function init_mnt_path()

Liu Yuan namei.unix at gmail.com
Tue Dec 4 13:20:28 CET 2012


From: Liu Yuan <tailai.ly at taobao.com>

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/sheep_priv.h |    1 -
 sheep/store.c      |   35 -----------------------------------
 2 files changed, 36 deletions(-)

diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 00bc032..f5cd555 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -206,7 +206,6 @@ static inline struct store_driver *find_store_driver(const char *name)
 extern struct cluster_info *sys;
 extern struct store_driver *sd_store;
 extern char *obj_path;
-extern char *mnt_path;
 extern char *jrnl_path;
 extern char *epoch_path;
 extern mode_t def_fmode;
diff --git a/sheep/store.c b/sheep/store.c
index 7dae5de..893d334 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -276,37 +276,6 @@ static int init_epoch_path(const char *base_path)
 	return init_path(epoch_path, NULL);
 }
 
-static int init_mnt_path(const char *base_path)
-{
-	int ret;
-	FILE *fp;
-	struct mntent *mnt;
-	struct stat s, ms;
-
-	ret = stat(base_path, &s);
-	if (ret)
-		return 1;
-
-	fp = setmntent(MOUNTED, "r");
-	if (!fp)
-		return 1;
-
-	while ((mnt = getmntent(fp))) {
-		ret = stat(mnt->mnt_dir, &ms);
-		if (ret)
-			continue;
-
-		if (ms.st_dev == s.st_dev) {
-			mnt_path = strdup(mnt->mnt_dir);
-			break;
-		}
-	}
-
-	endmntent(fp);
-
-	return 0;
-}
-
 #define JRNL_PATH "/journal/"
 
 static int init_jrnl_path(const char *base_path)
@@ -410,10 +379,6 @@ int init_store(const char *d)
 	if (ret)
 		return ret;
 
-	ret = init_mnt_path(d);
-	if (ret)
-		return ret;
-
 	ret = init_jrnl_path(d);
 	if (ret)
 		return ret;
-- 
1.7.9.5




More information about the sheepdog mailing list