vfs_fruit: pass handle to ad_fset()
authorRalph Boehme <slow@samba.org>
Fri, 17 May 2019 08:41:29 +0000 (10:41 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 30 May 2019 20:19:26 +0000 (20:19 +0000)
On the course of removing ad_handle from struct adouble, step 1.

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 9e22a1338ae0b572c06c88f7f655e080745ade49..5f4ae06d845fa62b2eb0a06b87855a8221d0e28d 100644 (file)
@@ -542,7 +542,9 @@ static struct adouble *ad_get(TALLOC_CTX *ctx,
                              const struct smb_filename *smb_fname,
                              adouble_type_t type);
 static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname);
-static int ad_fset(struct adouble *ad, files_struct *fsp);
+static int ad_fset(struct vfs_handle_struct *handle,
+                  struct adouble *ad,
+                  files_struct *fsp);
 static int adouble_path(TALLOC_CTX *ctx,
                        const struct smb_filename *smb_fname__in,
                        struct smb_filename **ppsmb_fname_out);
@@ -2067,7 +2069,9 @@ static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname)
  *
  * @return            status code, 0 means success
  **/
-static int ad_fset(struct adouble *ad, files_struct *fsp)
+static int ad_fset(struct vfs_handle_struct *handle,
+                  struct adouble *ad,
+                  files_struct *fsp)
 {
        int rc = -1;
        ssize_t len;
@@ -2089,7 +2093,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp)
 
        switch (ad->ad_type) {
        case ADOUBLE_META:
-               rc = SMB_VFS_NEXT_SETXATTR(ad->ad_handle,
+               rc = SMB_VFS_NEXT_SETXATTR(handle,
                                           fsp->fsp_name,
                                           AFPINFO_EA_NETATALK,
                                           ad->ad_data,
@@ -2097,7 +2101,7 @@ static int ad_fset(struct adouble *ad, files_struct *fsp)
                break;
 
        case ADOUBLE_RSRC:
-               len = SMB_VFS_NEXT_PWRITE(ad->ad_handle,
+               len = SMB_VFS_NEXT_PWRITE(handle,
                                          fsp,
                                          ad->ad_data,
                                          AD_DATASZ_DOT_UND,
@@ -3611,7 +3615,7 @@ static int fruit_open_rsrc_adouble(vfs_handle_struct *handle,
 
                fsp->fh->fd = hostfd;
 
-               rc = ad_fset(ad, fsp);
+               rc = ad_fset(handle, ad, fsp);
                fsp->fh->fd = -1;
                if (rc != 0) {
                        rc = -1;
@@ -4699,7 +4703,7 @@ static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle,
 
        memcpy(p, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
 
-       ret = ad_fset(ad, fsp);
+       ret = ad_fset(handle, ad, fsp);
        if (ret != 0) {
                DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp));
                TALLOC_FREE(ad);
@@ -4855,7 +4859,7 @@ static ssize_t fruit_pwrite_rsrc_adouble(vfs_handle_struct *handle,
 
        if ((n + offset) > ad_getentrylen(ad, ADEID_RFORK)) {
                ad_setentrylen(ad, ADEID_RFORK, n + offset);
-               ret = ad_fset(ad, fsp);
+               ret = ad_fset(handle, ad, fsp);
                if (ret != 0) {
                        DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp));
                        TALLOC_FREE(ad);
@@ -5957,7 +5961,7 @@ static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle,
 
        ad_setentrylen(ad, ADEID_RFORK, offset);
 
-       rc = ad_fset(ad, fsp);
+       rc = ad_fset(handle, ad, fsp);
        if (rc != 0) {
                DBG_ERR("ad_fset [%s] failed [%s]\n",
                        fsp_str_dbg(fsp), strerror(errno));