From 6272f4c2f453c509b8a3893d4c2ac5fc356b348d Mon Sep 17 00:00:00 2001 From: Steven Danneman Date: Mon, 2 Feb 2009 21:37:51 -0800 Subject: s3: Added SMB_VFS_INIT_SEARCH_OP to initialize data at the beginning of SMB search requests. By default this VFS call is a NOOP, but the onefs vfs module takes advantage of it to initialize direntry search caches at the beginning of each TRANS2_FIND_FIRST, TRANS2_FIND_NEXT, SMBffirst, SMBsearch, and SMBunique --- source3/include/proto.h | 1 + source3/include/vfs.h | 8 ++++++-- source3/include/vfs_macros.h | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index eef7a0dd24..849bed3b0b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6495,6 +6495,7 @@ const char *dptr_ReadDirName(TALLOC_CTX *ctx, SMB_STRUCT_STAT *pst); bool dptr_SearchDir(struct dptr_struct *dptr, const char *name, long *poffset, SMB_STRUCT_STAT *pst); void dptr_DirCacheAdd(struct dptr_struct *dptr, const char *name, long offset); +void dptr_init_search_op(struct dptr_struct *dptr); bool dptr_fill(char *buf1,unsigned int key); struct dptr_struct *dptr_fetch(char *buf,int *num); struct dptr_struct *dptr_fetch_lanman2(int dptr_num); diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 6aea0ae6a0..99af30b1c5 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -114,6 +114,7 @@ /* Leave at 25 - not yet released. Add create time to ntimes. -- tstecher. */ /* Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty. */ /* Leave at 25 - not yet released. Add SMB_STRUCT_STAT to readdir. - sdann */ +/* Leave at 25 - not yet released. Add init_search_op call. - sdann */ #define SMB_VFS_INTERFACE_VERSION 25 @@ -144,14 +145,14 @@ struct smb_file_time; /* Available VFS operations. These values must be in sync with vfs_ops struct - (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops). + (struct vfs_fn_pointers and struct vfs_handle_pointers inside of struct vfs_ops). In particular, if new operations are added to vfs_ops, appropriate constants should be added to vfs_op_type so that order of them kept same as in vfs_ops. */ typedef enum _vfs_op_type { SMB_VFS_OP_NOOP = -1, - + /* Disk operations */ SMB_VFS_OP_CONNECT = 0, @@ -173,6 +174,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_MKDIR, SMB_VFS_OP_RMDIR, SMB_VFS_OP_CLOSEDIR, + SMB_VFS_OP_INIT_SEARCH_OP, /* File operations */ @@ -313,6 +315,7 @@ struct vfs_ops { int (*mkdir)(struct vfs_handle_struct *handle, const char *path, mode_t mode); int (*rmdir)(struct vfs_handle_struct *handle, const char *path); int (*closedir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir); + void (*init_search_op)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); /* File operations */ @@ -484,6 +487,7 @@ struct vfs_ops { struct vfs_handle_struct *mkdir; struct vfs_handle_struct *rmdir; struct vfs_handle_struct *closedir; + struct vfs_handle_struct *init_search_op; /* File operations */ diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 208566f77e..e57cbd2538 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -45,6 +45,7 @@ #define SMB_VFS_MKDIR(conn, path, mode) ((conn)->vfs.ops.mkdir((conn)->vfs.handles.mkdir,(path), (mode))) #define SMB_VFS_RMDIR(conn, path) ((conn)->vfs.ops.rmdir((conn)->vfs.handles.rmdir, (path))) #define SMB_VFS_CLOSEDIR(conn, dir) ((conn)->vfs.ops.closedir((conn)->vfs.handles.closedir, dir)) +#define SMB_VFS_INIT_SEARCH_OP(conn, dirp) ((conn)->vfs.ops.init_search_op((conn)->vfs.handles.init_search_op, (dirp))) /* File operations */ #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode))) @@ -173,6 +174,7 @@ #define SMB_VFS_OPAQUE_MKDIR(conn, path, mode) ((conn)->vfs_opaque.ops.mkdir((conn)->vfs_opaque.handles.mkdir,(path), (mode))) #define SMB_VFS_OPAQUE_RMDIR(conn, path) ((conn)->vfs_opaque.ops.rmdir((conn)->vfs_opaque.handles.rmdir, (path))) #define SMB_VFS_OPAQUE_CLOSEDIR(conn, dir) ((conn)->vfs_opaque.ops.closedir((conn)->vfs_opaque.handles.closedir, dir)) +#define SMB_VFS_OPAQUE_INIT_SEARCH_OP(conn, dirp) ((conn)->vfs_opaque.ops.init_search_op((conn)->vfs_opaque.handles.init_search_op, (dirp))) /* File operations */ #define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode))) @@ -302,6 +304,7 @@ #define SMB_VFS_NEXT_MKDIR(handle, path, mode) ((handle)->vfs_next.ops.mkdir((handle)->vfs_next.handles.mkdir,(path), (mode))) #define SMB_VFS_NEXT_RMDIR(handle, path) ((handle)->vfs_next.ops.rmdir((handle)->vfs_next.handles.rmdir, (path))) #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) ((handle)->vfs_next.ops.closedir((handle)->vfs_next.handles.closedir, dir)) +#define SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp) ((handle)->vfs_next.ops.init_search_op((handle)->vfs_next.handles.init_search_op, (dirp))) /* File operations */ #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode))) -- cgit