Skip to content

Commit f512744

Browse files
sahlbergvincentkfu
authored andcommitted
nfs: add support for new libnfs API
New update of libnfs will have a new API that changes some signatures, primarily in order to make nfs_[p]read[_async] calls zero-copy in the sense that (almost) no data copy is done in the library and READ3/READ4 payloads are read straigth from the socket into the application buffer. In-library zero-copy only works for !krb5 and !tls sessions but can provide significant boost for read-intensive workloads when can be used. Signed-off-by: Ronnie Sahlberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vincent Fu <[email protected]>
1 parent 6f3de5c commit f512744

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

engines/nfs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,28 @@ static int queue_write(struct fio_libnfs_options *o, struct io_u *io_u)
157157
{
158158
struct nfs_data *nfs_data = io_u->engine_data;
159159

160+
#ifdef LIBNFS_API_V2
161+
return nfs_pwrite_async(o->context, nfs_data->nfsfh,
162+
io_u->buf, io_u->buflen, io_u->offset,
163+
nfs_callback, io_u);
164+
#else
160165
return nfs_pwrite_async(o->context, nfs_data->nfsfh, io_u->offset,
161166
io_u->buflen, io_u->buf, nfs_callback, io_u);
167+
#endif
162168
}
163169

164170
static int queue_read(struct fio_libnfs_options *o, struct io_u *io_u)
165171
{
166172
struct nfs_data *nfs_data = io_u->engine_data;
167173

174+
#ifdef LIBNFS_API_V2
175+
return nfs_pread_async(o->context, nfs_data->nfsfh,
176+
io_u->buf, io_u->buflen, io_u->offset,
177+
nfs_callback, io_u);
178+
#else
168179
return nfs_pread_async(o->context, nfs_data->nfsfh, io_u->offset,
169180
io_u->buflen, nfs_callback, io_u);
181+
#endif
170182
}
171183

172184
static enum fio_q_status fio_libnfs_queue(struct thread_data *td,

0 commit comments

Comments
 (0)