Allow setting max read/write size from the api

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
master
Ronnie Sahlberg 2021-08-10 16:29:42 +10:00
parent af90dbfbcf
commit 965b1914ef
4 changed files with 28 additions and 6 deletions

View File

@ -27,8 +27,8 @@
#pragma comment(lib, "ws2_32.lib")
WSADATA wsaData;
#endif
#define SERVER "10.1.1.27"
#define EXPORT "/shared"
#define SERVER "10.10.10.11"
#define EXPORT "/data/SNAP-4"
#ifdef HAVE_POLL_H
#include <poll.h>

View File

@ -246,15 +246,25 @@ EXTERN void nfs_destroy_url(struct nfs_url *url);
struct nfsfh;
/*
* Get the maximum supported READ3 size by the server
* Get the maximum supported READ size by the server
*/
EXTERN uint64_t nfs_get_readmax(struct nfs_context *nfs);
/*
* Get the maximum supported WRITE3 size by the server
* Get the maximum supported WRITE size by the server
*/
EXTERN uint64_t nfs_get_writemax(struct nfs_context *nfs);
/*
* Set the maximum supported READ size by the server
*/
EXTERN void nfs_set_readmax(struct nfs_context *nfs, uint64_t readmax);
/*
* Set the maximum supported WRITE size by the server
*/
EXTERN void nfs_set_writemax(struct nfs_context *nfs, uint64_t writemax);
/*
* MODIFY CONNECT PARAMETERS
*/

View File

@ -86,10 +86,12 @@ nfs_set_gid
nfs_set_pagecache
nfs_set_pagecache_ttl
nfs_set_readahead
nfs_set_readmax
nfs_set_tcp_syncnt
nfs_set_timeout
nfs_set_uid
nfs_set_version
nfs_set_writemax
nfs_stat
nfs_stat_async
nfs_stat64

View File

@ -1778,22 +1778,32 @@ nfs_link_async(struct nfs_context *nfs, const char *oldpath,
}
/*
* Get the maximum supported READ3 size by the server
* Get/Set the maximum supported READ size by the server
*/
uint64_t
nfs_get_readmax(struct nfs_context *nfs)
{
return nfs->readmax;
}
void
nfs_set_readmax(struct nfs_context *nfs, uint64_t readmax)
{
nfs->readmax = readmax;
}
/*
* Get the maximum supported WRITE3 size by the server
* Get/Set the maximum supported WRITE size by the server
*/
uint64_t
nfs_get_writemax(struct nfs_context *nfs)
{
return nfs->writemax;
}
void
nfs_set_writemax(struct nfs_context *nfs, uint64_t writemax)
{
nfs->writemax = writemax;
}
void
nfs_set_tcp_syncnt(struct nfs_context *nfs, int v) {