Skip to contentSkip to conversation

nfs: guard fs/nfs/internal.h against multiple inclusion

PATCH In review Jeff Layton 3 participants 5 messages Dec 12, 2014

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

PATCH 1/1 nfs: guard fs/nfs/internal.h against multiple inclusion

---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)
fs/nfs/internal.h +4 -0
index efaa31c70fbe..ffef459f0b4f 100644
@@ -1,6 +1,8 @@
 /*
  * NFS internal definitions
  */
+#ifndef	__FS_NFS_INTERNAL_H
+#define __FS_NFS_INTERNAL_H
 
 #include "nfs4_fs.h"
 #include <linux/mount.h>
@@ -629,3 +631,5 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
 	return 0;
 }
 #endif
+
+#endif	/* __FS_NFS_INTERNAL_H */
Signature · 1 line
2.1.0
#1 lore raw
Quoted 11 lines · On Fri, 12 Dec 2014 09:50:18 -0500 Jeff Layton <[email protected]> wrote:
---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)
fs/nfs/internal.h +0 -0
index efaa31c70fbe..ffef459f0b4f 100644

fs/nfs/internal.h line 4

Quoted 4 lines
fs/nfs/internal.h +1 -0
@@ -1,6 +1,8 @@
 /*
  * NFS internal definitions
  */
+#ifndef	__FS_NFS_INTERNAL_H

Gyah...sorry for the whitespace typo above. Want me to resend with that tab turned into a space?

Quoted 10 lines
fs/nfs/internal.h +3 -0
+#define __FS_NFS_INTERNAL_H
 
 #include "nfs4_fs.h"
 #include <linux/mount.h>
@@ -629,3 +631,5 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
 	return 0;
 }
 #endif
+
+#endif	/* __FS_NFS_INTERNAL_H */
Signature · 1 line
Jeff Layton <[email protected]>
#2 lore raw
Quoted 9 lines · Jeff Layton
Quoted 6 lines · On Fri, 12 Dec 2014 09:50:18 -0500 Jeff Layton <[email protected]> wrote:
---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 12 lines

fs/nfs/internal.h line 4

Quoted 9 lines
fs/nfs/internal.h +1 -0
index efaa31c70fbe..ffef459f0b4f 100644
@@ -1,6 +1,8 @@
 /*
  * NFS internal definitions
  */
+#ifndef      __FS_NFS_INTERNAL_H

Gyah...sorry for the whitespace typo above. Want me to resend with that tab turned into a space?

That's OK. I'll manage somehow :-)

Quoted 14 lines

fs/nfs/internal.h static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) · line 635

Quoted 10 lines
fs/nfs/internal.h +3 -0
+#define __FS_NFS_INTERNAL_H
 
 #include "nfs4_fs.h"
 #include <linux/mount.h>
@@ -629,3 +631,5 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
      return 0;
 }
 #endif
+
+#endif       /* __FS_NFS_INTERNAL_H */

--
Jeff Layton <[email protected]>

Signature · 5 lines
Trond Myklebust

Linux NFS client maintainer, PrimaryData

[email protected]
#3 lore raw
Quoted 23 lines · Trond Myklebust
Quoted 9 lines · Jeff Layton
Quoted 6 lines · On Fri, 12 Dec 2014 09:50:18 -0500 Jeff Layton <[email protected]> wrote:
---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 12 lines

fs/nfs/internal.h line 4

Quoted 9 lines
fs/nfs/internal.h +1 -0
index efaa31c70fbe..ffef459f0b4f 100644
@@ -1,6 +1,8 @@
 /*
  * NFS internal definitions
  */
+#ifndef      __FS_NFS_INTERNAL_H

Gyah...sorry for the whitespace typo above. Want me to resend with that tab turned into a space?

Quoted 17 lines

That's OK. I'll manage somehow :-)

Quoted 14 lines

fs/nfs/internal.h static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) · line 635

Quoted 10 lines
fs/nfs/internal.h +3 -0
+#define __FS_NFS_INTERNAL_H
 
 #include "nfs4_fs.h"
 #include <linux/mount.h>
@@ -629,3 +631,5 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
      return 0;
 }
 #endif
+
+#endif       /* __FS_NFS_INTERNAL_H */

--
Jeff Layton <[email protected]>

So, having rethought this a little, I think I'd prefer to keep the current status. Right now, we catch all instances of someone incorrectly including this file in another header by virtue of the fact that the duplicate include will cause a compile error.

Signature · 5 lines
Trond Myklebust

Linux NFS client maintainer, PrimaryData

[email protected]
#4 lore raw
Quoted 43 lines · On Fri, 12 Dec 2014 13:58:10 -0500 Trond Myklebust…
Quoted 23 lines · Trond Myklebust
Quoted 9 lines · Jeff Layton
Quoted 6 lines · On Fri, 12 Dec 2014 09:50:18 -0500 Jeff Layton <[email protected]> wrote:
---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)
Quoted 12 lines

fs/nfs/internal.h line 4

Quoted 9 lines
fs/nfs/internal.h +1 -0
index efaa31c70fbe..ffef459f0b4f 100644
@@ -1,6 +1,8 @@
 /*
  * NFS internal definitions
  */
+#ifndef      __FS_NFS_INTERNAL_H

Gyah...sorry for the whitespace typo above. Want me to resend with that tab turned into a space?

Quoted 17 lines

That's OK. I'll manage somehow :-)

Quoted 14 lines

fs/nfs/internal.h static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) · line 635

Quoted 10 lines
fs/nfs/internal.h +3 -0
+#define __FS_NFS_INTERNAL_H
 
 #include "nfs4_fs.h"
 #include <linux/mount.h>
@@ -629,3 +631,5 @@ static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh)
      return 0;
 }
 #endif
+
+#endif       /* __FS_NFS_INTERNAL_H */

--
Jeff Layton <[email protected]>

Quoted 5 lines

So, having rethought this a little, I think I'd prefer to keep the current status. Right now, we catch all instances of someone incorrectly including this file in another header by virtue of the fact that the duplicate include will cause a compile error.

Fair enough. The problem that we saw with it turns out to be a bug in a different patch under development so it's not really required.

Thanks,

Signature · 1 line
Jeff Layton <[email protected]>