36#define SECTORS_PER_UNIT 8
37#define BYTES_PER_SECTOR 512
38#define BYTES_PER_UNIT (SECTORS_PER_UNIT * BYTES_PER_SECTOR)
40#define TO_UNITS(bytes) (bytes / BYTES_PER_UNIT)
42#define VOLUME_CACHE_EXPIRATION 20
54 dprintf(1,
"parsing NFS41_VOLUME_QUERY: query=%d\n",
args->query);
78 dprintf(2,
"%s cached: %llu user, %llu free of %llu total\n",
89 &attr_request, &
info);
91 eprintf(
"nfs41_getattr() failed with %s\n",
104 dprintf(2,
"%s: %llu user, %llu free of %llu total\n",
120 switch (
args->query) {
122 args->len =
sizeof(
args->info.size);
127 "FileFsSizeInformation",
128 &
args->info.size.TotalAllocationUnits.QuadPart,
129 &
args->info.size.AvailableAllocationUnits.QuadPart,
134 args->len =
sizeof(
args->info.fullsize);
139 "FileFsFullSizeInformation",
140 &
args->info.fullsize.TotalAllocationUnits.QuadPart,
141 &
args->info.fullsize.CallerAvailableAllocationUnits.QuadPart,
142 &
args->info.fullsize.ActualAvailableAllocationUnits.QuadPart);
146 args->len =
sizeof(
args->info.attribute);
148 &
args->info.attribute);
152 eprintf(
"unhandled fs query class %d\n",
args->query);
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
int nfs_to_windows_error(int status, int default_error)
static int parse_volume(unsigned char *buffer, uint32_t length, nfs41_upcall *upcall)
static int get_volume_size_info(IN nfs41_open_state *state, IN const char *query, OUT OPTIONAL PLONGLONG total_out, OUT OPTIONAL PLONGLONG user_out, OUT OPTIONAL PLONGLONG avail_out)
static int marshall_volume(unsigned char *buffer, uint32_t *length, nfs41_upcall *upcall)
static int handle_volume(nfs41_upcall *upcall)
#define VOLUME_CACHE_EXPIRATION
const nfs41_upcall_op nfs41_op_volume
void eprintf(LPCSTR format,...)
const char * nfs_error_string(int status)
#define ERROR_INVALID_PARAMETER
VOID WINAPI ReleaseSRWLockShared(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockExclusive(PSRWLOCK Lock)
VOID WINAPI AcquireSRWLockShared(PSRWLOCK Lock)
VOID WINAPI ReleaseSRWLockExclusive(PSRWLOCK Lock)
@ FileFsAttributeInformation
enum _FSINFOCLASS FS_INFORMATION_CLASS
GLuint GLsizei GLsizei * length
void nfs41_superblock_fs_attributes(IN const nfs41_superblock *superblock, OUT struct _FILE_FS_ATTRIBUTE_INFORMATION *FsAttrs)
@ FATTR4_WORD1_SPACE_FREE
@ FATTR4_WORD1_SPACE_AVAIL
@ FATTR4_WORD1_SPACE_TOTAL
nfs41_updowncall_list upcall
int nfs41_getattr(IN nfs41_session *session, IN OPTIONAL nfs41_path_fh *file, IN bitmap4 *attr_request, OUT nfs41_file_info *info)
__GNU_EXTENSION typedef __int64 * PLONGLONG
#define FileFsFullSizeInformation
PULONG MinorVersion OPTIONAL
#define ERROR_BAD_NET_RESP