[Lustre-devel] Query to understand the Lustre request/reply message

Alexey Lyashkov alexey.lyashkov at clusterstor.com
Wed Oct 13 00:51:21 PDT 2010


On Oct 13, 2010, at 10:43, Nicolas Williams wrote:

> On Wed, Oct 13, 2010 at 10:27:55AM +0300, Alexey Lyashkov wrote:
>> eh.. Nicolas,
>> 
>> Format for messages which want to reconstructed after resend and don't
>> want recontructed - is different.
>> 
>> As quick example it is OPEN request (via MDS_REINT command), that type
>> message need a have extra buffer to store LOV EA, which to be send to
>> MDS in replay case (with additional flag in header).  (client have a
>> copy data from a mds reply after ptlrpc finish processing request).
>> That is why i say about "Reconstruct/replay case"
> 
> Sure, but this buffer needs to be declared a priori.  If you won't know
> whether you'll need a buffer until later, that's OK: you declare it
> anyways and you set its size to zero if you don't need it.
> 
> You can't change a capsule's format to add buffers; you can only set the
> size of unnecessary buffers to zero.  
but you can reassing format for a message :)
if you look to MDT code, you can see - for MDS_REINT you have first format 
for operation inside REINT lustre use second format

static int mdt_reint(struct mdt_thread_info *info)                                                                   
{                                                                                                                    
        long opc;                                                                                                    
        int  rc;                                                                                                     
                                                                                                                     
        static const struct req_format *reint_fmts[REINT_MAX] = {                                                    
                [REINT_SETATTR]  = &RQF_MDS_REINT_SETATTR,                                                           
                [REINT_CREATE]   = &RQF_MDS_REINT_CREATE,                                                            
                [REINT_LINK]     = &RQF_MDS_REINT_LINK,                                                              
                [REINT_UNLINK]   = &RQF_MDS_REINT_UNLINK,                                                            
                [REINT_RENAME]   = &RQF_MDS_REINT_RENAME,                                                            
                [REINT_OPEN]     = &RQF_MDS_REINT_OPEN,                                                              
                [REINT_SETXATTR] = &RQF_MDS_REINT_SETXATTR                                                           
        };

..

understand me ?


--------------------------------------
Alexey Lyashkov
alexey.lyashkov at clusterstor.com







More information about the lustre-devel mailing list