diff options
author | Tim Prouty <tprouty@samba.org> | 2009-06-15 12:13:31 -0700 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-06-15 14:03:40 -0700 |
commit | 6f335036fda47a6903b21287824d88333d1b526f (patch) | |
tree | 80651a922b95e70d70550dd91b0b0da99ddc313b /source3/modules/vfs_onefs_shadow_copy.c | |
parent | efccef09aec93180a06955b5e03f1ceb99dc39e8 (diff) | |
download | samba-6f335036fda47a6903b21287824d88333d1b526f.tar.gz samba-6f335036fda47a6903b21287824d88333d1b526f.tar.bz2 samba-6f335036fda47a6903b21287824d88333d1b526f.zip |
s3 onefs: Change onefs modules to use the new createfile api
Diffstat (limited to 'source3/modules/vfs_onefs_shadow_copy.c')
-rw-r--r-- | source3/modules/vfs_onefs_shadow_copy.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/source3/modules/vfs_onefs_shadow_copy.c b/source3/modules/vfs_onefs_shadow_copy.c index 28bc0c5081..3d4ffc9084 100644 --- a/source3/modules/vfs_onefs_shadow_copy.c +++ b/source3/modules/vfs_onefs_shadow_copy.c @@ -143,6 +143,27 @@ onefs_shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, return ret; \ } while (0) \ +/* + * XXX: Convert osc_canonicalize_path to use talloc instead of malloc. + */ +#define SHADOW_NEXT_SMB_FNAME(op, args, rtype) do { \ + char *smb_base_name_tmp = NULL; \ + char *cpath = NULL; \ + char *snap_component = NULL; \ + rtype ret; \ + smb_base_name_tmp = smb_fname->base_name; \ + if (shadow_copy_match_name(smb_fname->base_name, \ + &snap_component)) { \ + cpath = osc_canonicalize_path(smb_fname->base_name, \ + snap_component); \ + smb_fname->base_name = cpath; \ + } \ + ret = SMB_VFS_NEXT_ ## op args; \ + smb_fname->base_name = smb_base_name_tmp; \ + SAFE_FREE(cpath); \ + return ret; \ + } while (0) \ + static uint64_t @@ -205,8 +226,7 @@ static NTSTATUS onefs_shadow_copy_create_file(vfs_handle_struct *handle, struct smb_request *req, uint16_t root_dir_fid, - const char *path, - uint32_t create_file_flags, + struct smb_filename *smb_fname, uint32_t access_mask, uint32_t share_access, uint32_t create_disposition, @@ -217,16 +237,15 @@ onefs_shadow_copy_create_file(vfs_handle_struct *handle, struct security_descriptor *sd, struct ea_list *ea_list, files_struct **result, - int *pinfo, - SMB_STRUCT_STAT *psbuf) -{ - SHADOW_NEXT(CREATE_FILE, - (handle, req, root_dir_fid, cpath ?: path, - create_file_flags, access_mask, share_access, - create_disposition, create_options, file_attributes, - oplock_request, allocation_size, sd, ea_list, result, - pinfo, psbuf), - NTSTATUS); + int *pinfo) +{ + SHADOW_NEXT_SMB_FNAME(CREATE_FILE, + (handle, req, root_dir_fid, smb_fname, + access_mask, share_access, + create_disposition, create_options, + file_attributes, oplock_request, + allocation_size, sd, ea_list, result, pinfo), + NTSTATUS); } /** |