<font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">Hi Alexey/Nicholas/All,</font></font></font><div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br>

</font></font></font></div><div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">I had a look at the 2.0 side of the code and seems like there have been some significant modifications at the MDS side e.g. seems like the request processing part at MDS has been redefined.</font></font></font></div>

<div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></font></div><div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">I need to stick to 1.8.1.1 since my most of the modifications are at the MDS side and the project also demands the same.So I will need to play around with the low-level message packing and unpacking stuff which is pretty complicated from my previous experience.</font></font></font></div>

<div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></font></div><div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">Here is my understanding of the way the request are processed .Please correct me if I am wrong.</font></font></font></div>

<div><span class="Apple-style-span" style="font-family: 'times new roman', serif; color: rgb(51, 51, 255); ">1) Seems like in Lustre code base for each RPC you have a static structure "size" and count defined which defines the way the message would be layed out (after doing all the rounding off operations etc) i.e the offset at which the buffers will be packed and so on.</span></div>

<div><span class="Apple-style-span" style="font-family: 'times new roman', serif; color: rgb(51, 51, 255); ">2) At MDS side the swabber() function + some associated functions extract the buffer information.</span></div>

<div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></font></div><div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><b>What I need is :-</b></font></font></font></div>

<div><font size="2"><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></font></div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">1) Is it possible that without writing a new RPC in Lustre 1.8.1.1 I can append some string such as "Hello" to the exsisting message sent by the Client (with the buffer size set at client side by the count,size fields).I tried modifying the "size" of the request for one of the RPC in-built in Lustre </font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></div><div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">         __u32 size[2] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct ptlrpc_body),</font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">                                    [DLM_LOCKREQ_OFF]     = sizeof(struct ldlm_request) };</font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">---->> </font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">     __u32 size[3] = { [MSG_PTLRPC_BODY_OFF] = sizeof(struct ptlrpc_body),</font></font></div><div>

<font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">                                  [DLM_LOCKREQ_OFF]     = sizeof(struct ldlm_request) ,</font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">                                  //how to add "char *str=Hello" ofcourse we will have sizeof(str) but how to choose the MACRO like </font></font><span class="Apple-style-span" style="font-family: 'times new roman', serif; color: rgb(51, 51, 255); ">DLM_LOCKREQ_OFF bcz for a specific kind of RPC there are limited number of such MACROS</span></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">                                            };</font></font></div></div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br>

</font></font></div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">The thing I want to know is how can I send a buffer from the client side by modifying the static structure "size" mentioned above.What all main places do I need to consider to make this work.</font></font></div>

<div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF"><br></font></font></div><div><font class="Apple-style-span" face="'times new roman', serif"><font class="Apple-style-span" color="#3333FF">If the above step i.e appending a buffer in the "size" array is not possible then I can move to write a new RPC.</font></font></div>

<div><br></div><div><font class="Apple-style-span" color="#3333FF" face="'times new roman', serif"><br></font></div><div><font color="#3333ff"><font size="2"><font face="times new roman,serif">Thanks,</font></font></font></div>

<div><font color="#3333ff"><font size="2"><font face="times new roman,serif">Vilobh</font></font></font></div><div><font color="#3333ff"><font size="2"><font face="times new roman,serif"><i>Graduate Research Associate</i></font></font></font></div>

<div><font color="#3333ff"><font size="2"><font face="times new roman,serif"><i>Department of Computer Science</i></font></font></font></div><div><font color="#3333ff"><font size="2"><font face="times new roman,serif"><i>The Ohio State University Columbus Ohio</i></font></font></font></div>

<div><font class="Apple-style-span" color="#3333FF" face="'times new roman', serif"><br></font></div><div><br><div class="gmail_quote">On Wed, Oct 13, 2010 at 3:51 AM, Alexey Lyashkov <span dir="ltr"><<a href="mailto:alexey.lyashkov@clusterstor.com">alexey.lyashkov@clusterstor.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br>
On Oct 13, 2010, at 10:43, Nicolas Williams wrote:<br>
<br>
> On Wed, Oct 13, 2010 at 10:27:55AM +0300, Alexey Lyashkov wrote:<br>
>> eh.. Nicolas,<br>
>><br>
>> Format for messages which want to reconstructed after resend and don't<br>
>> want recontructed - is different.<br>
>><br>
>> As quick example it is OPEN request (via MDS_REINT command), that type<br>
>> message need a have extra buffer to store LOV EA, which to be send to<br>
>> MDS in replay case (with additional flag in header).  (client have a<br>
>> copy data from a mds reply after ptlrpc finish processing request).<br>
>> That is why i say about "Reconstruct/replay case"<br>
><br>
> Sure, but this buffer needs to be declared a priori.  If you won't know<br>
> whether you'll need a buffer until later, that's OK: you declare it<br>
> anyways and you set its size to zero if you don't need it.<br>
><br>
> You can't change a capsule's format to add buffers; you can only set the<br>
> size of unnecessary buffers to zero.<br>
</div>but you can reassing format for a message :)<br>
if you look to MDT code, you can see - for MDS_REINT you have first format<br>
for operation inside REINT lustre use second format<br>
<br>
static int mdt_reint(struct mdt_thread_info *info)<br>
{<br>
        long opc;<br>
        int  rc;<br>
<br>
        static const struct req_format *reint_fmts[REINT_MAX] = {<br>
                [REINT_SETATTR]  = &RQF_MDS_REINT_SETATTR,<br>
                [REINT_CREATE]   = &RQF_MDS_REINT_CREATE,<br>
                [REINT_LINK]     = &RQF_MDS_REINT_LINK,<br>
                [REINT_UNLINK]   = &RQF_MDS_REINT_UNLINK,<br>
                [REINT_RENAME]   = &RQF_MDS_REINT_RENAME,<br>
                [REINT_OPEN]     = &RQF_MDS_REINT_OPEN,<br>
                [REINT_SETXATTR] = &RQF_MDS_REINT_SETXATTR<br>
        };<br>
<br>
..<br>
<br>
understand me ?<br>
<div><div></div><div class="h5"><br>
<br>
--------------------------------------<br>
Alexey Lyashkov<br>
<a href="mailto:alexey.lyashkov@clusterstor.com">alexey.lyashkov@clusterstor.com</a><br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>