[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/server: lookup.sm
precreate-pool-refiller.sm pvfs2-server.c pvfs2-server.h setparam.sm
CVS commit program
cvs at parl.clemson.edu
Tue Jun 24 11:02:13 EDT 2008
Update of /projects/cvsroot/pvfs2-1/src/server
In directory parlweb1:/tmp/cvs-serv6835/src/server
Modified Files:
Tag: small-file-branch
lookup.sm precreate-pool-refiller.sm pvfs2-server.c
pvfs2-server.h setparam.sm
Log Message:
reverse merge latest trunk changes to small-file-branch and update msgpair
usage where needed
Index: lookup.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/lookup.sm,v
diff -p -u -r1.56.6.1 -r1.56.6.2
--- lookup.sm 21 Feb 2008 02:10:21 -0000 1.56.6.1
+++ lookup.sm 24 Jun 2008 15:02:11 -0000 1.56.6.2
@@ -412,7 +412,8 @@ static PINT_sm_action lookup_check_acls_
js_p,
&i,
server_job_context);
- return SM_ACTION_COMPLETE;
+
+ return ret;
}
/*
Index: precreate-pool-refiller.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/Attic/precreate-pool-refiller.sm,v
diff -p -u -r1.1.2.11 -r1.1.2.12
--- precreate-pool-refiller.sm 26 Feb 2008 19:57:52 -0000 1.1.2.11
+++ precreate-pool-refiller.sm 24 Jun 2008 15:02:12 -0000 1.1.2.12
@@ -161,15 +161,16 @@ static PINT_sm_action setup_batch_create
s_op->u.precreate_pool_refiller.host,
llu(s_op->u.precreate_pool_refiller.pool_handle));
- PINT_init_msgpair(s_op, msg_p);
+ PINT_msgpair_init(&s_op->msgarray_op);
+ msg_p = &s_op->msgarray_op.msgpair;
/* note: we are acting like a client in this case, so use client timeout
* and delay values
*/
- s_op->msgarray_params.job_timeout = user_opts->client_job_bmi_timeout;
- s_op->msgarray_params.retry_delay = user_opts->client_retry_delay_ms;
- s_op->msgarray_params.retry_limit = user_opts->client_retry_limit;
- s_op->msgarray_params.quiet_flag = 1;
+ s_op->msgarray_op.params.job_timeout = user_opts->client_job_bmi_timeout;
+ s_op->msgarray_op.params.retry_delay = user_opts->client_retry_delay_ms;
+ s_op->msgarray_op.params.retry_limit = user_opts->client_retry_limit;
+ s_op->msgarray_op.params.quiet_flag = 1;
msg_p->svr_addr = s_op->u.precreate_pool_refiller.host_addr;
PINT_util_gen_credentials(&creds);
@@ -187,6 +188,7 @@ static PINT_sm_action setup_batch_create
msg_p->retry_flag = PVFS_MSGPAIR_RETRY;
msg_p->comp_fn = batch_create_comp_fn;
+ PINT_sm_push_frame(smcb, 0, &s_op->msgarray_op);
js_p->error_code = 0;
return(SM_ACTION_COMPLETE);
}
@@ -255,7 +257,7 @@ static int batch_create_comp_fn(void *v_
int index)
{
PINT_smcb *smcb = v_p;
- struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_FRAME_CURRENT);
+ struct PINT_server_op *s_op = PINT_sm_frame(smcb, PINT_MSGPAIR_PARENT_SM);
int i;
gossip_debug(GOSSIP_SERVER_DEBUG, "batch_create_comp_fn\n");
Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/pvfs2-server.c,v
diff -p -u -r1.246.6.14 -r1.246.6.15
--- pvfs2-server.c 17 Jun 2008 15:08:46 -0000 1.246.6.14
+++ pvfs2-server.c 24 Jun 2008 15:02:12 -0000 1.246.6.15
@@ -219,11 +219,12 @@ int main(int argc, char **argv)
/* code to handle older two config file format */
ret = PINT_parse_config(&server_config, fs_conf, s_server_options.server_alias);
- if (ret < 0)
+ if (ret)
{
gossip_err("Error: Please check your config files.\n");
gossip_err("Error: Server aborting.\n");
free(s_server_options.server_alias);
+ ret = -PVFS_EINVAL;
goto server_shutdown;
}
Index: pvfs2-server.h
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/pvfs2-server.h,v
diff -p -u -r1.147.8.21 -r1.147.8.22
--- pvfs2-server.h 5 Jun 2008 18:10:45 -0000 1.147.8.21
+++ pvfs2-server.h 24 Jun 2008 15:02:12 -0000 1.147.8.22
@@ -32,12 +32,6 @@
#include "pvfs2-req-proto.h"
#include "state-machine.h"
-/* skip everything except #includes if __SM_CHECK_DEP is already
- * defined; this allows us to get the dependencies right for
- * msgpairarray.sm which relies on conflicting headers for dependency
- * information
- */
-#ifndef __SM_CHECK_DEP
extern job_context_id server_job_context;
#define PVFS2_SERVER_DEFAULT_TIMEOUT_MS 100
@@ -446,13 +440,7 @@ typedef struct PINT_server_op
struct PINT_encoded_msg encoded;
struct PINT_decoded_msg decoded;
- /* generic msgpair used with msgpair substate */
- PINT_sm_msgpair_state msgpair;
-
- /* state information for msgpairarray nested state machine */
- int msgarray_count;
- PINT_sm_msgpair_state *msgarray;
- PINT_sm_msgpair_params msgarray_params;
+ PINT_sm_msgarray_op msgarray_op;
PVFS_handle target_handle;
PVFS_fs_id target_fs_id;
@@ -550,7 +538,6 @@ int server_state_machine_start_noreq(
struct PINT_state_machine_s *server_op_state_get_machine(int);
-#endif /* __SM_CHECK_DEP */
#endif /* __PVFS_SERVER_H */
/*
Index: setparam.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/server/setparam.sm,v
diff -p -u -r1.33.6.5 -r1.33.6.6
--- setparam.sm 7 Apr 2008 15:07:42 -0000 1.33.6.5
+++ setparam.sm 24 Jun 2008 15:02:12 -0000 1.33.6.6
@@ -15,9 +15,11 @@
#include "pvfs2-server.h"
#include "pint-event.h"
#include "pvfs2-internal.h"
+#include "gossip.h"
#include "request-scheduler/request-scheduler.h"
static int check_fs_id(PVFS_fs_id fs_id);
+static int drop_caches(void);
%%
@@ -163,6 +165,9 @@ static PINT_sm_action setparam_work(
js_p->error_code = 0;
return ret;
+ case PVFS_SERV_PARAM_DROP_CACHES:
+ js_p->error_code = drop_caches();
+ return SM_ACTION_COMPLETE;
}
gossip_lerr("Error: mgmt_setparam for unknown parameter %d.\n",
@@ -259,10 +264,48 @@ struct PINT_server_req_params pvfs2_setp
.string_name = "mgmt_setparam",
.perm = PINT_SERVER_CHECK_NONE,
.access_type = PINT_server_req_modify,
- .sched_policy = PINT_SERVER_REQ_SCHEDULE,
.get_object_ref = PINT_get_object_ref_setparam,
.state_machine = &pvfs2_setparam_sm
};
+
+/* drop_caches()
+ *
+ * Linux specific, but should fail cleanly on other platforms.
+ *
+ * This function asks the operating system to sync and drop any in memory
+ * caches that it may have. Applies globally to all file systems on the
+ * server, not just the PVFS storage space.
+ */
+static int drop_caches(void)
+{
+ int fd;
+ int ret;
+
+ /* try to commit buffer cache first */
+ sync();
+
+ /* open Linux specific control file if present */
+ fd = open("/proc/sys/vm/drop_caches", O_WRONLY);
+ if(fd < 0)
+ {
+ gossip_debug(GOSSIP_SERVER_DEBUG,
+ "Warning: drop_caches not supported.\n");
+ return(-PVFS_EOPNOTSUPP);
+ }
+
+ /* free page cache, dentries, and inodes */
+ ret = write(fd, "3", 2);
+ if(ret < 0)
+ {
+ gossip_debug(GOSSIP_SERVER_DEBUG,
+ "Warning: found drop_caches file but failed to write to it.\n");
+ close(fd);
+ return(-PVFS_EOPNOTSUPP);
+ }
+
+ close(fd);
+ return(0);
+}
/*
* Local variables:
More information about the Pvfs2-cvs
mailing list