diff options
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/vfs.h | 40 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 3 |
2 files changed, 39 insertions, 4 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 3bd0fda9a4..cde2039d1a 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -3,7 +3,7 @@ VFS structures and parameters Copyright (C) Jeremy Allison 1999-2005 Copyright (C) Tim Potter 1999 - Copyright (C) Alexander Bokovoy 2002 + Copyright (C) Alexander Bokovoy 2002-2005 Copyright (C) Stefan (metze) Metzmacher 2003 This program is free software; you can redistribute it and/or modify @@ -60,7 +60,8 @@ Also include aio calls. JRA. */ /* Changed to version 13 as the internal structure of files_struct has changed. JRA */ /* Changed to version 14 as the we had to change DIR to SMB_STRUCT_DIR. JRA */ -#define SMB_VFS_INTERFACE_VERSION 14 +/* Changed to version 15 as the we added the statvfs call. JRA */ +#define SMB_VFS_INTERFACE_VERSION 15 /* to bug old modules which are trying to compile with the old functions */ @@ -82,6 +83,7 @@ struct vfs_handle_struct; struct connection_struct; struct files_struct; struct security_descriptor_info; +struct vfs_statvfs_struct; /* Available VFS operations. These values must be in sync with vfs_ops struct @@ -101,7 +103,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_GET_QUOTA, SMB_VFS_OP_SET_QUOTA, SMB_VFS_OP_GET_SHADOW_COPY_DATA, - + SMB_VFS_OP_STATVFS, /* Directory operations */ @@ -222,6 +224,7 @@ struct vfs_ops { int (*get_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*set_quota)(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, BOOL labels); + int (*statvfs)(struct vfs_handle_struct *handle, struct connection_struct *conn, const char *path, struct vfs_statvfs_struct *statbuf); /* Directory operations */ @@ -334,6 +337,7 @@ struct vfs_ops { struct vfs_handle_struct *get_quota; struct vfs_handle_struct *set_quota; struct vfs_handle_struct *get_shadow_copy_data; + struct vfs_handle_struct *statvfs; /* Directory operations */ @@ -478,7 +482,7 @@ typedef enum _vfs_op_layer { using this information. */ -typedef struct _vfs_op_tuple { +typedef struct vfs_op_tuple { void* op; vfs_op_type type; vfs_op_layer layer; @@ -495,6 +499,34 @@ typedef struct vfs_handle_struct { } vfs_handle_struct; +typedef struct vfs_statvfs_struct { + /* For undefined recommended transfer size return -1 in that field */ + uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */ + uint32 BlockSize; + + /* + The next three fields are in terms of the block size. + (above). If block size is unknown, 4096 would be a + reasonable block size for a server to report. + Note that returning the blocks/blocksavail removes need + to make a second call (to QFSInfo level 0x103 to get this info. + UserBlockAvail is typically less than or equal to BlocksAvail, + if no distinction is made return the same value in each. + */ + + SMB_BIG_UINT TotalBlocks; + SMB_BIG_UINT BlocksAvail; /* bfree */ + SMB_BIG_UINT UserBlocksAvail; /* bavail */ + + /* For undefined Node fields or FSID return -1 */ + SMB_BIG_UINT TotalFileNodes; + SMB_BIG_UINT FreeFileNodes; + SMB_BIG_UINT FsIdentifier; /* fsid */ + /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ + /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ +} vfs_statvfs_struct; + + #define SMB_VFS_HANDLE_GET_DATA(handle, datap, type, ret) { \ if (!(handle)||((datap=(type *)(handle)->data)==NULL)) { \ DEBUG(0,("%s() failed to get vfs_handle->data!\n",FUNCTION_MACRO)); \ diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index e6bfb1f527..33810c301f 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -34,6 +34,7 @@ #define SMB_VFS_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.get_quota((conn)->vfs.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.set_quota((conn)->vfs.handles.set_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs.ops.get_shadow_copy_data((fsp)->conn->vfs.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) +#define SMB_VFS_STATVFS(conn, path, statbuf) ((conn)->vfs.ops.statvfs((conn)->vfs.handles.statvfs, (conn), (path), (statbuf))) /* Directory operations */ #define SMB_VFS_OPENDIR(conn, fname, mask, attr) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (conn), (fname), (mask), (attr))) @@ -144,6 +145,7 @@ #define SMB_VFS_OPAQUE_GET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.get_quota((conn)->vfs_opaque.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_OPAQUE_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.set_quota((conn)->vfs_opaque.handles.set_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_OPAQUE_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs_opaque.ops.get_shadow_copy_data((fsp)->conn->vfs_opaque.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) +#define SMB_VFS_OPAQUE_STATVFS(conn, path, statbuf) ((conn)->vfs_opaque.ops.statvfs((conn)->vfs_opaque.handles.statvfs, (conn), (path), (statbuf))) /* Directory operations */ #define SMB_VFS_OPAQUE_OPENDIR(conn, fname, mask, attr) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (conn), (fname), (mask), (attr))) @@ -254,6 +256,7 @@ #define SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.get_quota((handle)->vfs_next.handles.get_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt) ((handle)->vfs_next.ops.set_quota((handle)->vfs_next.handles.set_quota, (conn), (qtype), (id), (qt))) #define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) ((handle)->vfs_next.ops.get_shadow_copy_data((handle)->vfs_next.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) +#define SMB_VFS_NEXT_STATVFS(handle, conn, path, statbuf) ((handle)->vfs_next.ops.statvfs((handle)->vfs_next.handles.statvfs, (conn), (path), (statbuf))) /* Directory operations */ #define SMB_VFS_NEXT_OPENDIR(handle, conn, fname, mask, attr) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (conn), (fname), (mask), (attr))) |