[SSI] openssi/kernel/cluster/ssi/cfs cfsproc.c, 1.38, 1.39 cfstok.c, 1.26, 1.27 svrcfs.c, 1.30, 1.31
Roger Tsang <[email protected]> Wed, 15 Dec 2010 07:08:44 +0000
| Newsgroups | gmane.linux.cluster.ssic.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv14448/kernel/cluster/ssi/cfs
Modified Files:
Tag: OPENSSI-FC
cfsproc.c cfstok.c svrcfs.c
Log Message:
- remove up to two redundant cfstokargs structures from the stack. reduce stack usage in cfstok_msg() path.
- reduce unnecessary de-serialization / re-serialization of cfstokargs structure when client@server.
include/cluster/ssi/cfs/cfstok.h
- __init_cfstokargs: create based on cfs_tokmsg_seq().
cluster/ssi/cfs/cfstok.c
- cfstok_send: use __init_cfstokargs()
cluster/ssi/cfs/cfsproc.c
cluster/ssi/cfs/svrcfs.c
- cfstok_msg: revise function declaration. reduce number of arguments to one, pointer to cfstokargs structure.
- _cfs_tokmsg: removed. use cfs_tokmsg() instead.
- cfs_tokmsg_seq: removed. eliminate yet another cfstokargs structure from the stack.
- _cfs_tokmsg_seq: renamed to cfs_tokmsg_seq().
- svrcfstok_send: use __init_cfstokargs()
- cfstok_fail_noip: revise function declaration. reduce number of arguments to one, pointer to cfstokargs structure. eliminate yet another cfstokargs structure from the stack.
include/cluster/ssi/cfs/cfs_fs.h
include/cluster/ssi/cfs/cfsfh.h
- No need to include header file cluster/ssi/cfs/cfstok.h
cluster/ssi/cfs/cfsproc.c | 4
cluster/ssi/cfs/cfstok.c | 71 +----
cluster/ssi/cfs/svrcfs.c | 415 +++++++++++++------------------
include/cluster/ssi/cfs/cfs_fs.h | 1
include/cluster/ssi/cfs/cfsfh.h | 1
include/cluster/ssi/cfs/cfstok.h | 20 -
6 files changed, 207 insertions(+), 305 deletions(-)
Index: svrcfs.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/svrcfs.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- svrcfs.c 25 Oct 2010 04:43:26 -0000 1.30
+++ svrcfs.c 15 Dec 2010 07:08:42 -0000 1.31
@@ -696,105 +696,13 @@
#endif /* !RCU_CFSTOK_TABLE */
}
-void
-_cfs_tokmsg(struct cfstokargs *args)
-{
- cfs_tokmsg(&(args->cta_fhandle), args->cta_type,
- args->cta_op, args->cta_oldmode, args->cta_newmode,
- args->cta_agent,
- args->cta_start, args->cta_len,
- 0, 0,
- 0, args->cta_seq, args->cta_fromnode,
- &args->cta_attr);
-}
-
-void
-_cfs_tokmsg_seq(struct cfstokargs *args)
-{
- if (args->cta_op == GIVEBACK || args->cta_op == INSTALL ||
- args->cta_op == HINT)
- _cfs_tokmsg(args);
- else
- /* See if we should process now or let others run the queue */
- tokseq_accept(cfs_tsp, args->cta_fromnode,
- args->cta_seq, (void *)_cfs_tokmsg, args, sizeof(*args),
- NULL, NULL);
-}
-
-void
-cfs_tokmsg_seq(
- cfhandle_t *fhp,
- int type,
- int op,
- int oldmode,
- int newmode,
- agent_t agent,
- range_off_t start,
- range_off_t len,
-#ifdef SSI_CFS_POLICY
- tokflgs flags,
-#else
- int unused,
-#endif
- int mask,
- u_long delta,
- int seq,
- clusternode_t fromnode,
- struct cfs_fattr *attr)
-{
- struct cfstokargs args;
-
-#ifdef CFS_EXPORT_OPS
- COPY_CFS_FH(&args.cta_fhandle, fhp);
-#else
- args.cta_fhandle = *fhp;
-#endif
- args.cta_type = type;
- args.cta_op = op;
- args.cta_oldmode = oldmode;
- args.cta_newmode = newmode;
- args.cta_agent = agent;
- args.cta_start = start;
- args.cta_len = len;
-#ifdef SSI_CFS_POLICY
- args.cta_tokflags = flags;
- args.cta_tokmask = mask;
- args.cta_delta = delta;
-#endif
- args.cta_seq = seq;
- args.cta_fromnode = fromnode;
- /* SSI_XXX: For now ignore if attr not specified (client) */
- if (attr)
- args.cta_attr = *attr;
-
- _cfs_tokmsg_seq(&args);
-}
-
/*
* Process a token message at servers and clients. At this point sequencing
* must already be handled.
*
*/
void
-cfs_tokmsg(
- cfhandle_t *fhp,
- int type,
- int op,
- int oldmode,
- int newmode,
- agent_t agent,
- range_off_t start,
- range_off_t len,
-#ifdef SSI_CFS_POLICY
- tokflgs flags,
-#else
- int unused,
-#endif
- int mask,
- u_long delta,
- int seq, /* NOT USED */
- clusternode_t fromnode,
- struct cfs_fattr *attr)
+cfs_tokmsg(struct cfstokargs *args)
{
struct svrcfstok *hp;
struct inode *ip = NULL;
@@ -805,16 +713,22 @@
#if defined(DEBUG) || defined(SIMUL)
char str[DBGSTRLEN];
#endif
+ tokflgs flags = args->cta_tokflags,
+ int mask = args->cta_tokmask;
+ u_long delta = args->cta_delta;
+#endif
+#ifdef SSI_NOTUSED
+ int seq = args->cta_seq; /* NOT USED */
#endif
- if (op == 0) {
+ if (args->cta_op == 0) {
#ifdef DEBUG
printk("cfs_tokmsg: token flushed\n");
#endif
return;
}
- if (op & CFSCLI) {
+ if (args->cta_op & CFSCLI) {
/* The new tokens can differentiate between GIVEBACK and
* RETURN. We would not clean up data structures if a
* REVOKE and GIVEBACK crossed. The server layer will
@@ -823,19 +737,22 @@
*/
/* Find existing hash structure */
#ifdef RCU_CFSTOK_TABLE
- hp = hfind(fhp);
+ hp = hfind(&args->cta_fhandle);
#else
- hp = svrtok_lookup(fhp, NULL, NULL);
+ hp = svrtok_lookup(&args->cta_fhandle, NULL, NULL);
#endif
+#ifndef RCU_MSGSUP_HASH
/* SSI_XXX: At the moment, it is possible
for this to fail if it is a GIVEBACK on
a down filesystem. */
- SSI_ASSERT(hp || op == GIVEBACK);
+ SSI_ASSERT(hp || args->cta_op == GIVEBACK);
+#endif
/* Return if token structure not found. */
- if (hp == NULL) {
+ if (unlikely(hp == NULL)) {
/* This can cause lost tokens so we warn */
- printk("cfs_tokmsg: Dropped client op %d ino %d\n",
- op, ((__u32 *)fhp)[3]);
+ printk(KERN_ERR "%s: Dropped client op %d ino %d\n",
+ __FUNCTION__, args->cta_op,
+ ((__u32 *)&args->cta_fhandle)[3]);
return;
}
@@ -843,22 +760,28 @@
dprintk(
"cfs_tokmsg: %s type %d op %d from:%s to:%s agent %x start %Ld len %Ld\n",
(hp->sct_dp->d_name.name ? hp->sct_dp->d_name.name : ""),
- type, op, mstr(NULL, oldmode), mstr(NULL, newmode), agent, start, len);
+ args->cta_type, args->cta_op, mstr(NULL, args->cta_oldmode),
+ mstr(NULL, args->cta_newmode), args->cta_agent, args->cta_start,
+ args->cta_len);
#endif
- switch(op) {
+ /* NB: might acquire TCB lock */
+ switch(args->cta_op) {
case REQUEST:
- svrcfstok_request_range(hp, type, oldmode, newmode,
- agent, start, len);
+ svrcfstok_request_range(hp, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent, args->cta_start, args->cta_len);
break;
case GIVEBACK:
/* SSI_XXX: Handling incoming attributes */
- svrcfstok_giveback_range(hp, type, oldmode,
- newmode, agent, start, len);
+ svrcfstok_giveback_range(hp, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent, args->cta_start, args->cta_len);
break;
case RETURN:
/* SSI_XXX: Handling incoming attributes */
- svrcfstok_return_range(hp, type, oldmode, newmode,
- agent, start, len);
+ svrcfstok_return_range(hp, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent, args->cta_start, args->cta_len);
break;
case REVFAIL:
/* If client at server sent REVFAIL to self then,
@@ -869,23 +792,27 @@
* prevent looping at client at server or
* bogus REVFAILs from clients.
*/
- if (agent == this_node) {
+ if (args->cta_agent == this_node) {
/* Let other threads run before retrying. */
NSC_YIELD();
}
- svrcfstok_revfail_range(hp, type, oldmode, newmode,
- agent, start, len);
+ svrcfstok_revfail_range(hp, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent, args->cta_start, args->cta_len);
break;
#ifdef SSI_CFS_FULLTIMES
case QRYRET:
- if (type == CFSTOK_MTIME)
+ if (args->cta_type == CFSTOK_MTIME)
cfs_putmtime(hp, mtime, ctime, resv);
- if (type == CFSTOK_ATIME)
+ if (args->cta_type == CFSTOK_ATIME)
cfs_putatime(hp, atime);
- svrcfstok_queryret(hp, type, oldmode, newmode, agent);
+ svrcfstok_queryret(hp, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_agent);
break;
case QRYFAIL:
- svrcfstok_queryfail(hp, type, oldmode, newmode, agent);
+ svrcfstok_queryfail(hp, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent);
break;
#endif
#ifdef CFS_POLICY
@@ -893,7 +820,7 @@
/* Don't do anything, we just want to run the
* policy code below.
*/
- hints = oldmode; /* Overloaded oldmode field */
+ hints = args->cta_oldmode; /* Overloaded oldmode field */
/* Make client look active even though he doesn't
* have open counts incremented yet, so that
* the policy code below will give him tokens.
@@ -905,19 +832,21 @@
break;
#endif
case HAVE:
- SSI_ASSERT(oldmode == TOK_NOMODE);
- ret = svrcfstok_getinstall_range(hp, type, newmode,
- agent, &prevmode, start, len);
+ SSI_ASSERT(args->cta_oldmode == TOK_NOMODE);
+ ret = svrcfstok_getinstall_range(hp, args->cta_type,
+ args->cta_newmode, args->cta_agent, &prevmode,
+ args->cta_start, args->cta_len);
SSI_ASSERT(ret);
SSI_ASSERT(prevmode == TOK_NOMODE);
break;
default:
printk("cfs_tokmsg: op %d type %d from:%d to:%d agent %d\n",
- op, type, oldmode, newmode, agent);
+ args->cta_op, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_agent);
panic("cfs_tokmsg: bad operation");
}
#ifdef CFS_POLICY
- cfspol_setcli(hp, CFSPOL_TOKEN, agent, flags, delta);
+ cfspol_setcli(hp, CFSPOL_TOKEN, args->cta_agent, flags, delta);
/* Let policy code send async token installs */
/*
* SSI_XXX: Do I need another flag if for op == HINT I want
@@ -927,20 +856,21 @@
#ifndef CFS_FASTPATH
#error mask is not known when fast path disabled
#endif
- if (agent != this_node && (op == HINT || op == REQUEST))
- cfspol_server(hp, agent, hints, mask, NULL);
- if (op == HINT) {
+ if (args->cta_agent != this_node &&
+ (args->cta_op == HINT || args->cta_op == REQUEST))
+ cfspol_server(hp, args->cta_agent, hints, mask, NULL);
+ if (args->cta_op == HINT) {
int seq;
DEFINE_SVROBJ(obj, 0);
- seq = tokseq_getseq(cfs_tsp, agent, "cfs_tokmsg",
+ seq = tokseq_getseq(cfs_tsp, args->cta_agent, "cfs_tokmsg",
"HINTDONE");
svrcfstok_hold_obj(&obj);
dprintk("SVR S hintdone %s %d id 0x%x seq 0x%x\n",
- DSPOBJ(&obj, str), agent, newmode, seq);
+ DSPOBJ(&obj, str), args->cta_agent, args->cta_newmode, seq);
svrcfstok_send(&obj, seq, HINTDONE, 0,
- newmode /* id */, agent, 0, 0);
+ args->cta_newmode /* id */, args->cta_agent, 0, 0);
}
#endif
HASH_RELE(hp);
@@ -952,19 +882,25 @@
* (Its marginally evil for these calls to be here in a
* server module, but the incoming messages ARE being served).
*/
- ip = clifhtoip(fhp);
+ ip = clifhtoip(&args->cta_fhandle);
/* WIERD CASE: revoke comes in for a inode we just
* spontaneously sent all tokens back for
*/
- if (ip == NULL &&
- (op == REVOKE || op == QUERY || op== INSTALL)) {
- cfstok_fail_noip(fhp, op, type, oldmode,
- newmode, agent, start, len, fromnode);
- return;
+ if (unlikely(ip == NULL)) {
+ switch (args->cta_op) {
+ case REVOKE:
+#ifdef SSI_CFS_FULLTIMES
+ case QUERY:
+#endif
+ case INSTALL:
+ /* NB: client@server might be re-entrant */
+ cfstok_fail_noip(args);
+ return;
+ default:
+ /* Can't find inode for REQUEST */
+ panic("cfs_tokmsg: Can't find client inode!");
+ }
}
- /* Can't find inode for REQUEST */
- if (ip == NULL)
- panic("cfs_tokmsg: Can't find client inode!");
#ifdef SSI_CFS_SKIP
dprintk(
"cfs_tokmsg: %s type %d op %d from:%s to:%s agent %x start %Ld len %Ld\n",
@@ -972,15 +908,22 @@
(itoc(ip)->c_hp->sct_dp->d_name.name ? itoc(ip)->c_hp->sct_dp->d_name.name : "")
:
(itoc(ip)->c_filename ? itoc(ip)->c_filename : "")),
- type, op, mstr(NULL, oldmode), mstr(NULL, newmode), agent, start, len);
+ args->cta_type, args->cta_op, mstr(NULL, args->cta_oldmode),
+ mstr(NULL, args->cta_newmode), args->cta_agent, args->cta_start,
+ args->cta_len);
#endif
- switch(op) {
+ /* NB: might acquire CFSTOK_XLOCK */
+ switch(args->cta_op) {
case GRANT:
- cfs_refresh_inode(ip, attr);
- cfstok_grant(ip, type, oldmode, newmode, start, len);
+ cfs_refresh_inode(ip, &args->cta_attr);
+ cfstok_grant(ip, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_start,
+ args->cta_len);
break;
case REVOKE:
- cfstok_revoke(ip, type, oldmode, newmode, start, len);
+ cfstok_revoke(ip, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_start,
+ args->cta_len);
break;
case REQFAIL:
/* If client at server sent REQFAIL to self then,
@@ -995,33 +938,59 @@
/* Let other threads run before retrying. */
NSC_YIELD();
}
- cfstok_reqfail(ip, type, oldmode, newmode, start, len);
+ cfstok_reqfail(ip, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_start,
+ args->cta_len);
break;
case INSTALL:
- cfstok_install_one(ip, type, oldmode, newmode, agent, start, len, TRUE);
+ cfstok_install_one(ip, args->cta_type,
+ args->cta_oldmode, args->cta_newmode,
+ args->cta_agent, args->cta_start,
+ args->cta_len, TRUE);
break;
#ifdef SSI_CFS_NOTUSED
case QUERY:
- cfstok_svrquery(ip, type, oldmode, newmode, agent);
+ cfstok_svrquery(ip, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_agent);
break;
case HINTDONE:
- callback_wakeup(newmode /* id */, NULL, 0);
+ callback_wakeup(args->cta_newmode /* id */, NULL, 0);
break;
#endif
default:
- printk("cfs_tokmsg: op %d type %d from:%d to:%d agent %d\n",
- op, type, oldmode, newmode, agent);
+ printk(KERN_EMERG "cfs_tokmsg: op %d type %d "
+ "from:%d to:%d agent %d\n",
+ args->cta_op, args->cta_type, args->cta_oldmode,
+ args->cta_newmode, args->cta_agent);
panic("cfs_tokmsg: bad operation");
}
#ifdef CFS_POLICY
cfspol_setsvrflgs(ip, flags);
- cfspol_client(ip, op, type, newmode);
+ cfspol_client(ip, args->cta_op,
+ args->cta_type, args->cta_newmode);
#endif
iput(ip);
}
#endif /*__KERNEL__*/
}
+void
+cfs_tokmsg_seq(struct cfstokargs *args)
+{
+ switch (args->cta_op) {
+ case GIVEBACK:
+ case INSTALL:
+ case HINT:
+ cfs_tokmsg(args);
+ break;
+ default:
+ /* See if we should process now or let others run the queue */
+ tokseq_accept(cfs_tsp, args->cta_fromnode,
+ args->cta_seq, (void *)cfs_tokmsg, args, sizeof(*args),
+ NULL, NULL);
+ }
+}
+
#ifdef __KERNEL__
int
svrcfstok_target(
@@ -1060,57 +1029,42 @@
{
struct cfstokargs ctargs;
struct svrcfstok *hp;
- int type;
- cfhandle_t *fhp;
nsc_handle_t *th;
int prio;
int error;
- /* Get needed stuff out of object_t */
hp = (struct svrcfstok *)objp->word1;
- fhp = &(hp->sct_fh);
- type = (int)objp->word2;
-
- /* If agent (client) is local, then call directly */
- if (this_node == (clusternode_t)agent) {
- struct cfs_fattr fattr;
- cfsd_getattr(hp, &fattr);
-
- if (op != INSTALL)
- cfs_tokmsg_seq(fhp, type, op, oldmode, newmode, agent,
- start, len,
- cfspol_getsvrflgs(hp), 0, 0,
- seq, this_node, &fattr);
- else
- cfs_tokmsg(fhp, type, op, oldmode, newmode, agent,
- start, len,
- cfspol_getsvrflgs(hp), 0, 0,
- 0, this_node, &fattr);
- HASH_RELE(hp); /* undo HOLDOBJ() */
- return 0;
- }
#ifdef CFS_EXPORT_OPS
- COPY_CFS_FH(&ctargs.cta_fhandle, fhp);
+ COPY_CFS_FH(&ctargs.cta_fhandle, &hp->sct_fh);
#else
- ctargs.cta_fhandle = *fhp;
+ ctargs.cta_fhandle = hp->sct_fh;
#endif
ctargs.cta_agent = agent;
ctargs.cta_op = op;
- ctargs.cta_type = type;
+ ctargs.cta_type = (int)objp->word2; /* type */
ctargs.cta_oldmode = oldmode;
ctargs.cta_newmode = newmode;
ctargs.cta_start = start;
ctargs.cta_len = len;
+#ifdef SSI_CFS_POLICY
+ ctargs.cta_tokflags = cfspol_getsvrflgs(hp);
+ ctargs.cta_tokmask = 0; /* N/A */
+ ctargs.cta_delta = 0; /* N/A */
+#endif
ctargs.cta_seq = seq;
ctargs.cta_fromnode = this_node;
+
cfsd_getattr(hp, &ctargs.cta_attr);
-#ifdef SSI_CFS_POLICY
- ctargs.cta_tokflags = cfspol_getsvrflgs(hp);
- ctargs.cta_tokmask = 0; /* N/A */
- ctargs.cta_delta = 0; /* N/A */
-#endif
+ /* If agent (client) is local, then call directly */
+ if (this_node == (clusternode_t)agent) {
+ if (op != INSTALL)
+ cfs_tokmsg_seq(&ctargs);
+ else
+ cfs_tokmsg(&ctargs);
+ goto out;
+ }
prio = ics_getpriority();
if (prio == 0)
@@ -1129,7 +1083,7 @@
if (error)
printk(KERN_WARNING "svrcfstok_send: nsc_rcall error %d\n", error);
#endif
-
+out:
HASH_RELE(hp); /* undo HOLDOBJ() */
return 0;
}
@@ -1710,81 +1664,70 @@
* sent the tokens back.
*/
void
-cfstok_fail_noip(
- cfhandle_t *fhp,
- int op,
- int type,
- int oldmode,
- int newmode,
- agent_t agent,
- range_off_t start,
- range_off_t len,
- clusternode_t server)
+cfstok_fail_noip(struct cfstokargs *args)
{
- struct cfstokargs ctargs;
nsc_handle_t *th;
+ clusternode_t server = args->cta_fromnode;
int prio;
- SSI_ASSERT(op == REVOKE || op == QUERY || op == INSTALL);
+ SSI_ASSERT(args->cta_op == REVOKE ||
+ args->cta_op == QUERY || args->cta_op == INSTALL);
-#ifdef CFS_EXPORT_OPS
- COPY_CFS_FH(&ctargs.cta_fhandle, fhp);
-#else
- ctargs.cta_fhandle = *fhp;
-#endif
- ctargs.cta_agent = agent;
- switch(op) {
+ switch (args->cta_op) {
case REVOKE:
- dprintk(
- "CLI S revfail NOIP start: 0x%Lx end: 0x%Lx %d from:%s to:%s\n",
- (long long)start, (long long)start + len,
- agent, mstr(NULL,oldmode),mstr(NULL,newmode));
- ctargs.cta_op = REVFAIL;
- ctargs.cta_oldmode = oldmode;
- ctargs.cta_newmode = newmode;
- ctargs.cta_seq = tokseq_getseq(cfs_tsp, server,
- "cfstok_fail_noip", "REVFAIL");
+ dprintk("CLI S revfail NOIP start: 0x%Lx end: 0x%Lx %d "
+ "from:%s to:%s\n", (long long)args->cta_start,
+ (long long)args->cta_start + args->cta_len,
+ args->cta_agent, mstr(NULL, args->cta_oldmode),
+ mstr(NULL, args->cta_newmode));
+ args->cta_op = REVFAIL;
+ args->cta_seq = tokseq_getseq(cfs_tsp, server,
+ "cfstok_fail_noip", "REVFAIL");
break;
+#ifdef SSI_CFS_FULLTIMES
case QUERY:
- dprintk(
- "CLI S query_fail NOIP start: 0x%Lx end: 0x%Lx %d from:%s to:%s\n",
- (long long)start, (long long)(start + len),
- agent, mstr(NULL,oldmode),mstr(NULL,newmode));
- ctargs.cta_op = QRYFAIL;
- ctargs.cta_oldmode = oldmode;
- ctargs.cta_newmode = newmode;
- ctargs.cta_seq = tokseq_getseq(cfs_tsp, server,
- "cfstok_fail_noip", "QRYFAIL");
+ dprintk("CLI S query_fail NOIP start: 0x%Lx end: 0x%Lx %d "
+ "from:%s to:%s\n", (long long)args->cta_start,
+ (long long)args->cta_start + args->cta_len,
+ args->cta_agent, mstr(NULL, args->cta_oldmode),
+ mstr(NULL, args->cta_newmode));
+ args->cta_op = QRYFAIL;
+ args->cta_seq = tokseq_getseq(cfs_tsp, server,
+ "cfstok_fail_noip", "QRYFAIL");
break;
+#endif
case INSTALL:
- dprintk(
- "CLI S giveback NOIP start: 0x%Lx end: 0x%Lx %d from:%s to:%s (install)\n",
- (long long)start, (long long)(start + len),
- agent, mstr(NULL,newmode), mstr(NULL,oldmode));
- ctargs.cta_op = GIVEBACK;
+ dprintk("CLI S giveback NOIP start: 0x%Lx end: 0x%Lx %d "
+ "from:%s to:%s (install)\n", (long long)args->cta_start,
+ (long long)args->cta_start + args->cta_len,
+ args->cta_agent, mstr(NULL, args->cta_newmode),
+ mstr(NULL, args->cta_oldmode));
+ args->cta_op = GIVEBACK;
/* To undo install giveback modes in reverse */
- ctargs.cta_oldmode = newmode;
- ctargs.cta_newmode = oldmode;
+ {
+ int oldmode = args->cta_oldmode;
+ args->cta_oldmode = args->cta_newmode;
+ args->cta_newmode = oldmode;
+ }
/* GIVEBACKs are not sequenced */
- ctargs.cta_seq = 0;
+ args->cta_seq = 0;
break;
+ default:
+ panic("%s: invalid op %u\n", __FUNCTION__, args->cta_op);
}
- ctargs.cta_type = type;
- ctargs.cta_start = start;
- ctargs.cta_len = len;
- ctargs.cta_fromnode = this_node;
+ args->cta_fromnode = this_node;
/* No hint bits since this node doesn't even have a inode */
#ifdef SSI_CFS_POLICY
- ctargs.cta_tokflags = 0;
- ctargs.cta_delta = -1;
+ args->cta_tokflags = 0;
+ args->cta_delta = -1;
#endif
- if (server == (clusternode_t)agent) {
+ if (server == (clusternode_t)args->cta_agent) {
#ifdef DEBUG
printk(KERN_NOTICE "cfstok_fail_noip: at the server\n");
#endif
- _cfs_tokmsg_seq(&ctargs);
+ cfs_tokmsg_seq(args);
return;
}
@@ -1795,7 +1738,7 @@
/* NOTE: This message has no response */
th = nsc_hcreate(server, cluster_fs_svc, 0, 0);
nsc_rcall(th, CFSD_PROC_TOKMSG, (xdrproc_t)xdr_cfstokargs,
- (caddr_t)&ctargs, (xdrproc_t)xdr_void, (caddr_t)NULL, 0);
+ (caddr_t)args, (xdrproc_t)xdr_void, (caddr_t)NULL, 0);
nsc_hdestroy(th);
if (prio == 0)
Index: cfsproc.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/cfsproc.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cfsproc.c 5 Mar 2010 06:32:49 -0000 1.38
+++ cfsproc.c 15 Dec 2010 07:08:42 -0000 1.39
@@ -1256,7 +1256,7 @@
cfsd_proc_tokmsg_0(struct cfstokargs *args, void *notused)
{
/* Perform message handling */
- _cfs_tokmsg_seq(args);
+ cfs_tokmsg_seq(args);
}
void
@@ -1265,7 +1265,7 @@
SSI_ASSERT(args->cta_op == GIVEBACK);
/* Perform GIVEBACK handling */
- _cfs_tokmsg(args);
+ cfs_tokmsg(args);
*statusp = CFS_OK; /* ignored */
}
Index: cfstok.c
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/cluster/ssi/cfs/cfstok.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- cfstok.c 25 Oct 2010 06:03:52 -0000 1.26
+++ cfstok.c 15 Dec 2010 07:08:42 -0000 1.27
@@ -1579,50 +1579,8 @@
}
}
- /* If agent (client) is local, then call directly */
- if (server == this_node) {
- /* GIVEBACKs are not sequenced */
- if (op != GIVEBACK)
- cfs_tokmsg_seq(fhp, type, op, oldmode, newmode,
- agent, (range_off_t)start, len,
-#ifdef SSI_CFS_POLICY
- cfspol_getcliflgs(ip),
-#else
- 0,
-#endif
-#ifdef CFS_FASTPATH
- itoc(ip)->c_fastpath.fast_mask,
-#else
- 0,
-#endif
-#ifdef SSI_CFS_POLICY
- cfspol_getclidel(ip),
-#else
- 0,
-#endif
- seq, this_node, /* SSI_XXX: attr */ 0 );
- else
- cfs_tokmsg(fhp, type, op, oldmode, newmode,
- agent, (range_off_t)start, len,
-#ifdef SSI_CFS_POLICY
- cfspol_getcliflgs(ip),
-#else
- 0,
-#endif
-#ifdef CFS_FASTPATH
- itoc(ip)->c_fastpath.fast_mask,
-#else
- 0,
-#endif
-#ifdef SSI_CFS_POLICY
- cfspol_getclidel(ip),
-#else
- 0,
-#endif
- 0, this_node, /* SSI_XXX: attr */ 0 );
- goto out;
-
- }
+ /* Send along in case this is a ATTR token RETURN, GIVEBACK or QRYRET */
+ /* SSI_XXX: Load cta_attr attributes from inode */
#ifdef CFS_EXPORT_OPS
COPY_CFS_FH(&ctargs.cta_fhandle, fhp);
#else
@@ -1635,18 +1593,27 @@
ctargs.cta_newmode = newmode;
ctargs.cta_start = start;
ctargs.cta_len = len;
- ctargs.cta_seq = seq;
- ctargs.cta_fromnode = this_node;
- /* Send along in case this is a ATTR token RETURN, GIVEBACK or QRYRET */
- /* SSI_XXX: Load cta_attr attributes from inode */
-
#ifdef SSI_CFS_POLICY
ctargs.cta_tokflags = cfspol_getcliflgs(ip);
- ctargs.cta_delta = cfspol_getclidel(ip);
-#endif
#ifdef CFS_FASTPATH
ctargs.cta_tokmask = itoc(ip)->c_fastpath.fast_mask;
#endif /* CFS_FASTPATH */
+ ctargs.cta_delta = cfspol_getclidel(ip);
+#endif
+ ctargs.cta_seq = seq;
+ ctargs.cta_fromnode = this_node;
+
+ /* If agent (client) is local, then call directly */
+ if (server == this_node) {
+ if (op != GIVEBACK)
+ cfs_tokmsg_seq(&ctargs);
+ else {
+ /* GIVEBACKs are not sequenced */
+ ctargs.cta_seq = 0;
+ cfs_tokmsg(&ctargs);
+ }
+ goto out;
+ }
prio = ics_getpriority();
if (prio == 0)
@@ -2024,6 +1991,7 @@
return 0;
}
+#ifdef SSI_NOTUSED
void
cfstok_install_list(
struct inode *ip,
@@ -2085,6 +2053,7 @@
CFSTOK_XRELE(itoc(ip));
process_msgs(TRUE);
}
+#endif /* SSI_NOTUSED */
void
cfstok_clean(struct inode *ip)
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d