@bhagyesh: whatever M.M said is correct and If you see lustre/ldlm/ldlm_resource.c, In line 74 you have
74 #ifdef LPROCFS
.......
.......
385 #undef MAX_STRING_SIZE
386 #else /* LPROCFS */
387
388 #define ldlm_namespace_proc_unregister(ns) ({;})
389 #define ldlm_namespace_proc_register(ns) ({0;})
390
391 #endif /* LPROCFS */
So here these functions are getting manipulated depending on defination of LPROCFS. I think It is visible now.
And about your question..
Thanks @M.M, one more question, so does it relate in any way to the return value of the function? –
Here is small experiment in which it is clear...
#include<stdio.h>
#ifdef LPROCFS
int my_register(int x)
{
int y = x*x;
printf("In my_register val=%d\n", x);
return y;
}
void my_unregister(int x)
{
printf("In my_unregister val=%d\n", x);
}
#else
#define my_register(x) ({0;})
#define my_unregister(x) ({;})
#endif
int main ()
{
printf("In main\n");
int rc = my_register(2);
my_unregister(3);
printf("after returning rc=%d\n", rc);
return 0;
}
When LPROCFS not defined..
[root@ashish-203 lustre-wc-rel]# ./test_directives
In main
after returning rc=0
When LPROCFS is defined...
[root@ashish-203 lustre-wc-rel]# ./test_directives
In main
In my_register val=2
In my_unregister val=3
after returning rc=4
[root@ashish-203 lustre-wc-rel]#