Re: [PATCH 2/2] Remove fedfs_admin.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 02/08/2018 12:13 PM, Chuck Lever wrote:
> nfs-utils is not going to provide an implementation of the FedFS
> ADMIN protocol, so there's no need to include the entire .x file
> for that protocol.
> 
> The only piece needed (for the moment) is the enum that defines
> the FEDFS_ERR codes, which are used by the internal and external
> libjunction APIs.
> 
> Suggested-by: Neil Brown <neilb@xxxxxxxx>
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
Committed... 

steved.
> ---
>  support/include/Makefile.am   |    1 
>  support/include/fedfs_admin.h |  342 -----------------------------------------
>  support/include/junction.h    |   47 +++++-
>  support/junction/path.c       |    1 
>  utils/nfsref/add.c            |    1 
>  utils/nfsref/nfsref.c         |    1 
>  6 files changed, 48 insertions(+), 345 deletions(-)
>  delete mode 100644 support/include/fedfs_admin.h
> 
> diff --git a/support/include/Makefile.am b/support/include/Makefile.am
> index 11cb162..599f500 100644
> --- a/support/include/Makefile.am
> +++ b/support/include/Makefile.am
> @@ -5,7 +5,6 @@ SUBDIRS = nfs rpcsvc sys
>  noinst_HEADERS = \
>  	cld.h \
>  	exportfs.h \
> -	fedfs_admin.h \
>  	ha-callout.h \
>  	junction.h \
>  	misc.h \
> diff --git a/support/include/fedfs_admin.h b/support/include/fedfs_admin.h
> deleted file mode 100644
> index d8b6715..0000000
> --- a/support/include/fedfs_admin.h
> +++ /dev/null
> @@ -1,342 +0,0 @@
> -/*
> - * Please do not edit this file.
> - * It was generated using rpcgen.
> - */
> -
> -#ifndef _FEDFS_ADMIN_H_RPCGEN
> -#define _FEDFS_ADMIN_H_RPCGEN
> -
> -#include <rpc/rpc.h>
> -
> -
> -#ifdef __cplusplus
> -extern "C" {
> -#endif
> -
> -
> -enum FedFsStatus {
> -	FEDFS_OK = 0,
> -	FEDFS_ERR_ACCESS = 1,
> -	FEDFS_ERR_BADCHAR = 2,
> -	FEDFS_ERR_BADNAME = 3,
> -	FEDFS_ERR_NAMETOOLONG = 4,
> -	FEDFS_ERR_LOOP = 5,
> -	FEDFS_ERR_BADXDR = 6,
> -	FEDFS_ERR_EXIST = 7,
> -	FEDFS_ERR_INVAL = 8,
> -	FEDFS_ERR_IO = 9,
> -	FEDFS_ERR_NOSPC = 10,
> -	FEDFS_ERR_NOTJUNCT = 11,
> -	FEDFS_ERR_NOTLOCAL = 12,
> -	FEDFS_ERR_PERM = 13,
> -	FEDFS_ERR_ROFS = 14,
> -	FEDFS_ERR_SVRFAULT = 15,
> -	FEDFS_ERR_NOTSUPP = 16,
> -	FEDFS_ERR_NSDB_ROUTE = 17,
> -	FEDFS_ERR_NSDB_DOWN = 18,
> -	FEDFS_ERR_NSDB_CONN = 19,
> -	FEDFS_ERR_NSDB_AUTH = 20,
> -	FEDFS_ERR_NSDB_LDAP = 21,
> -	FEDFS_ERR_NSDB_LDAP_VAL = 22,
> -	FEDFS_ERR_NSDB_NONCE = 23,
> -	FEDFS_ERR_NSDB_NOFSN = 24,
> -	FEDFS_ERR_NSDB_NOFSL = 25,
> -	FEDFS_ERR_NSDB_RESPONSE = 26,
> -	FEDFS_ERR_NSDB_FAULT = 27,
> -	FEDFS_ERR_NSDB_PARAMS = 28,
> -	FEDFS_ERR_NSDB_LDAP_REFERRAL = 29,
> -	FEDFS_ERR_NSDB_LDAP_REFERRAL_VAL = 30,
> -	FEDFS_ERR_NSDB_LDAP_REFERRAL_NOTFOLLOWED = 31,
> -	FEDFS_ERR_NSDB_PARAMS_LDAP_REFERRAL = 32,
> -	FEDFS_ERR_PATH_TYPE_UNSUPP = 33,
> -	FEDFS_ERR_DELAY = 34,
> -	FEDFS_ERR_NO_CACHE = 35,
> -	FEDFS_ERR_UNKNOWN_CACHE = 36,
> -	FEDFS_ERR_NO_CACHE_UPDATE = 37,
> -};
> -typedef enum FedFsStatus FedFsStatus;
> -
> -typedef struct {
> -	u_int utf8string_len;
> -	char *utf8string_val;
> -} utf8string;
> -
> -typedef utf8string ascii_REQUIRED4;
> -
> -typedef utf8string utf8val_REQUIRED4;
> -
> -typedef char FedFsUuid[16];
> -
> -struct FedFsNsdbName {
> -	u_int port;
> -	utf8val_REQUIRED4 hostname;
> -};
> -typedef struct FedFsNsdbName FedFsNsdbName;
> -
> -typedef ascii_REQUIRED4 FedFsPathComponent;
> -
> -typedef struct {
> -	u_int FedFsPathName_len;
> -	FedFsPathComponent *FedFsPathName_val;
> -} FedFsPathName;
> -
> -struct FedFsFsn {
> -	FedFsUuid fsnUuid;
> -	FedFsNsdbName nsdbName;
> -};
> -typedef struct FedFsFsn FedFsFsn;
> -
> -enum FedFsFslType {
> -	FEDFS_NFS_FSL = 0,
> -};
> -typedef enum FedFsFslType FedFsFslType;
> -
> -struct FedFsNfsFsl {
> -	FedFsUuid fslUuid;
> -	u_int port;
> -	utf8val_REQUIRED4 hostname;
> -	FedFsPathName path;
> -};
> -typedef struct FedFsNfsFsl FedFsNfsFsl;
> -
> -struct FedFsFsl {
> -	FedFsFslType type;
> -	union {
> -		FedFsNfsFsl nfsFsl;
> -	} FedFsFsl_u;
> -};
> -typedef struct FedFsFsl FedFsFsl;
> -
> -enum FedFsPathType {
> -	FEDFS_PATH_SYS = 0,
> -	FEDFS_PATH_NFS = 1,
> -};
> -typedef enum FedFsPathType FedFsPathType;
> -
> -struct FedFsPath {
> -	FedFsPathType type;
> -	union {
> -		FedFsPathName adminPath;
> -		FedFsPathName nfsPath;
> -	} FedFsPath_u;
> -};
> -typedef struct FedFsPath FedFsPath;
> -
> -struct FedFsCreateArgs {
> -	FedFsPath path;
> -	FedFsFsn fsn;
> -};
> -typedef struct FedFsCreateArgs FedFsCreateArgs;
> -
> -enum FedFsResolveType {
> -	FEDFS_RESOLVE_NONE = 0,
> -	FEDFS_RESOLVE_CACHE = 1,
> -	FEDFS_RESOLVE_NSDB = 2,
> -};
> -typedef enum FedFsResolveType FedFsResolveType;
> -
> -struct FedFsLookupArgs {
> -	FedFsPath path;
> -	FedFsResolveType resolve;
> -};
> -typedef struct FedFsLookupArgs FedFsLookupArgs;
> -
> -struct FedFsLookupResOk {
> -	FedFsFsn fsn;
> -	struct {
> -		u_int fsl_len;
> -		FedFsFsl *fsl_val;
> -	} fsl;
> -};
> -typedef struct FedFsLookupResOk FedFsLookupResOk;
> -
> -struct FedFsLookupResReferralVal {
> -	FedFsNsdbName targetNsdb;
> -	u_int ldapResultCode;
> -};
> -typedef struct FedFsLookupResReferralVal FedFsLookupResReferralVal;
> -
> -struct FedFsLookupRes {
> -	FedFsStatus status;
> -	union {
> -		FedFsLookupResOk resok;
> -		u_int ldapResultCode;
> -		FedFsNsdbName targetNsdb;
> -		FedFsLookupResReferralVal resReferralVal;
> -	} FedFsLookupRes_u;
> -};
> -typedef struct FedFsLookupRes FedFsLookupRes;
> -
> -enum FedFsConnectionSec {
> -	FEDFS_SEC_NONE = 0,
> -	FEDFS_SEC_TLS = 1,
> -};
> -typedef enum FedFsConnectionSec FedFsConnectionSec;
> -
> -struct FedFsNsdbParams {
> -	FedFsConnectionSec secType;
> -	union {
> -		struct {
> -			u_int secData_len;
> -			char *secData_val;
> -		} secData;
> -	} FedFsNsdbParams_u;
> -};
> -typedef struct FedFsNsdbParams FedFsNsdbParams;
> -
> -struct FedFsSetNsdbParamsArgs {
> -	FedFsNsdbName nsdbName;
> -	FedFsNsdbParams params;
> -};
> -typedef struct FedFsSetNsdbParamsArgs FedFsSetNsdbParamsArgs;
> -
> -struct FedFsGetNsdbParamsRes {
> -	FedFsStatus status;
> -	union {
> -		FedFsNsdbParams params;
> -	} FedFsGetNsdbParamsRes_u;
> -};
> -typedef struct FedFsGetNsdbParamsRes FedFsGetNsdbParamsRes;
> -
> -struct FedFsGetLimitedNsdbParamsRes {
> -	FedFsStatus status;
> -	union {
> -		FedFsConnectionSec secType;
> -	} FedFsGetLimitedNsdbParamsRes_u;
> -};
> -typedef struct FedFsGetLimitedNsdbParamsRes FedFsGetLimitedNsdbParamsRes;
> -#define FEDFS_ADMIN_X
> -
> -#define FEDFS_PROG 100418
> -#define FEDFS_V1 1
> -
> -#if defined(__STDC__) || defined(__cplusplus)
> -#define FEDFS_NULL 0
> -extern  void * fedfs_null_1(void *, CLIENT *);
> -extern  void * fedfs_null_1_svc(void *, struct svc_req *);
> -#define FEDFS_CREATE_JUNCTION 1
> -extern  FedFsStatus * fedfs_create_junction_1(FedFsCreateArgs *, CLIENT *);
> -extern  FedFsStatus * fedfs_create_junction_1_svc(FedFsCreateArgs *, struct svc_req *);
> -#define FEDFS_DELETE_JUNCTION 2
> -extern  FedFsStatus * fedfs_delete_junction_1(FedFsPath *, CLIENT *);
> -extern  FedFsStatus * fedfs_delete_junction_1_svc(FedFsPath *, struct svc_req *);
> -#define FEDFS_LOOKUP_JUNCTION 3
> -extern  FedFsLookupRes * fedfs_lookup_junction_1(FedFsLookupArgs *, CLIENT *);
> -extern  FedFsLookupRes * fedfs_lookup_junction_1_svc(FedFsLookupArgs *, struct svc_req *);
> -#define FEDFS_CREATE_REPLICATION 7
> -extern  FedFsStatus * fedfs_create_replication_1(FedFsCreateArgs *, CLIENT *);
> -extern  FedFsStatus * fedfs_create_replication_1_svc(FedFsCreateArgs *, struct svc_req *);
> -#define FEDFS_DELETE_REPLICATION 8
> -extern  FedFsStatus * fedfs_delete_replication_1(FedFsPath *, CLIENT *);
> -extern  FedFsStatus * fedfs_delete_replication_1_svc(FedFsPath *, struct svc_req *);
> -#define FEDFS_LOOKUP_REPLICATION 9
> -extern  FedFsLookupRes * fedfs_lookup_replication_1(FedFsLookupArgs *, CLIENT *);
> -extern  FedFsLookupRes * fedfs_lookup_replication_1_svc(FedFsLookupArgs *, struct svc_req *);
> -#define FEDFS_SET_NSDB_PARAMS 4
> -extern  FedFsStatus * fedfs_set_nsdb_params_1(FedFsSetNsdbParamsArgs *, CLIENT *);
> -extern  FedFsStatus * fedfs_set_nsdb_params_1_svc(FedFsSetNsdbParamsArgs *, struct svc_req *);
> -#define FEDFS_GET_NSDB_PARAMS 5
> -extern  FedFsGetNsdbParamsRes * fedfs_get_nsdb_params_1(FedFsNsdbName *, CLIENT *);
> -extern  FedFsGetNsdbParamsRes * fedfs_get_nsdb_params_1_svc(FedFsNsdbName *, struct svc_req *);
> -#define FEDFS_GET_LIMITED_NSDB_PARAMS 6
> -extern  FedFsGetLimitedNsdbParamsRes * fedfs_get_limited_nsdb_params_1(FedFsNsdbName *, CLIENT *);
> -extern  FedFsGetLimitedNsdbParamsRes * fedfs_get_limited_nsdb_params_1_svc(FedFsNsdbName *, struct svc_req *);
> -extern int fedfs_prog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
> -
> -#else /* K&R C */
> -#define FEDFS_NULL 0
> -extern  void * fedfs_null_1();
> -extern  void * fedfs_null_1_svc();
> -#define FEDFS_CREATE_JUNCTION 1
> -extern  FedFsStatus * fedfs_create_junction_1();
> -extern  FedFsStatus * fedfs_create_junction_1_svc();
> -#define FEDFS_DELETE_JUNCTION 2
> -extern  FedFsStatus * fedfs_delete_junction_1();
> -extern  FedFsStatus * fedfs_delete_junction_1_svc();
> -#define FEDFS_LOOKUP_JUNCTION 3
> -extern  FedFsLookupRes * fedfs_lookup_junction_1();
> -extern  FedFsLookupRes * fedfs_lookup_junction_1_svc();
> -#define FEDFS_CREATE_REPLICATION 7
> -extern  FedFsStatus * fedfs_create_replication_1();
> -extern  FedFsStatus * fedfs_create_replication_1_svc();
> -#define FEDFS_DELETE_REPLICATION 8
> -extern  FedFsStatus * fedfs_delete_replication_1();
> -extern  FedFsStatus * fedfs_delete_replication_1_svc();
> -#define FEDFS_LOOKUP_REPLICATION 9
> -extern  FedFsLookupRes * fedfs_lookup_replication_1();
> -extern  FedFsLookupRes * fedfs_lookup_replication_1_svc();
> -#define FEDFS_SET_NSDB_PARAMS 4
> -extern  FedFsStatus * fedfs_set_nsdb_params_1();
> -extern  FedFsStatus * fedfs_set_nsdb_params_1_svc();
> -#define FEDFS_GET_NSDB_PARAMS 5
> -extern  FedFsGetNsdbParamsRes * fedfs_get_nsdb_params_1();
> -extern  FedFsGetNsdbParamsRes * fedfs_get_nsdb_params_1_svc();
> -#define FEDFS_GET_LIMITED_NSDB_PARAMS 6
> -extern  FedFsGetLimitedNsdbParamsRes * fedfs_get_limited_nsdb_params_1();
> -extern  FedFsGetLimitedNsdbParamsRes * fedfs_get_limited_nsdb_params_1_svc();
> -extern int fedfs_prog_1_freeresult ();
> -#endif /* K&R C */
> -
> -/* the xdr functions */
> -
> -#if defined(__STDC__) || defined(__cplusplus)
> -extern  bool_t xdr_FedFsStatus (XDR *, FedFsStatus*);
> -extern  bool_t xdr_utf8string (XDR *, utf8string*);
> -extern  bool_t xdr_ascii_REQUIRED4 (XDR *, ascii_REQUIRED4*);
> -extern  bool_t xdr_utf8val_REQUIRED4 (XDR *, utf8val_REQUIRED4*);
> -extern  bool_t xdr_FedFsUuid (XDR *, FedFsUuid);
> -extern  bool_t xdr_FedFsNsdbName (XDR *, FedFsNsdbName*);
> -extern  bool_t xdr_FedFsPathComponent (XDR *, FedFsPathComponent*);
> -extern  bool_t xdr_FedFsPathName (XDR *, FedFsPathName*);
> -extern  bool_t xdr_FedFsFsn (XDR *, FedFsFsn*);
> -extern  bool_t xdr_FedFsFslType (XDR *, FedFsFslType*);
> -extern  bool_t xdr_FedFsNfsFsl (XDR *, FedFsNfsFsl*);
> -extern  bool_t xdr_FedFsFsl (XDR *, FedFsFsl*);
> -extern  bool_t xdr_FedFsPathType (XDR *, FedFsPathType*);
> -extern  bool_t xdr_FedFsPath (XDR *, FedFsPath*);
> -extern  bool_t xdr_FedFsCreateArgs (XDR *, FedFsCreateArgs*);
> -extern  bool_t xdr_FedFsResolveType (XDR *, FedFsResolveType*);
> -extern  bool_t xdr_FedFsLookupArgs (XDR *, FedFsLookupArgs*);
> -extern  bool_t xdr_FedFsLookupResOk (XDR *, FedFsLookupResOk*);
> -extern  bool_t xdr_FedFsLookupResReferralVal (XDR *, FedFsLookupResReferralVal*);
> -extern  bool_t xdr_FedFsLookupRes (XDR *, FedFsLookupRes*);
> -extern  bool_t xdr_FedFsConnectionSec (XDR *, FedFsConnectionSec*);
> -extern  bool_t xdr_FedFsNsdbParams (XDR *, FedFsNsdbParams*);
> -extern  bool_t xdr_FedFsSetNsdbParamsArgs (XDR *, FedFsSetNsdbParamsArgs*);
> -extern  bool_t xdr_FedFsGetNsdbParamsRes (XDR *, FedFsGetNsdbParamsRes*);
> -extern  bool_t xdr_FedFsGetLimitedNsdbParamsRes (XDR *, FedFsGetLimitedNsdbParamsRes*);
> -
> -#else /* K&R C */
> -extern bool_t xdr_FedFsStatus ();
> -extern bool_t xdr_utf8string ();
> -extern bool_t xdr_ascii_REQUIRED4 ();
> -extern bool_t xdr_utf8val_REQUIRED4 ();
> -extern bool_t xdr_FedFsUuid ();
> -extern bool_t xdr_FedFsNsdbName ();
> -extern bool_t xdr_FedFsPathComponent ();
> -extern bool_t xdr_FedFsPathName ();
> -extern bool_t xdr_FedFsFsn ();
> -extern bool_t xdr_FedFsFslType ();
> -extern bool_t xdr_FedFsNfsFsl ();
> -extern bool_t xdr_FedFsFsl ();
> -extern bool_t xdr_FedFsPathType ();
> -extern bool_t xdr_FedFsPath ();
> -extern bool_t xdr_FedFsCreateArgs ();
> -extern bool_t xdr_FedFsResolveType ();
> -extern bool_t xdr_FedFsLookupArgs ();
> -extern bool_t xdr_FedFsLookupResOk ();
> -extern bool_t xdr_FedFsLookupResReferralVal ();
> -extern bool_t xdr_FedFsLookupRes ();
> -extern bool_t xdr_FedFsConnectionSec ();
> -extern bool_t xdr_FedFsNsdbParams ();
> -extern bool_t xdr_FedFsSetNsdbParamsArgs ();
> -extern bool_t xdr_FedFsGetNsdbParamsRes ();
> -extern bool_t xdr_FedFsGetLimitedNsdbParamsRes ();
> -
> -#endif /* K&R C */
> -
> -#ifdef __cplusplus
> -}
> -#endif
> -
> -#endif /* !_FEDFS_ADMIN_H_RPCGEN */
> diff --git a/support/include/junction.h b/support/include/junction.h
> index 67cf017..7257d80 100644
> --- a/support/include/junction.h
> +++ b/support/include/junction.h
> @@ -28,8 +28,51 @@
>  
>  #include <stdint.h>
>  
> -/* Machine-generated XDR definitions for FedFS Admin protocol */
> -#include "fedfs_admin.h"
> +/*
> + * The libjunction APIs use the status codes from the FedFS ADMIN
> + * protocol, which includes non-errno codes like FEDFS_ERR_NOTJUNCT.
> + */
> +enum FedFsStatus {
> +	FEDFS_OK = 0,
> +	FEDFS_ERR_ACCESS = 1,
> +	FEDFS_ERR_BADCHAR = 2,
> +	FEDFS_ERR_BADNAME = 3,
> +	FEDFS_ERR_NAMETOOLONG = 4,
> +	FEDFS_ERR_LOOP = 5,
> +	FEDFS_ERR_BADXDR = 6,
> +	FEDFS_ERR_EXIST = 7,
> +	FEDFS_ERR_INVAL = 8,
> +	FEDFS_ERR_IO = 9,
> +	FEDFS_ERR_NOSPC = 10,
> +	FEDFS_ERR_NOTJUNCT = 11,
> +	FEDFS_ERR_NOTLOCAL = 12,
> +	FEDFS_ERR_PERM = 13,
> +	FEDFS_ERR_ROFS = 14,
> +	FEDFS_ERR_SVRFAULT = 15,
> +	FEDFS_ERR_NOTSUPP = 16,
> +	FEDFS_ERR_NSDB_ROUTE = 17,
> +	FEDFS_ERR_NSDB_DOWN = 18,
> +	FEDFS_ERR_NSDB_CONN = 19,
> +	FEDFS_ERR_NSDB_AUTH = 20,
> +	FEDFS_ERR_NSDB_LDAP = 21,
> +	FEDFS_ERR_NSDB_LDAP_VAL = 22,
> +	FEDFS_ERR_NSDB_NONCE = 23,
> +	FEDFS_ERR_NSDB_NOFSN = 24,
> +	FEDFS_ERR_NSDB_NOFSL = 25,
> +	FEDFS_ERR_NSDB_RESPONSE = 26,
> +	FEDFS_ERR_NSDB_FAULT = 27,
> +	FEDFS_ERR_NSDB_PARAMS = 28,
> +	FEDFS_ERR_NSDB_LDAP_REFERRAL = 29,
> +	FEDFS_ERR_NSDB_LDAP_REFERRAL_VAL = 30,
> +	FEDFS_ERR_NSDB_LDAP_REFERRAL_NOTFOLLOWED = 31,
> +	FEDFS_ERR_NSDB_PARAMS_LDAP_REFERRAL = 32,
> +	FEDFS_ERR_PATH_TYPE_UNSUPP = 33,
> +	FEDFS_ERR_DELAY = 34,
> +	FEDFS_ERR_NO_CACHE = 35,
> +	FEDFS_ERR_UNKNOWN_CACHE = 36,
> +	FEDFS_ERR_NO_CACHE_UPDATE = 37,
> +};
> +typedef enum FedFsStatus FedFsStatus;
>  
>  /**
>   * Contains NFS fileset location information
> diff --git a/support/junction/path.c b/support/junction/path.c
> index d33808f..68a1d13 100644
> --- a/support/junction/path.c
> +++ b/support/junction/path.c
> @@ -33,6 +33,7 @@
>  #include <stdio.h>
>  #include <string.h>
>  #include <errno.h>
> +#include <dirent.h>
>  
>  #include <netinet/in.h>
>  
> diff --git a/utils/nfsref/add.c b/utils/nfsref/add.c
> index d5d0cf8..781aeee 100644
> --- a/utils/nfsref/add.c
> +++ b/utils/nfsref/add.c
> @@ -29,6 +29,7 @@
>  #include <stdbool.h>
>  #include <stdint.h>
>  #include <stdlib.h>
> +#include <string.h>
>  #include <stdio.h>
>  #include <unistd.h>
>  #include <errno.h>
> diff --git a/utils/nfsref/nfsref.c b/utils/nfsref/nfsref.c
> index ff7013e..7f97d01 100644
> --- a/utils/nfsref/nfsref.c
> +++ b/utils/nfsref/nfsref.c
> @@ -33,6 +33,7 @@
>  #include <stdlib.h>
>  #include <stdio.h>
>  #include <unistd.h>
> +#include <string.h>
>  #include <fcntl.h>
>  #include <getopt.h>
>  #include <time.h>
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux