s3: Move up declaration of params struct and related function.
authorAlexander Werth <alexander.werth@de.ibm.com>
Mon, 15 Apr 2013 14:08:46 +0000 (16:08 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 May 2013 04:18:21 +0000 (06:18 +0200)
    We need the parameters earlier in the code so we move up
    the declaration of the params struct. Since reading the
    parameters is closely related the definition of the function
    smbacl4_get_vfs_params has also been moved up.

Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/nfs4_acls.c

index fa6b2fe2a00c9696e304cecb734025fc57ded65d..9d0651b417ef66ceda17cbdb75d9b21295dd384a 100644 (file)
@@ -54,6 +54,55 @@ typedef struct _SMB_ACL4_INT_T
        SMB_ACE4_INT_T  *last;
 } SMB_ACL4_INT_T;
 
+enum smbacl4_mode_enum {e_simple=0, e_special=1};
+enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
+
+typedef struct _smbacl4_vfs_params {
+       enum smbacl4_mode_enum mode;
+       bool do_chown;
+       enum smbacl4_acedup_enum acedup;
+} smbacl4_vfs_params;
+
+/*
+ * Gather special parameters for NFS4 ACL handling
+ */
+static int smbacl4_get_vfs_params(
+       const char *type_name,
+       files_struct *fsp,
+       smbacl4_vfs_params *params
+)
+{
+       static const struct enum_list enum_smbacl4_modes[] = {
+               { e_simple, "simple" },
+               { e_special, "special" },
+               { -1 , NULL }
+       };
+       static const struct enum_list enum_smbacl4_acedups[] = {
+               { e_dontcare, "dontcare" },
+               { e_reject, "reject" },
+               { e_ignore, "ignore" },
+               { e_merge, "merge" },
+               { -1 , NULL }
+       };
+
+       memset(params, 0, sizeof(smbacl4_vfs_params));
+       params->mode = (enum smbacl4_mode_enum)lp_parm_enum(
+               SNUM(fsp->conn), type_name,
+               "mode", enum_smbacl4_modes, e_simple);
+       params->do_chown = lp_parm_bool(SNUM(fsp->conn), type_name,
+               "chown", true);
+       params->acedup = (enum smbacl4_acedup_enum)lp_parm_enum(
+               SNUM(fsp->conn), type_name,
+               "acedup", enum_smbacl4_acedups, e_dontcare);
+
+       DEBUG(10, ("mode:%s, do_chown:%s, acedup: %s\n",
+               enum_smbacl4_modes[params->mode].name,
+               params->do_chown ? "true" : "false",
+               enum_smbacl4_acedups[params->acedup].name));
+
+       return 0;
+}
+
 /************************************************
  Split the ACE flag mapping between nfs4 and Windows
  into two separate functions rather than trying to do
@@ -462,55 +511,6 @@ NTSTATUS smb_get_nt_acl_nfs4(struct connection_struct *conn,
                                          theacl);
 }
 
-enum smbacl4_mode_enum {e_simple=0, e_special=1};
-enum smbacl4_acedup_enum {e_dontcare=0, e_reject=1, e_ignore=2, e_merge=3};
-
-typedef struct _smbacl4_vfs_params {
-       enum smbacl4_mode_enum mode;
-       bool do_chown;
-       enum smbacl4_acedup_enum acedup;
-} smbacl4_vfs_params;
-
-/*
- * Gather special parameters for NFS4 ACL handling
- */
-static int smbacl4_get_vfs_params(
-       const char *type_name,
-       files_struct *fsp,
-       smbacl4_vfs_params *params
-)
-{
-       static const struct enum_list enum_smbacl4_modes[] = {
-               { e_simple, "simple" },
-               { e_special, "special" },
-               { -1 , NULL }
-       };
-       static const struct enum_list enum_smbacl4_acedups[] = {
-               { e_dontcare, "dontcare" },
-               { e_reject, "reject" },
-               { e_ignore, "ignore" },
-               { e_merge, "merge" },
-               { -1 , NULL }
-       };
-
-       memset(params, 0, sizeof(smbacl4_vfs_params));
-       params->mode = (enum smbacl4_mode_enum)lp_parm_enum(
-               SNUM(fsp->conn), type_name,
-               "mode", enum_smbacl4_modes, e_simple);
-       params->do_chown = lp_parm_bool(SNUM(fsp->conn), type_name,
-               "chown", True);
-       params->acedup = (enum smbacl4_acedup_enum)lp_parm_enum(
-               SNUM(fsp->conn), type_name,
-               "acedup", enum_smbacl4_acedups, e_dontcare);
-
-       DEBUG(10, ("mode:%s, do_chown:%s, acedup: %s\n",
-               enum_smbacl4_modes[params->mode].name,
-               params->do_chown ? "true" : "false",
-               enum_smbacl4_acedups[params->acedup].name));
-
-       return 0;
-}
-
 static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *theacl)
 {
        SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl);