From af0e199b31ea4132e369508d72888757887b3327 Mon Sep 17 00:00:00 2001 From: Steven Danneman Date: Thu, 22 Jan 2009 20:14:38 -0800 Subject: Add an optional SMB_STRUCT_SMB parameter to VFS_OP_READDIR * this allows VFS implementations that prefetch stat information on readdir to return it through one VFS call * backwards compatibility is maintained by passing in NULL * if the system readdir doesn't return stat info, the stat struct is set to invalid --- source3/modules/vfs_default.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 679be57558..7d61191a69 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -113,12 +113,18 @@ static SMB_STRUCT_DIR *vfswrap_opendir(vfs_handle_struct *handle, const char *f return result; } -static SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) +static SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle, + SMB_STRUCT_DIR *dirp, + SMB_STRUCT_STAT *sbuf) { SMB_STRUCT_DIRENT *result; START_PROFILE(syscall_readdir); result = sys_readdir(dirp); + /* Default Posix readdir() does not give us stat info. + * Set to invalid to indicate we didn't return this info. */ + if (sbuf) + SET_STAT_INVALID(*sbuf); END_PROFILE(syscall_readdir); return result; } -- cgit