Linux NFS development
 help / color / mirror / Atom feed
* [PATCH] nfs: parenthesize NFS_*(inode) parameters
@ 2008-01-22 14:28 Benny Halevy
  2008-01-22 14:50 ` Trond Myklebust
  0 siblings, 1 reply; 9+ messages in thread
From: Benny Halevy @ 2008-01-22 14:28 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, NFSv4

Otherwise e.g., NFS_SERVER(&nfsi->vfs_inode) does not compile.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
---
 include/linux/nfs_fs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0477a4c..5a5d3fe 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -221,10 +221,10 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
 {
 	return container_of(inode, struct nfs_inode, vfs_inode);
 }
-#define NFS_SB(s)		((struct nfs_server *)(s->s_fs_info))
+#define NFS_SB(s)		((struct nfs_server *)((s)->s_fs_info))
 
 #define NFS_FH(inode)			(&NFS_I(inode)->fh)
-#define NFS_SERVER(inode)		(NFS_SB(inode->i_sb))
+#define NFS_SERVER(inode)		(NFS_SB((inode)->i_sb))
 #define NFS_CLIENT(inode)		(NFS_SERVER(inode)->client)
 #define NFS_PROTO(inode)		(NFS_SERVER(inode)->nfs_client->rpc_ops)
 #define NFS_COOKIEVERF(inode)		(NFS_I(inode)->cookieverf)
-- 
1.5.3.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread
* Re: [PATCH] nfs: parenthesize NFS_*(inode) parameters
@ 2008-01-22 16:06 Rick Macklem
  2008-01-22 16:53 ` Benny Halevy
  0 siblings, 1 reply; 9+ messages in thread
From: Rick Macklem @ 2008-01-22 16:06 UTC (permalink / raw)
  To: bhalevy; +Cc: Trond.Myklebust, linux-nfs, NFSv4

> > They should really be converted into inlined functions.
> > 
> > Cheers
> >   Trond
> 
> Agreed.  How about the following:

Ok, you've tickled my curiosity...why? Unless a macro is large and is
used many times (my really old nfs code was like that, being written
for a compiler that didn't support inline functions), what is the
advantage of inline functions? Or is it just that the code is more readable?

Just curious, I don't have any problem with using inline functions, rick

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-01-22 18:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-22 14:28 [PATCH] nfs: parenthesize NFS_*(inode) parameters Benny Halevy
2008-01-22 14:50 ` Trond Myklebust
     [not found]   ` <1201013438.30335.5.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2008-01-22 15:37     ` Benny Halevy
2008-01-22 16:58       ` Chuck Lever
2008-01-22 18:10         ` Trond Myklebust
2008-01-22 18:30           ` Benny Halevy
2008-01-22 18:58             ` Trond Myklebust
  -- strict thread matches above, loose matches on Subject: below --
2008-01-22 16:06 Rick Macklem
2008-01-22 16:53 ` Benny Halevy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox