cifs: cache FILE_ALL_INFO for the shared root handle
authorRonnie Sahlberg <lsahlber@redhat.com>
Tue, 12 Mar 2019 03:58:31 +0000 (13:58 +1000)
committerSteve French <stfrench@microsoft.com>
Fri, 15 Mar 2019 00:32:35 +0000 (19:32 -0500)
commitb0f6df737a1c5d9d5ff90cc946205d8af46cc067
tree4f963741384b6f80b0ec03ac420854486dd57da3
parentab7b10cf4fd14496292c62099f3a0a1c1ef90c0e
cifs: cache FILE_ALL_INFO for the shared root handle

When we open the shared root handle also ask for FILE_ALL_INFORMATION since
we can do this at zero cost as part of a compound.
Cache this information as long as the lease is held and return and serve any
future requests from cache.

This allows us to serve "stat /<mountpoint>" directly from cache and avoid
a network roundtrip.  Since clients often want to do this quite a lot
this improve performance slightly.

As an example: xfstest generic/533 performs 43 stat operations on the root
of the share while it is run. Which are eliminated with this patch.

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/cifsglob.h
fs/cifs/smb2inode.c
fs/cifs/smb2ops.c
fs/cifs/smb2pdu.c
fs/cifs/smb2proto.h