I did not have in mind lis_spin_lock().
What I suggest is a slight modification on top of
what Matt _already_ done.
For instance:
#if defined(CONFIG_DEV)
void lis_mntput(struct vfsmount *m,
const char *file, int line, const char *fn)
#else
void lis_mntput(struct vfsmount *m)
#endif
can be replaced with one line:
void lis_mntput(struct vfsmount *m FlLnFn)
or
#if defined(CONFIG_DEV)
#define MNTSYNC() lis_mnt_cnt_sync(__LIS_FILE__,__LINE__,__FUNCTION__)
#define MNTGET(m) lis_mntget((m),__LIS_FILE__,__LINE__,__FUNCTION__)
#define MNTPUT(m) lis_mntput((m),__LIS_FILE__,__LINE__,__FUNCTION__)
#else
#define MNTSYNC() lis_mnt_cnt_sync()
#define MNTGET(m) lis_mntget((m))
#define MNTPUT(m) lis_mntput((m))
I.e. this kind of things, that are _already_ spreaded in .c files,
can be optimized using the suggested technique
--
Eugene
Dave Grothe <[EMAIL PROTECTED]> wrote:
>The problem is that it breaks a fundamental design rule of LiS which is to
>present a constant API to STREAMS drivers irrespective of the build options
>for LiS. This technique changes the calling sequences for external
>functions such as lis_spin_lock().
>-- Dave
>At 12:18 PM 2/19/2004, Eugene LiS User wrote:
>
>>Hello,
>>
>>I looked through recent optimizations done by Matt
>>and it seems like it can be improved a little bit further
>>with regard to *file, line processing.
>>
>>
>>In relevant top header file[s] add:
>>
>>
>>#ifdef FL_DEBUG
>>
>> #define FnLnPar , char* file, int line
>>
>> #define FnLnVal , __FILE__, __LINE__
>>
>>
>>#else
>>
>> #define FnLnPar
>>
>> #define FnLnVal
>>
>>#endif
>>
>>
>>
>>Then in function definitions we can do like this:
>>
>>
>>my_spinlock(lock FnLnPar)
>>
>>{
>>...
>>#ifdef FL_DEBUG
>>save(file); <--- whatever is already there
>>save(line); for file and line
>>#endif
>>..
>>}
>>
>>
>>
>>In function calls or in #define's
>>we can do like this:
>>
>>#define spinlock(lock) my_spinlock(lock FnLnVal)
>>
>> or
>>
>>my_spinlock(lock FnLnVal); <--- function call
>>
>>
>>
>>This would allow to avoid multiple #ifdef'ing in the *.c source
>>files, thus improving readability of the source and maintenance ease.
>>
>>--
>>Eugene
>>
>>
>>__________________________________________________________________
>>Introducing the New Netscape Internet Service.
>>Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
>>
>>Netscape. Just the Net You Need.
>>_______________________________________________
>>Linux-streams mailing list
>>[EMAIL PROTECTED]
>>http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
>>
>>
>>---
>>Incoming mail is certified Virus Free.
>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>Version: 6.0.591 / Virus Database: 374 - Release Date: 2/17/2004
>
>
__________________________________________________________________
Introducing the New Netscape Internet Service.
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
_______________________________________________
Linux-streams mailing list
[EMAIL PROTECTED]
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams