Skip to content

: cifs: cache directory content for shroot

Ronnie Sahlberg linux-cifs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v13 patches 9 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cifs: return cached_fid from open_shrootfs/cifs/smb2inode.c fs/cifs/smb2ops.c fs/cifs/smb2proto.h+23 -130 replies
2/3cifs: compute full_path already in cifs_readdir()fs/cifs/readdir.c+16 -140 replies
3/3cifs: cache the directory content for shrootfs/cifs/cifsglob.h fs/cifs/misc.c fs/cifs/readdir.c +1 more+200 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH 0/3 V2]: cifs: cache directory content for shroot

Steve, Aurelien, List

V2: addressing Aureliens comments
* Fix comment style
* Describe what ctx->pos == 2 means
* use is_smb1_server()

See initial implementation of a mechanism to cache the directory entries for
a shared cache handle (shroot).
We cache all the entries during the initial readdir() scan, using the context from the vfs layer as the key to handle if there are multiple concurrent readir() scans of the same directory.
Then if/when we have successfully cached the entire direcotry we will server any subsequent readdir() from out of cache, avoinding making any query direcotry calls to the server.

As with all of shroot, the cache is kept until the direcotry lease is broken.

The first two patches are small and just a preparation for the third patch. They go as separate patches to make review easier.
The third patch adds the actual meat of the dirent caching .

For now this might not be too exciting because the only cache the root handle. I hope in the future we will expand the directory caching to handle any/many direcotries.