vfs_fruit: remove xattr code from the AppleDouble subsystem
authorRalph Boehme <slow@samba.org>
Wed, 22 May 2019 19:15:22 +0000 (21:15 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 May 2019 20:19:27 +0000 (20:19 +0000)
The subsystem consumers have been reworked in the previous commits, so this is
not used anymore. ad_init() doesn't need a handle argument anymore due to this,
remove it as well.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13968

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_fruit.c

index ba53abfdd6a3f6955ef78e5bb1ac49575dd30577..8daf19319d778de43596af1e2971b632f4d28b96 100644 (file)
@@ -451,18 +451,6 @@ struct ad_entry_order entry_order_dot_und[ADEID_NUM_DOT_UND + 1] = {
        {0, 0, 0}
 };
 
-/*
- * Fake AppleDouble entry oder for resource fork xattr.  The xattr
- * isn't an AppleDouble file, it simply contains the resource data,
- * but in order to be able to use some API calls like ad_getentryoff()
- * we build a fake/helper struct adouble with this entry order struct.
- */
-static const
-struct ad_entry_order entry_order_rsrc_xattr[ADEID_NUM_RSRC_XATTR + 1] = {
-       {ADEID_RFORK, 0, 0},
-       {0, 0, 0}
-};
-
 /* Conversion from enumerated id to on-disk AppleDouble id */
 #define AD_EID_DISK(a) (set_eid[a])
 static const uint32_t set_eid[] = {
@@ -534,7 +522,7 @@ struct fio {
 /*
  * Forward declarations
  */
-static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
+static struct adouble *ad_init(TALLOC_CTX *ctx,
                               adouble_type_t type);
 static struct adouble *ad_get(TALLOC_CTX *ctx,
                              vfs_handle_struct *handle,
@@ -1775,25 +1763,19 @@ static int adouble_destructor(struct adouble *ad)
  *
  * @return               adouble handle
  **/
-static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle,
+static struct adouble *ad_alloc(TALLOC_CTX *ctx,
                                adouble_type_t type)
 {
        int rc = 0;
        size_t adsize = 0;
        struct adouble *ad;
-       struct fruit_config_data *config;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct fruit_config_data, return NULL);
 
        switch (type) {
        case ADOUBLE_META:
                adsize = AD_DATASZ_XATTR;
                break;
        case ADOUBLE_RSRC:
-               if (config->rsrc == FRUIT_RSRC_ADFILE) {
-                       adsize = AD_DATASZ_DOT_UND;
-               }
+               adsize = AD_DATASZ_DOT_UND;
                break;
        default:
                return NULL;
@@ -1831,12 +1813,11 @@ exit:
  * Allocate and initialize a new struct adouble
  *
  * @param[in] ctx        talloc context
- * @param[in] handle     vfs handle
  * @param[in] type       type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC
  *
  * @return               adouble handle, initialized
  **/
-static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
+static struct adouble *ad_init(TALLOC_CTX *ctx,
                               adouble_type_t type)
 {
        int rc = 0;
@@ -1855,7 +1836,7 @@ static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
                return NULL;
        }
 
-       ad = ad_alloc(ctx, handle, type);
+       ad = ad_alloc(ctx, type);
        if (ad == NULL) {
                return NULL;
        }
@@ -1897,7 +1878,7 @@ static struct adouble *ad_get_internal(TALLOC_CTX *ctx,
                   type == ADOUBLE_META ? "meta" : "rsrc",
                   smb_fname->base_name));
 
-       ad = ad_alloc(ctx, handle, type);
+       ad = ad_alloc(ctx, type);
        if (ad == NULL) {
                rc = -1;
                goto exit;
@@ -3578,7 +3559,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle,
        }
 
        if (flags & (O_CREAT | O_TRUNC)) {
-               ad = ad_init(fsp, handle, ADOUBLE_RSRC);
+               ad = ad_init(fsp, ADOUBLE_RSRC);
                if (ad == NULL) {
                        rc = -1;
                        goto exit;
@@ -4658,7 +4639,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle,
 
        ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_META);
        if (ad == NULL) {
-               ad = ad_init(talloc_tos(), handle, ADOUBLE_META);
+               ad = ad_init(talloc_tos(), ADOUBLE_META);
                if (ad == NULL) {
                        return -1;
                }