Commit bd0b1e954e3ba3e5d2cab941458cf98206471bd2

Authored by NeilBrown
Committed by Linus Torvalds
1 parent 707d4ab7b3

[PATCH] knfsd: nfsd4: idmap initialization

Adopt standard kernel style by defining a no-op function instead of putting
ifdef's in the code where the function is called.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 5 additions and 4 deletions Side-by-side Diff

... ... @@ -398,9 +398,7 @@
398 398 nfsd_export_init(); /* Exports table */
399 399 nfsd_lockd_init(); /* lockd->nfsd callbacks */
400 400 nfs4_state_init(); /* NFSv4 locking state */
401   -#ifdef CONFIG_NFSD_V4
402 401 nfsd_idmap_init(); /* Name to ID mapping */
403   -#endif /* CONFIG_NFSD_V4 */
404 402 if (proc_mkdir("fs/nfs", NULL)) {
405 403 struct proc_dir_entry *entry;
406 404 entry = create_proc_entry("fs/nfs/exports", 0, NULL);
407 405  
... ... @@ -427,9 +425,7 @@
427 425 remove_proc_entry("fs/nfs", NULL);
428 426 nfsd_stat_shutdown();
429 427 nfsd_lockd_shutdown();
430   -#ifdef CONFIG_NFSD_V4
431 428 nfsd_idmap_shutdown();
432   -#endif /* CONFIG_NFSD_V4 */
433 429 unregister_filesystem(&nfsd_fs_type);
434 430 }
435 431  
include/linux/nfsd_idmap.h
... ... @@ -43,8 +43,13 @@
43 43 /* XXX from linux/nfs_idmap.h */
44 44 #define IDMAP_NAMESZ 128
45 45  
  46 +#ifdef CONFIG_NFSD_V4
46 47 void nfsd_idmap_init(void);
47 48 void nfsd_idmap_shutdown(void);
  49 +#else
  50 +static inline void nfsd_idmap_init(void) {};
  51 +static inline void nfsd_idmap_shutdown(void) {};
  52 +#endif
48 53  
49 54 int nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, __u32 *);
50 55 int nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, __u32 *);