Skip to content

Commit fd3003a

Browse files
committed
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 <anoopcs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Anoop C S <anoopcs@samba.org> Autobuild-Date(master): Fri Aug 8 13:04:52 UTC 2025 on atb-devel-224
1 parent 68515aa commit fd3003a

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

source3/include/vfs.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,8 @@ struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle,
15151515
struct files_struct *fsp,
15161516
void *data,
15171517
size_t n, off_t offset);
1518-
ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, struct vfs_aio_state *state);
1518+
ssize_t smb_vfs_call_pread_recv(struct tevent_req *req,
1519+
struct vfs_aio_state *state);
15191520

15201521
ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle,
15211522
struct files_struct *fsp, const void *data,
@@ -1526,7 +1527,8 @@ struct tevent_req *smb_vfs_call_pwrite_send(struct vfs_handle_struct *handle,
15261527
struct files_struct *fsp,
15271528
const void *data,
15281529
size_t n, off_t offset);
1529-
ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, struct vfs_aio_state *state);
1530+
ssize_t smb_vfs_call_pwrite_recv(struct tevent_req *req,
1531+
struct vfs_aio_state *state);
15301532

15311533
off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle,
15321534
struct files_struct *fsp, off_t offset,
@@ -1548,7 +1550,8 @@ struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle,
15481550
TALLOC_CTX *mem_ctx,
15491551
struct tevent_context *ev,
15501552
struct files_struct *fsp);
1551-
int SMB_VFS_FSYNC_RECV(struct tevent_req *req, struct vfs_aio_state *state);
1553+
int smb_vfs_call_fsync_recv(struct tevent_req *req,
1554+
struct vfs_aio_state *state);
15521555

15531556
int smb_vfs_fsync_sync(files_struct *fsp);
15541557
int smb_vfs_call_stat(struct vfs_handle_struct *handle,

source3/include/vfs_macros.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,14 @@
163163
#define SMB_VFS_PREAD_SEND(mem_ctx, ev, fsp, data, n, off) \
164164
smb_vfs_call_pread_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
165165
(fsp), (data), (n), (off))
166+
#define SMB_VFS_PREAD_RECV(req, aio_state) \
167+
smb_vfs_call_pread_recv((req), (aio_state))
168+
166169
#define SMB_VFS_NEXT_PREAD_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
167170
smb_vfs_call_pread_send((handle)->next, (mem_ctx), (ev), (fsp), \
168171
(data), (n), (off))
172+
#define SMB_VFS_NEXT_PREAD_RECV(req, aio_state) \
173+
smb_vfs_call_pread_recv((req), (aio_state))
169174

170175
#define SMB_VFS_PWRITE(fsp, data, n, off) \
171176
smb_vfs_call_pwrite((fsp)->conn->vfs_handles, (fsp), (data), (n), (off))
@@ -175,9 +180,14 @@
175180
#define SMB_VFS_PWRITE_SEND(mem_ctx, ev, fsp, data, n, off) \
176181
smb_vfs_call_pwrite_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
177182
(fsp), (data), (n), (off))
183+
#define SMB_VFS_PWRITE_RECV(req, aio_state) \
184+
smb_vfs_call_pwrite_recv((req), (aio_state))
185+
178186
#define SMB_VFS_NEXT_PWRITE_SEND(mem_ctx, ev, handle, fsp, data, n, off) \
179187
smb_vfs_call_pwrite_send((handle)->next, (mem_ctx), (ev), (fsp), \
180188
(data), (n), (off))
189+
#define SMB_VFS_NEXT_PWRITE_RECV(req, aio_state) \
190+
smb_vfs_call_pwrite_recv((req), (aio_state))
181191

182192
#define SMB_VFS_LSEEK(fsp, offset, whence) \
183193
smb_vfs_call_lseek((fsp)->conn->vfs_handles, (fsp), (offset), (whence))
@@ -202,8 +212,13 @@
202212
#define SMB_VFS_FSYNC_SEND(mem_ctx, ev, fsp) \
203213
smb_vfs_call_fsync_send((fsp)->conn->vfs_handles, (mem_ctx), (ev), \
204214
(fsp))
215+
#define SMB_VFS_FSYNC_RECV(req, aio_state) \
216+
smb_vfs_call_fsync_recv((req), (aio_state))
217+
205218
#define SMB_VFS_NEXT_FSYNC_SEND(mem_ctx, ev, handle, fsp) \
206219
smb_vfs_call_fsync_send((handle)->next, (mem_ctx), (ev), (fsp))
220+
#define SMB_VFS_NEXT_FSYNC_RECV(req, aio_state) \
221+
smb_vfs_call_fsync_recv((req), (aio_state))
207222

208223
#define SMB_VFS_STAT(conn, smb_fname) \
209224
smb_vfs_call_stat((conn)->vfs_handles, (smb_fname))

source3/smbd/vfs.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,8 +1687,8 @@ static void smb_vfs_call_pread_done(struct tevent_req *subreq)
16871687
tevent_req_done(req);
16881688
}
16891689

1690-
ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req,
1691-
struct vfs_aio_state *vfs_aio_state)
1690+
ssize_t smb_vfs_call_pread_recv(struct tevent_req *req,
1691+
struct vfs_aio_state *vfs_aio_state)
16921692
{
16931693
struct smb_vfs_call_pread_state *state = tevent_req_data(
16941694
req, struct smb_vfs_call_pread_state);
@@ -1763,8 +1763,8 @@ static void smb_vfs_call_pwrite_done(struct tevent_req *subreq)
17631763
tevent_req_done(req);
17641764
}
17651765

1766-
ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req,
1767-
struct vfs_aio_state *vfs_aio_state)
1766+
ssize_t smb_vfs_call_pwrite_recv(struct tevent_req *req,
1767+
struct vfs_aio_state *vfs_aio_state)
17681768
{
17691769
struct smb_vfs_call_pwrite_state *state = tevent_req_data(
17701770
req, struct smb_vfs_call_pwrite_state);
@@ -1869,7 +1869,8 @@ static void smb_vfs_call_fsync_done(struct tevent_req *subreq)
18691869
tevent_req_done(req);
18701870
}
18711871

1872-
int SMB_VFS_FSYNC_RECV(struct tevent_req *req, struct vfs_aio_state *vfs_aio_state)
1872+
int smb_vfs_call_fsync_recv(struct tevent_req *req,
1873+
struct vfs_aio_state *vfs_aio_state)
18731874
{
18741875
struct smb_vfs_call_fsync_state *state = tevent_req_data(
18751876
req, struct smb_vfs_call_fsync_state);

0 commit comments

Comments
 (0)