]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fruit: refactor fruit_stat_meta()
authorRalph Boehme <slow@samba.org>
Fri, 2 Dec 2016 10:05:50 +0000 (11:05 +0100)
committerUri Simchoni <uri@samba.org>
Wed, 1 Mar 2017 23:32:20 +0000 (00:32 +0100)
Handle config->meta in helper functions. No change in behaviour. The next step
will add the correct implementation of fruit_stat_meta_stream().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/modules/vfs_fruit.c

index d6430f82f63b2ac23809fb3280e81528bdba6e6a..6c391a1d244766538b928bb6fa69ffcc4eff3615 100644 (file)
@@ -3122,9 +3122,9 @@ static int fruit_stat_base(vfs_handle_struct *handle,
        return rc;
 }
 
-static int fruit_stat_meta(vfs_handle_struct *handle,
-                          struct smb_filename *smb_fname,
-                          bool follow_links)
+static int fruit_stat_meta_netatalk(vfs_handle_struct *handle,
+                                   struct smb_filename *smb_fname,
+                                   bool follow_links)
 {
        struct adouble *ad = NULL;
 
@@ -3147,6 +3147,30 @@ static int fruit_stat_meta(vfs_handle_struct *handle,
        return 0;
 }
 
+static int fruit_stat_meta(vfs_handle_struct *handle,
+                          struct smb_filename *smb_fname,
+                          bool follow_links)
+{
+       struct fruit_config_data *config = NULL;
+       int ret;
+
+       SMB_VFS_HANDLE_GET_DATA(handle, config,
+                               struct fruit_config_data, return -1);
+
+       switch (config->meta) {
+       case FRUIT_META_STREAM:
+       case FRUIT_META_NETATALK:
+               ret = fruit_stat_meta_netatalk(handle, smb_fname, follow_links);
+               break;
+
+       default:
+               DBG_ERR("Unexpected meta config [%d]\n", config->meta);
+               return -1;
+       }
+
+       return ret;
+}
+
 static int fruit_stat_rsrc(vfs_handle_struct *handle,
                           struct smb_filename *smb_fname,
                           bool follow_links)