Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix file_handle redef conflict with fcntl.h and tune compiling stage …

…with GCC 4.6.3
  • Loading branch information...
commit d212c1afa465aa27c2289936e276455c5471b458 1 parent 3a859b7
@macan authored
View
10 Makefile.inc
@@ -2,7 +2,7 @@
# Copyright (c) 2009 Ma Can <ml.macana@gmail.com>
# <macan@ncic.ac.cn>
#
-# Time-stamp: <2012-03-03 13:18:09 macan>
+# Time-stamp: <2012-05-16 18:09:03 macan>
#
# This is the makefile for HVFS project.
#
@@ -11,8 +11,8 @@
CC = gcc
LD = gcc
AR = ar
-PYTHON = /bin/env python
-GIT = /bin/env git
+PYTHON = env python
+GIT = env git
INC_PATH = $(HOME_PATH)/include
LIB_PATH = $(HOME_PATH)/lib
@@ -35,7 +35,7 @@ endif
COMPILE_DATE = `date`
COMPILE_HOST = `hostname`
PYTHON_IX = /usr/include/python
-PYTHON_VERSION = $(shell /bin/env python -V 2>&1 | awk '{print $$2}' | sed -e 's/\.[0-9]$$//g')
+PYTHON_VERSION = $(shell env python -V 2>&1 | awk '{print $$2}' | sed -e 's/\.[0-9]$$//g')
PYTHON_LIB = /usr/lib/
# for now we know the number of cores of the target machines is 8, so just set
@@ -111,7 +111,7 @@ endif
ifeq ($(DISABLE_PYTHON),)
CFLAGS += -DUSE_DT_PYTHON
-LFLAGS += $(PYTHON_LIB)libpython$(PYTHON_VERSION).a -lm -lutil
+LFLAGS += $(PYTHON_LIB)libpython$(PYTHON_VERSION).a -lm -lutil -lz -lssl
endif
LFLAGS += -lrt -ldl -lpthread
View
8 api/api.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-10-11 05:00:26 macan>
+ * Time-stamp: <2012-05-16 17:21:48 macan>
*
* 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
@@ -6951,7 +6951,7 @@ int hvfs_fwrite(char *path, char *name, int column, void *data,
/* hvfs_pstat() lookup a file by <PUUID, fname> or <PUUID, uuid, hash>
*/
-int hvfs_pstat(struct file_handle *fh, void **data, size_t *size)
+int hvfs_pstat(struct pfile_handle *fh, void **data, size_t *size)
{
struct hstat hs = {0,};
u64 puuid = hmi.root_uuid, psalt = hmi.root_salt;
@@ -7018,9 +7018,9 @@ int hvfs_pstat(struct file_handle *fh, void **data, size_t *size)
return err;
}
-/* ploop() accepts a array of file_handle, and do user's operations
+/* ploop() accepts a array of pfile_handle, and do user's operations
*/
-int hvfs_ploop(struct file_handle *fh, int nr, ploop_func_t pf, void **data,
+int hvfs_ploop(struct pfile_handle *fh, int nr, ploop_func_t pf, void **data,
size_t *size)
{
int err = 0, i;
View
17 bin/hvfs.sh
@@ -3,7 +3,7 @@
# Copyright (c) 2009 Ma Can <ml.macana@gmail.com>
# <macan@ncic.ac.cn>
#
-# Time-stamp: <2012-02-17 15:01:58 macan>
+# Time-stamp: <2012-05-18 12:10:52 macan>
#
# This is the mangement script for Pomegranate
#
@@ -28,6 +28,7 @@ fi
if [ "x$LOG_DIR" == "x" ]; then
LOG_DIR="~"
fi
+export LOG_DIR
if [ "x$PASSWD" == "x" ]; then
# it is the normal mode, we do not use expect
@@ -88,13 +89,13 @@ if [ -e $HVFS_HOME/conf/mdsl.conf ]; then
# Using the config file
if [ "x$MODE" == "xfs" ]; then
ARGS=`cat $HVFS_HOME/conf/mdsl.conf | grep -v "^ *#" | grep -v "^$" | grep -v "fsid="`
- MDSL_CMD="fsid=0 "`echo $ARGS`
+ MDSL_CMD="LOG_DIR=$LOG_DIR fsid=0 "`echo $ARGS`
elif [ "x$MODE" == "xkv" ]; then
ARGS=`cat $HVFS_HOME/conf/mdsl.conf | grep -v "^ *#" | grep -v "^$" | grep -v "fsid="`
- MDSL_CMD="fsid=1 "`echo $ARGS`
+ MDSL_CMD="LOG_DIR=$LOG_DIR fsid=1 "`echo $ARGS`
else
ARGS=`cat $HVFS_HOME/conf/mdsl.conf | grep -v "^ *#" | grep -v "^$"`
- MDSL_CMD=`echo $ARGS`
+ MDSL_CMD="LOG_DIR=$LOG_DIR "`echo $ARGS`
fi
else
if [ "x$MODE" == "xfs" ]; then
@@ -109,13 +110,13 @@ if [ -e $HVFS_HOME/conf/mds.conf ]; then
# Using the config file
if [ "x$MODE" == "xfs" ]; then
ARGS=`cat $HVFS_HOME/conf/mds.conf | grep -v "^ *#" | grep -v "^$" | grep -v "fsid="`
- MDS_CMD="fsid=0 "`echo $ARGS`
+ MDS_CMD="LOG_DIR=$LOG_DIR fsid=0 "`echo $ARGS`
elif [ "x$MODE" == "xkv" ]; then
ARGS=`cat $HVFS_HOME/conf/mds.conf | grep -v "^ *#" | grep -v "^$" | grep -v "fsid="`
- MDS_CMD="fsid=1 "`echo $ARGS`
+ MDS_CMD="LOG_DIR=$LOG_DIR fsid=1 "`echo $ARGS`
else
ARGS=`cat $HVFS_HOME/conf/mds.conf | grep -v "^ *#" | grep -v "^$"`
- MDS_CMD=`echo $ARGS`
+ MDS_CMD="LOG_DIR=$LOG_DIR "`echo $ARGS`
fi
else
if [ "x$MODE" == "xfs" ]; then
@@ -631,7 +632,7 @@ function do_ut() {
fi
ipnr=`cat $CONFIG_FILE | grep "client:" | awk -F: '{print $2":"$4":"$3}'`
# prepare the client cmd environment variables
- CLIENT_CMD=`echo $ARGS | sed -e "s/nr=[-0-9]*//g"`
+ CLIENT_CMD="LOG_DIR=$LOG_DIR "`echo $ARGS | sed -e "s/nr=[-0-9]*//g"`
# start clients now
I=0
View
10 branch/branch.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-10-13 04:04:23 macan>
+ * Time-stamp: <2012-05-16 17:22:14 macan>
*
* 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
@@ -3072,13 +3072,13 @@ void branch_dumpbase(void *data, size_t size, char **outstr)
}
}
-/* branch_base2fh() translate a base array to file_handle array
+/* branch_base2fh() translate a base array to pfile_handle array
*/
-int branch_base2fh(void *data, size_t size, struct file_handle **ofh,
+int branch_base2fh(void *data, size_t size, struct pfile_handle **ofh,
int *onr)
{
struct base_dbs *bd, *end;
- struct file_handle *fh;
+ struct pfile_handle *fh;
char *regstr = "^([0-9a-fA-F]+):([^:]*):([0-9a-fA-F]+):([0-9a-fA-F]+)";
regex_t reg;
regmatch_t pmatch[5];
@@ -3106,7 +3106,7 @@ int branch_base2fh(void *data, size_t size, struct file_handle **ofh,
fh = xzalloc(nr * sizeof(*fh));
if (!fh) {
- hvfs_err(xnet, "xzalloc() file_handle failed\n");
+ hvfs_err(xnet, "xzalloc() pfile_handle failed\n");
err = -ENOMEM;
goto out_free;
}
View
12 include/amc_api.h
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-06-17 09:42:09 macan>
+ * Time-stamp: <2012-05-16 17:21:28 macan>
*
* 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
@@ -156,10 +156,10 @@ int __hvfs_clear_dtrigger(struct hstat *);
int hvfs_statfs(void **data);
void hvfs_free(void *p);
-struct file_handle;
-typedef int (*ploop_func_t)(struct file_handle *, void **, size_t *);
-int hvfs_pstat(struct file_handle *fh, void **data, size_t *size);
-int hvfs_ploop(struct file_handle *fh, int nr, ploop_func_t pf, void **data,
+struct pfile_handle;
+typedef int (*ploop_func_t)(struct pfile_handle *, void **, size_t *);
+int hvfs_pstat(struct pfile_handle *fh, void **data, size_t *size);
+int hvfs_ploop(struct pfile_handle *fh, int nr, ploop_func_t pf, void **data,
size_t *size);
/* internal APIs */
@@ -207,7 +207,7 @@ struct branch_search_expr_tx
};
/* File handle returned by BRANCH subsystem */
-struct file_handle
+struct pfile_handle
{
u64 puuid;
u64 uuid;
View
2  lib/Makefile
@@ -2,7 +2,7 @@
# Copyright (c) 2009 Ma Can <ml.macana@gmail.com>
# <macan@ncic.ac.cn>
#
-# Time-stamp: <2011-02-14 16:37:31 macan>
+# Time-stamp: <2012-05-18 12:41:08 macan>
#
# This is the makefile for HVFS project.
#
View
7 mdsl/storage.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2012-03-03 11:32:31 macan>
+ * Time-stamp: <2012-05-18 11:39:02 macan>
*
* 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
@@ -757,7 +757,10 @@ int mdsl_storage_init(void)
err = setrlimit(RLIMIT_NOFILE, &rli);
if (err) {
hvfs_err(xnet, "setrlimit failed w/ %s\n", strerror(errno));
- return -errno;
+ hvfs_warning(xnet, "%sStorage Server has FD limit! To overcome "
+ "this limit, please use a powerful UID to run this"
+ " process.%s\n",
+ HVFS_COLOR_RED, HVFS_COLOR_END);
}
if (!hmo.conf.storage_fdhash_size) {
View
4 test/xnet/Makefile
@@ -2,7 +2,7 @@
# Copyright (c) 2009 Ma Can <ml.macana@gmail.com>
# <macan@ncic.ac.cn>
#
-# Time-stamp: <2011-06-29 05:20:37 macan>
+# Time-stamp: <2012-05-18 12:42:31 macan>
#
# This is the makefile for HVFS project.
#
@@ -31,7 +31,7 @@ all : $(TEST_XNET_SOURCE:.c=.ut)
-L$(XNET) -lxnet -L$(MDS) -lmds \
-L$(R2) -lr2 -L$(MDSL) -lmdsl \
-L$(FUSE) $(EX_LFLAGS) -L$(API) -lapi -L$(R2) -lr2 \
- -L$(BRANCH) -lbranch $(LFLAGS) -L$(LIB_PATH) -lhvfs
+ -L$(BRANCH) -lbranch $(LFLAGS) -L$(LIB_PATH) -lhvfs $(LFLAGS)
clean :
-@rm -rf $(TEST_XNET_SOURCE:.c=.o)
View
14 test/xnet/client.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-06-02 04:16:20 macan>
+ * Time-stamp: <2012-05-18 11:59:52 macan>
*
* 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
@@ -2536,7 +2536,7 @@ int main(int argc, char *argv[])
int op;
char *value;
char *ring_ip = NULL;
- char profiling_fname[256];
+ char profiling_fname[256], *log_home;
hvfs_info(xnet, "EV: range_begin (d) range_end (d)\n");
hvfs_info(xnet, "op: 0/1/2/3/4/5/100/200 => "
@@ -2565,6 +2565,11 @@ int main(int argc, char *argv[])
mode = atoi(value);
} else
mode = 0;
+ value = getenv("LOG_DIR");
+ if (value) {
+ log_home = strdup(value);
+ } else
+ log_home = NULL;
value = getenv("range_begin");
if (value) {
range_begin = atoi(value);
@@ -2617,8 +2622,11 @@ int main(int argc, char *argv[])
// SET_TRACING_FLAG(xnet, HVFS_DEBUG);
/* setup the profiling file */
+ if (!log_home)
+ log_home = ".";
+
memset(profiling_fname, 0, sizeof(profiling_fname));
- sprintf(profiling_fname, "./CP-BACK-client.%d", self);
+ sprintf(profiling_fname, "%s/CP-BACK-client.%d", log_home, self);
hmo.conf.pf_file = fopen(profiling_fname, "w+");
if (!hmo.conf.pf_file) {
hvfs_err(xnet, "fopen() profiling file %s failed %d\n",
View
14 test/xnet/client_lat.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-06-16 06:35:56 macan>
+ * Time-stamp: <2012-05-18 11:59:58 macan>
*
* 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
@@ -2649,7 +2649,7 @@ int main(int argc, char *argv[])
int op;
char *value;
char *ring_ip = NULL;
- char profiling_fname[256];
+ char profiling_fname[256], *log_home;
hvfs_info(xnet, "EV: range_begin (d) range_end (d)\n");
hvfs_info(xnet, "op: 0/1/2/3/4/5/100/200 => "
@@ -2678,6 +2678,11 @@ int main(int argc, char *argv[])
mode = atoi(value);
} else
mode = 0;
+ value = getenv("LOG_DIR");
+ if (value) {
+ log_home = strdup(value);
+ } else
+ log_home = NULL;
value = getenv("range_begin");
if (value) {
range_begin = atoi(value);
@@ -2730,8 +2735,11 @@ int main(int argc, char *argv[])
// SET_TRACING_FLAG(xnet, HVFS_DEBUG);
/* setup the profiling file */
+ if (!log_home)
+ log_home = ".";
+
memset(profiling_fname, 0, sizeof(profiling_fname));
- sprintf(profiling_fname, "./CP-BACK-client.%d", self);
+ sprintf(profiling_fname, "%s/CP-BACK-client.%d", log_home, self);
hmo.conf.pf_file = fopen(profiling_fname, "w+");
if (!hmo.conf.pf_file) {
hvfs_err(xnet, "fopen() profiling file %s failed %d\n",
View
17 test/xnet/mds.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-06-29 05:18:13 macan>
+ * Time-stamp: <2012-05-18 11:59:35 macan>
*
* 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
@@ -1105,7 +1105,7 @@ int main(int argc, char *argv[])
int memonly, memlimit, mode, plot_method;
char *value;
char *ring_ip = NULL;
- char profiling_fname[256];
+ char profiling_fname[256], *log_home;
hvfs_info(xnet, "MDS Unit Testing...\n");
hvfs_info(xnet, "Mode is 0/1 (no ring/with ring)\n");
@@ -1154,6 +1154,12 @@ int main(int argc, char *argv[])
} else
plot_method = MDS_PROF_PLOT;
+ value = getenv("LOG_DIR");
+ if (value) {
+ log_home = strdup(value);
+ } else
+ log_home = NULL;
+
st_init();
mds_pre_init();
hmo.prof.xnet = &g_xnet_prof;
@@ -1191,9 +1197,12 @@ int main(int argc, char *argv[])
sport = port[TYPE_MDS][0];
}
- /* setup the profiling file */
+ /* setup home and the profiling file */
+ if (!log_home)
+ log_home = ".";
+
memset(profiling_fname, 0, sizeof(profiling_fname));
- sprintf(profiling_fname, "./CP-BACK-mds.%d", self);
+ sprintf(profiling_fname, "%s/CP-BACK-mds.%d", log_home, self);
hmo.conf.pf_file = fopen(profiling_fname, "w+");
if (!hmo.conf.pf_file) {
hvfs_err(xnet, "fopen() profiling file %s faield %d\n",
View
15 test/xnet/mdsl.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-06-17 09:09:27 macan>
+ * Time-stamp: <2012-05-18 11:59:46 macan>
*
* 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
@@ -520,7 +520,7 @@ int main(int argc, char *argv[])
int self, sport = -1, i, j, mode, plot_method;
char *value;
char *ring_ip = NULL;
- char profiling_fname[256];
+ char profiling_fname[256], *log_home;
hvfs_info(xnet, "MDSL Unit Testing...\n");
hvfs_info(xnet, "Usage %s id ring_ip self_port\n", argv[0]);
@@ -558,6 +558,12 @@ int main(int argc, char *argv[])
} else
plot_method = MDSL_PROF_PLOT;
+ value = getenv("LOG_DIR");
+ if (value) {
+ log_home = strdup(value);
+ } else
+ log_home = NULL;
+
st_init();
mdsl_pre_init();
hmo.conf.prof_plot = plot_method;
@@ -594,8 +600,11 @@ int main(int argc, char *argv[])
}
/* setup the profiling file */
+ if (!log_home)
+ log_home = ".";
+
memset(profiling_fname, 0, sizeof(profiling_fname));
- sprintf(profiling_fname, "./CP-BACK-mdsl.%d", self);
+ sprintf(profiling_fname, "%s/CP-BACK-mdsl.%d", log_home, self);
hmo.conf.pf_file = fopen(profiling_fname, "w+");
if (!hmo.conf.pf_file) {
hvfs_err(xnet, "fopen() profiling file %s faield %d\n",
View
16 test/xnet/root.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-04-26 16:39:07 macan>
+ * Time-stamp: <2012-05-17 09:57:03 macan>
*
* 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
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
};
int err = 0, i, j;
int self, sport = -1, mode, do_create;
- char profiling_fname[256];
+ char profiling_fname[256], *root_home;
char *value;
char *conf_file;
struct sockaddr_in sin = {
@@ -177,12 +177,22 @@ int main(int argc, char *argv[])
} else
do_create = 0;
+ value = getenv("root_home");
+ if (value) {
+ root_home = strdup(value);
+ }
+ else
+ root_home = NULL;
+
st_init();
root_pre_init();
/* setup the profiling file */
+ if (!root_home)
+ root_home = HVFS_ROOT_HOME;
+
memset(profiling_fname, 0, sizeof(profiling_fname));
- sprintf(profiling_fname, "./CP-BACK-root.%d", self);
+ sprintf(profiling_fname, "%s/CP-BACK-root.%d", root_home, self);
hro.conf.profiling_file = strdup(profiling_fname);
hro.conf.prof_plot = ROOT_PROF_PLOT;
View
6 xnet/xnet_simple.c
@@ -3,7 +3,7 @@
* <macan@ncic.ac.cn>
*
* Armed with EMACS.
- * Time-stamp: <2011-10-13 12:34:26 macan>
+ * Time-stamp: <2012-05-18 11:37:37 macan>
*
* 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
@@ -1161,7 +1161,9 @@ struct xnet_context *xnet_register_type(u8 type, u16 port, u64 site_id,
err = setrlimit(RLIMIT_NOFILE, &rli);
if (err) {
hvfs_err(xnet, "setrlimit failed w/ %s\n", strerror(errno));
- return ERR_PTR(-errno);
+ hvfs_warning(xnet, "%sXNET has FD limit! To overcome this limit, "
+ "please use a powerful UID to run this process.%s\n",
+ HVFS_COLOR_RED, HVFS_COLOR_END);
}
xc = xzalloc(sizeof(*xc));
Please sign in to comment.
Something went wrong with that request. Please try again.