Skip to contentSkip to conversation

What's nlmsvc_proc_share() for?

DISCUSSION Rob Landley 2 participants 3 messages Apr 6, 2011 – Apr 8, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I'm reading through the fs/lockd code, and I read grace.c and svcshare.c and code such as nlmsvc_share_file() only seems to get called from nlmsvc_proc_share() (and its cut-and-paste twin nlm4svc_proc_share())...

And as far as I can grep, those last two functions are never called from anywhere in the kernel source.

The comments say this is for "DOS shares", which presumably doesn't mean what I think it means because DOS used netbios, not NFS...

What's this code for, and where does it get used? Is it something out of tree, or some header #define that's glued##together that I'm not picking up via grep...?

Rob

#1 lore raw

Rob Landley:

Quoted 7 lines

I'm reading through the fs/lockd code, and I read grace.c and svcshare.c and code such as nlmsvc_share_file() only seems to get called from nlmsvc_proc_share() (and its cut-and-paste twin nlm4svc_proc_share())...

And as far as I can grep, those last two functions are never called from anywhere in the kernel source.

Quoted 6 lines

The comments say this is for "DOS shares", which presumably doesn't mean what I think it means because DOS used netbios, not NFS...

What's this code for, and where does it get used? Is it something out of tree, or some header #define that's glued##together that I'm not picking up via grep...?

Maybe you can get some info from the following code at fs/lockd/svc4proc.c:

462

 463 #define PROC(name, xargt, xrest, argt, rest, respsize)  \
 464  { .pc_func     = (svc_procfunc) nlm4svc_proc_##name,   \
 465    .pc_decode   = (kxdrproc_t) nlm4svc_decode_##xargt,  \
 466    .pc_encode   = (kxdrproc_t) nlm4svc_encode_##xrest,  \
 467    .pc_release  = NULL,                                 \
 468    .pc_argsize  = sizeof(struct nlm_##argt),            \
 469    .pc_ressize  = sizeof(struct nlm_##rest),            \
 470    .pc_xdrressize = respsize,                           \
 471  }
 472 #define Ck      (1+XDR_QUADLEN(NLM_MAXCOOKIELEN))       /* cookie */
 473 #define No      (1+1024/4)                              /* netobj */
 474 #define St      1                                       /* status */
 475 #define Rg      4                                       /* range (offset + length) */
 476 struct svc_procedure            nlmsvc_procedures4[] = {
 477   PROC(null,            void,           void,           void,   void, 1),
     .. ... 
 497   PROC(none,            void,           void,           void,   void, 0),
 498   PROC(share,           shareargs,      shareres,       args,   res, Ck+St+1),
 499   PROC(unshare,         shareargs,      shareres,       args,   res, Ck+St+1),
 500   PROC(nm_lock,         lockargs,       res,            args,   res, Ck+St),
 501   PROC(free_all,        notify,         void,           args,   void, 1),

502
503 };

Signature · 3 lines
----
thanks
Mi Jinlong
#2 lore raw
Quoted 10 lines · Mi Jinlong

Rob Landley:

Quoted 3 lines

What's this code for, and where does it get used? Is it something out of tree, or some header #define that's glued##together that I'm not picking up via grep...?

Maybe you can get some info from the following code at fs/lockd/svc4proc.c:

462
463 #define PROC(name, xargt, xrest, argt, rest, respsize) \
464 { .pc_func = (svc_procfunc) nlm4svc_proc_##name, \

...

Quoted 1 line

498 PROC(share, shareargs, shareres, args, res, Ck+St+1),

So it's glued##together in a macro. Got it.

Thanks,

Rob