diff options
author | Tim Prouty <tprouty@samba.org> | 2009-01-26 15:39:40 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-01-29 15:29:33 -0800 |
commit | b8f7cdbd79918bba0fea181f97fff5ab0c79192d (patch) | |
tree | 6716b36bb6421e0cff45dc224a1705bb396e8dd2 /source3/include | |
parent | aeb23872e25fb720140a10ce01a4211d228b6555 (diff) | |
download | samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.gz samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.tar.bz2 samba-b8f7cdbd79918bba0fea181f97fff5ab0c79192d.zip |
s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation
This allows module implementors to customize what allocation size is
returned to the client.
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/include/smbprofile.h | 4 | ||||
-rw-r--r-- | source3/include/vfs.h | 4 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 3 |
4 files changed, 12 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index af5181eca6..71e2145b83 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1128,6 +1128,7 @@ bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid, bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf); bool socket_exist(const char *fname); bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st); +uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); SMB_OFF_T get_file_size(char *file_name); char *attrib_string(uint16 mode); void show_msg(char *buf); @@ -7377,7 +7378,6 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf); /* The following definitions come from smbd/trans2.c */ uint64_t smb_roundup(connection_struct *conn, uint64_t val); -uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf); NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, const char *fname, const char *ea_name, struct ea_struct *pea); diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 8945708ca3..131416b685 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -127,6 +127,10 @@ enum profile_stats_values #define syscall_lstat_count __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, count) #define syscall_lstat_time __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, time) + PR_VALUE_SYSCALL_GET_ALLOC_SIZE, +#define syscall_get_alloc_size_count __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, count) +#define syscall_get_alloc_size_time __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, time) + PR_VALUE_SYSCALL_UNLINK, #define syscall_unlink_count __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, count) #define syscall_unlink_time __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, time) diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 5df71da905..e9115ab807 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -112,6 +112,7 @@ /* Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t. */ /* Leave at 25 - not yet released. Add create_file call. -- tprouty. */ /* Leave at 25 - not yet released. Add create time to ntimes. -- tstecher. */ +/* Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty. */ #define SMB_VFS_INTERFACE_VERSION 25 @@ -189,6 +190,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_STAT, SMB_VFS_OP_FSTAT, SMB_VFS_OP_LSTAT, + SMB_VFS_OP_GET_ALLOC_SIZE, SMB_VFS_OP_UNLINK, SMB_VFS_OP_CHMOD, SMB_VFS_OP_FCHMOD, @@ -342,6 +344,7 @@ struct vfs_ops { int (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); + uint64_t (*get_alloc_size)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); int (*unlink)(struct vfs_handle_struct *handle, const char *path); int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode); int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); @@ -496,6 +499,7 @@ struct vfs_ops { struct vfs_handle_struct *stat; struct vfs_handle_struct *fstat; struct vfs_handle_struct *lstat; + struct vfs_handle_struct *get_alloc_size; struct vfs_handle_struct *unlink; struct vfs_handle_struct *chmod; struct vfs_handle_struct *fchmod; diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index c6ccd4912a..e7a9cfdc76 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -62,6 +62,7 @@ #define SMB_VFS_STAT(conn, fname, sbuf) ((conn)->vfs.ops.stat((conn)->vfs.handles.stat, (fname), (sbuf))) #define SMB_VFS_FSTAT(fsp, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf))) +#define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs.ops.get_alloc_size((conn)->vfs.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (path))) #define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode))) #define SMB_VFS_FCHMOD(fsp, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (mode))) @@ -189,6 +190,7 @@ #define SMB_VFS_OPAQUE_STAT(conn, fname, sbuf) ((conn)->vfs_opaque.ops.stat((conn)->vfs_opaque.handles.stat, (fname), (sbuf))) #define SMB_VFS_OPAQUE_FSTAT(fsp, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf))) +#define SMB_VFS_OPAQUE_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs_opaque.ops.get_alloc_size((conn)->vfs_opaque.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (path))) #define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (path), (mode))) #define SMB_VFS_OPAQUE_FCHMOD(fsp, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (mode))) @@ -317,6 +319,7 @@ #define SMB_VFS_NEXT_STAT(handle, fname, sbuf) ((handle)->vfs_next.ops.stat((handle)->vfs_next.handles.stat, (fname), (sbuf))) #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_NEXT_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf))) +#define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs_next.ops.get_alloc_size((conn)->vfs_next.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_NEXT_UNLINK(handle, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (path))) #define SMB_VFS_NEXT_CHMOD(handle, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (path), (mode))) #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (mode))) |