diff mbox

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

Message ID 1418395818-22062-1-git-send-email-jlayton@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton Dec. 12, 2014, 2:50 p.m. UTC
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Cc: Thomas Haynes <thomas.haynes@primarydata.com>
---
 fs/nfs/internal.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jeff Layton Dec. 12, 2014, 2:58 p.m. UTC | #1
On Fri, 12 Dec 2014 09:50:18 -0500
Jeff Layton <jlayton@primarydata.com> wrote:

> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> Cc: Thomas Haynes <thomas.haynes@primarydata.com>
> ---
>  fs/nfs/internal.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> index efaa31c70fbe..ffef459f0b4f 100644
> --- a/fs/nfs/internal.h
> +++ b/fs/nfs/internal.h
> @@ -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?

> +#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 */
Trond Myklebust Dec. 12, 2014, 3:50 p.m. UTC | #2
On Fri, Dec 12, 2014 at 9:58 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
> On Fri, 12 Dec 2014 09:50:18 -0500
> Jeff Layton <jlayton@primarydata.com> wrote:
>
>> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
>> Cc: Thomas Haynes <thomas.haynes@primarydata.com>
>> ---
>>  fs/nfs/internal.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
>> index efaa31c70fbe..ffef459f0b4f 100644
>> --- a/fs/nfs/internal.h
>> +++ b/fs/nfs/internal.h
>> @@ -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 :-)

>> +#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 <jlayton@poochiereds.net>
Trond Myklebust Dec. 12, 2014, 6:58 p.m. UTC | #3
On Fri, Dec 12, 2014 at 10:50 AM, Trond Myklebust
<trond.myklebust@primarydata.com> wrote:
> On Fri, Dec 12, 2014 at 9:58 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
>> On Fri, 12 Dec 2014 09:50:18 -0500
>> Jeff Layton <jlayton@primarydata.com> wrote:
>>
>>> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
>>> Cc: Thomas Haynes <thomas.haynes@primarydata.com>
>>> ---
>>>  fs/nfs/internal.h | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
>>> index efaa31c70fbe..ffef459f0b4f 100644
>>> --- a/fs/nfs/internal.h
>>> +++ b/fs/nfs/internal.h
>>> @@ -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 :-)
>
>>> +#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 <jlayton@poochiereds.net>
>

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.
Jeff Layton Dec. 12, 2014, 7 p.m. UTC | #4
On Fri, 12 Dec 2014 13:58:10 -0500
Trond Myklebust <trond.myklebust@primarydata.com> wrote:

> On Fri, Dec 12, 2014 at 10:50 AM, Trond Myklebust
> <trond.myklebust@primarydata.com> wrote:
> > On Fri, Dec 12, 2014 at 9:58 AM, Jeff Layton <jlayton@poochiereds.net> wrote:
> >> On Fri, 12 Dec 2014 09:50:18 -0500
> >> Jeff Layton <jlayton@primarydata.com> wrote:
> >>
> >>> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
> >>> Cc: Thomas Haynes <thomas.haynes@primarydata.com>
> >>> ---
> >>>  fs/nfs/internal.h | 4 ++++
> >>>  1 file changed, 4 insertions(+)
> >>>
> >>> diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
> >>> index efaa31c70fbe..ffef459f0b4f 100644
> >>> --- a/fs/nfs/internal.h
> >>> +++ b/fs/nfs/internal.h
> >>> @@ -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 :-)
> >
> >>> +#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 <jlayton@poochiereds.net>
> >
> 
> 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,
diff mbox

Patch

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index efaa31c70fbe..ffef459f0b4f 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -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 */