From: Anoop C S Date: Fri, 11 Jul 2025 15:10:12 +0000 (+0530) Subject: vfs: Convert pread, pwrite and fsync recv interfaces to macros X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd3003a28b13d96cb3b94fe0bdaff23409cda0b8;p=thirdparty%2Fsamba.git vfs: Convert pread, pwrite and fsync recv interfaces to macros Following the common convention of using uppercase letters for macros, convert SMB_VFS_PREAD_RECV, SMB_VFS_PWRITE_RECV and SMB_VFS_FSYNC_RECV functions to equivalent macros. Signed-off-by: Anoop C S Reviewed-by: Ralph Boehme Autobuild-User(master): Anoop C S Autobuild-Date(master): Fri Aug 8 13:04:52 UTC 2025 on atb-devel-224 --- diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 75b81648108..ac81b259f21 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -1515,7 +1515,8 @@ struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset); -ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, struct vfs_aio_state *state); +ssize_t smb_vfs_call_pread_recv(struct tevent_req *req, + struct vfs_aio_state *state); ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, @@ -1526,7 +1527,8 @@ struct tevent_req *smb_vfs_call_pwrite_send(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, off_t offset); -ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, struct vfs_aio_state *state); +ssize_t smb_vfs_call_pwrite_recv(struct tevent_req *req, + struct vfs_aio_state *state); off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, @@ -1548,7 +1550,8 @@ struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct files_struct *fsp); -int SMB_VFS_FSYNC_RECV(struct tevent_req *req, struct vfs_aio_state *state); +int smb_vfs_call_fsync_recv(struct tevent_req *req, + struct vfs_aio_state *state); int smb_vfs_fsync_sync(files_struct *fsp); int smb_vfs_call_stat(struct vfs_handle_struct *handle, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 723fd48635a..f2d8174369a 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -163,9 +163,14 @@ #define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \ smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ (fsp), (data), (n), (off)) +#define SMB_VFS_PREAD_RECV(req, aio_state) \ + smb_vfs_call_pread_recv((req), (aio_state)) + #define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \ smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \ (data), (n), (off)) +#define SMB_VFS_NEXT_PREAD_RECV(req, aio_state) \ + smb_vfs_call_pread_recv((req), (aio_state)) #define SMB_VFS_PWRITE(fsp, data, n, off) \ smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off)) @@ -175,9 +180,14 @@ #define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \ smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ (fsp), (data), (n), (off)) +#define SMB_VFS_PWRITE_RECV(req, aio_state) \ + smb_vfs_call_pwrite_recv((req), (aio_state)) + #define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \ smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \ (data), (n), (off)) +#define SMB_VFS_NEXT_PWRITE_RECV(req, aio_state) \ + smb_vfs_call_pwrite_recv((req), (aio_state)) #define SMB_VFS_LSEEK(fsp, offset, whence) \ smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence)) @@ -202,8 +212,13 @@ #define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \ smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \ (fsp)) +#define SMB_VFS_FSYNC_RECV(req, aio_state) \ + smb_vfs_call_fsync_recv((req), (aio_state)) + #define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \ smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp)) +#define SMB_VFS_NEXT_FSYNC_RECV(req, aio_state) \ + smb_vfs_call_fsync_recv((req), (aio_state)) #define SMB_VFS_STAT(conn, smb_fname) \ smb_vfs_call_stat((conn)->vfs_handles, (smb_fname)) diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 76895f52e03..82fe586506f 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1687,8 +1687,8 @@ static void smb_vfs_call_pread_done(struct tevent_req *subreq) tevent_req_done(req); } -ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, - struct vfs_aio_state *vfs_aio_state) +ssize_t smb_vfs_call_pread_recv(struct tevent_req *req, + struct vfs_aio_state *vfs_aio_state) { struct smb_vfs_call_pread_state *state = tevent_req_data( req, struct smb_vfs_call_pread_state); @@ -1763,8 +1763,8 @@ static void smb_vfs_call_pwrite_done(struct tevent_req *subreq) tevent_req_done(req); } -ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, - struct vfs_aio_state *vfs_aio_state) +ssize_t smb_vfs_call_pwrite_recv(struct tevent_req *req, + struct vfs_aio_state *vfs_aio_state) { struct smb_vfs_call_pwrite_state *state = tevent_req_data( req, struct smb_vfs_call_pwrite_state); @@ -1869,7 +1869,8 @@ static void smb_vfs_call_fsync_done(struct tevent_req *subreq) tevent_req_done(req); } -int SMB_VFS_FSYNC_RECV(struct tevent_req *req, struct vfs_aio_state *vfs_aio_state) +int smb_vfs_call_fsync_recv(struct tevent_req *req, + struct vfs_aio_state *vfs_aio_state) { struct smb_vfs_call_fsync_state *state = tevent_req_data( req, struct smb_vfs_call_fsync_state);