Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  Mapping of UID to name and vice versa.
0003  *
0004  *  Copyright (c) 2002, 2003 The Regents of the University of
0005  *  Michigan.  All rights reserved.
0006 > *
0007  *  Marius Aamodt Eriksen <marius@umich.edu>
0008  *
0009  *  Redistribution and use in source and binary forms, with or without
0010  *  modification, are permitted provided that the following conditions
0011  *  are met:
0012  *
0013  *  1. Redistributions of source code must retain the above copyright
0014  *     notice, this list of conditions and the following disclaimer.
0015  *  2. Redistributions in binary form must reproduce the above copyright
0016  *     notice, this list of conditions and the following disclaimer in the
0017  *     documentation and/or other materials provided with the distribution.
0018  *  3. Neither the name of the University nor the names of its
0019  *     contributors may be used to endorse or promote products derived
0020  *     from this software without specific prior written permission.
0021  *
0022  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
0023  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
0024  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
0025  *  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
0026  *  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0027  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0028  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
0029  *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0030  *  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0031  *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0032  *  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0033  */
0034 
0035 #ifndef LINUX_NFSD_IDMAP_H
0036 #define LINUX_NFSD_IDMAP_H
0037 
0038 #include <linux/in.h>
0039 #include <linux/sunrpc/svc.h>
0040 #include <linux/nfs_idmap.h>
0041 
0042 #ifdef CONFIG_NFSD_V4
0043 int nfsd_idmap_init(struct net *);
0044 void nfsd_idmap_shutdown(struct net *);
0045 #else
0046 static inline int nfsd_idmap_init(struct net *net)
0047 {
0048     return 0;
0049 }
0050 static inline void nfsd_idmap_shutdown(struct net *net)
0051 {
0052 }
0053 #endif
0054 
0055 __be32 nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, kuid_t *);
0056 __be32 nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, kgid_t *);
0057 __be32 nfsd4_encode_user(struct xdr_stream *, struct svc_rqst *, kuid_t);
0058 __be32 nfsd4_encode_group(struct xdr_stream *, struct svc_rqst *, kgid_t);
0059 
0060 #endif /* LINUX_NFSD_IDMAP_H */