xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>
- This parameter specifies the size of the directory name cache.
- It will be needed to turn this off for *BSD systems.
+ This parameter specifies the size of the directory name cache for SMB1
+ connections. It is not used for SMB2. It will be needed to turn this off
+ for *BSD systems.
</para>
</description>
mask, smb_fname_str_dbg(&smb_fname),
dname, fname));
- DirCacheAdd(dirptr->dir_hnd, dname, cur_offset);
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1
+ * uses a name for the resume wheras SMB2 always
+ * continues from the next position (unless it's told to
+ * restart or close-and-reopen the listing).
+ */
+ DirCacheAdd(dirptr->dir_hnd, dname, cur_offset);
+ }
TALLOC_FREE(dname);
}
dirp->conn = conn;
- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1 uses a name
+ * for the resume wheras SMB2 always continues from the next
+ * position (unless it's told to restart or close-and-reopen the
+ * listing).
+ */
+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+ }
if (sconn && !sconn->using_smb2) {
sconn->searches.dirhandles_open++;
}
dirp->conn = conn;
- dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+
+ if (!conn->sconn->using_smb2) {
+ /*
+ * The dircache is only needed for SMB1 because SMB1 uses a name
+ * for the resume wheras SMB2 always continues from the next
+ * position (unless it's told to restart or close-and-reopen the
+ * listing).
+ */
+ dirp->name_cache_size = lp_directory_name_cache_size(SNUM(conn));
+ }
dirp->dir_smb_fname = cp_smb_filename(dirp, fsp->fsp_name);
if (!dirp->dir_smb_fname) {