diff options
author | Steven Danneman <steven.danneman@isilon.com> | 2009-01-26 20:14:32 -0800 |
---|---|---|
committer | Steven Danneman <steven.danneman@isilon.com> | 2009-02-09 23:56:17 -0800 |
commit | 11f60a62a1d7633e9a8ec62da18ed9ababa694df (patch) | |
tree | cbf46c95dd109ef73e08ef2fba676268dbaa5943 /source3/modules/vfs_onefs.c | |
parent | 6272f4c2f453c509b8a3893d4c2ac5fc356b348d (diff) | |
download | samba-11f60a62a1d7633e9a8ec62da18ed9ababa694df.tar.gz samba-11f60a62a1d7633e9a8ec62da18ed9ababa694df.tar.xz samba-11f60a62a1d7633e9a8ec62da18ed9ababa694df.zip |
s3: OneFS bulk directory enumeration support
OneFS provides the bulk directory enumeration syscall readdirplus(). This
syscall has the same semantics as the NFSv3 READDIRPLUS command, returning
a batch of directory entries with prefetched stat information via one
syscall.
This commit wraps the readdirplus() call in the existing POSIX
readdir/seekdir VFS interface. By default a batch of 128 directory entries
are optimistically read from the kernel into a global cache, and fed to
iterative calls of VFS_OP_READDIR.
The global buffers could be avoided in the future by hanging connection
specific buffers off the conn struct.
Added new parameter "onefs:use readdirplus" which toggles usage of this
code on or off.
Diffstat (limited to 'source3/modules/vfs_onefs.c')
-rw-r--r-- | source3/modules/vfs_onefs.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c index 1f11f691a49..af52c713a83 100644 --- a/source3/modules/vfs_onefs.c +++ b/source3/modules/vfs_onefs.c @@ -91,8 +91,9 @@ static int onefs_load_config(struct vfs_handle_struct *handle) if (share_count <= ONEFS_DATA_FASTBUF) pshare_config = share_config; else { - pshare_config = SMB_MALLOC_ARRAY(struct onefs_vfs_config, - share_count); + pshare_config = + SMB_MALLOC_ARRAY(struct onefs_vfs_config, + share_count); if (!pshare_config) { errno = ENOMEM; return -1; @@ -152,8 +153,9 @@ static int onefs_open(vfs_handle_struct *handle, const char *fname, return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); } -static uint64_t onefs_get_alloc_size(struct vfs_handle_struct *handle, files_struct *fsp, - const SMB_STRUCT_STAT *sbuf) +static uint64_t onefs_get_alloc_size(struct vfs_handle_struct *handle, + files_struct *fsp, + const SMB_STRUCT_STAT *sbuf) { uint64_t result; @@ -246,8 +248,22 @@ static vfs_op_tuple onefs_ops[] = { SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(onefs_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(onefs_opendir), SMB_VFS_OP_OPENDIR, + SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(onefs_readdir), SMB_VFS_OP_READDIR, + SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(onefs_seekdir), SMB_VFS_OP_SEEKDIR, + SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(onefs_telldir), SMB_VFS_OP_TELLDIR, + SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(onefs_rewinddir), SMB_VFS_OP_REWINDDIR, + SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_mkdir), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(onefs_closedir), SMB_VFS_OP_CLOSEDIR, + SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(onefs_init_search_op), SMB_VFS_OP_INIT_SEARCH_OP, + SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_open), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_create_file), SMB_VFS_OP_CREATE_FILE, |