Allow setting max read/write size from the api
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>master
parent
af90dbfbcf
commit
965b1914ef
|
@ -27,8 +27,8 @@
|
||||||
#pragma comment(lib, "ws2_32.lib")
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
#endif
|
#endif
|
||||||
#define SERVER "10.1.1.27"
|
#define SERVER "10.10.10.11"
|
||||||
#define EXPORT "/shared"
|
#define EXPORT "/data/SNAP-4"
|
||||||
|
|
||||||
#ifdef HAVE_POLL_H
|
#ifdef HAVE_POLL_H
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
|
@ -246,15 +246,25 @@ EXTERN void nfs_destroy_url(struct nfs_url *url);
|
||||||
struct nfsfh;
|
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);
|
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);
|
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
|
* MODIFY CONNECT PARAMETERS
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -86,10 +86,12 @@ nfs_set_gid
|
||||||
nfs_set_pagecache
|
nfs_set_pagecache
|
||||||
nfs_set_pagecache_ttl
|
nfs_set_pagecache_ttl
|
||||||
nfs_set_readahead
|
nfs_set_readahead
|
||||||
|
nfs_set_readmax
|
||||||
nfs_set_tcp_syncnt
|
nfs_set_tcp_syncnt
|
||||||
nfs_set_timeout
|
nfs_set_timeout
|
||||||
nfs_set_uid
|
nfs_set_uid
|
||||||
nfs_set_version
|
nfs_set_version
|
||||||
|
nfs_set_writemax
|
||||||
nfs_stat
|
nfs_stat
|
||||||
nfs_stat_async
|
nfs_stat_async
|
||||||
nfs_stat64
|
nfs_stat64
|
||||||
|
|
14
lib/libnfs.c
14
lib/libnfs.c
|
@ -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
|
uint64_t
|
||||||
nfs_get_readmax(struct nfs_context *nfs)
|
nfs_get_readmax(struct nfs_context *nfs)
|
||||||
{
|
{
|
||||||
return nfs->readmax;
|
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
|
uint64_t
|
||||||
nfs_get_writemax(struct nfs_context *nfs)
|
nfs_get_writemax(struct nfs_context *nfs)
|
||||||
{
|
{
|
||||||
return nfs->writemax;
|
return nfs->writemax;
|
||||||
}
|
}
|
||||||
|
void
|
||||||
|
nfs_set_writemax(struct nfs_context *nfs, uint64_t writemax)
|
||||||
|
{
|
||||||
|
nfs->writemax = writemax;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
nfs_set_tcp_syncnt(struct nfs_context *nfs, int v) {
|
nfs_set_tcp_syncnt(struct nfs_context *nfs, int v) {
|
||||||
|
|
Loading…
Reference in New Issue