cifs: cache FILE_ALL_INFO for the shared root handle
[platform/kernel/linux-rpi.git] / fs / cifs / cifsglob.h
index f293e05..8b9ecf8 100644 (file)
@@ -735,13 +735,13 @@ in_flight(struct TCP_Server_Info *server)
 }
 
 static inline bool
-has_credits(struct TCP_Server_Info *server, int *credits)
+has_credits(struct TCP_Server_Info *server, int *credits, int num_credits)
 {
        int num;
        spin_lock(&server->req_lock);
        num = *credits;
        spin_unlock(&server->req_lock);
-       return num > 0;
+       return num >= num_credits;
 }
 
 static inline void
@@ -962,11 +962,14 @@ cap_unix(struct cifs_ses *ses)
 
 struct cached_fid {
        bool is_valid:1;        /* Do we have a useable root fid */
+       bool file_all_info_is_valid:1;
+
        struct kref refcount;
        struct cifs_fid *fid;
        struct mutex fid_mutex;
        struct cifs_tcon *tcon;
        struct work_struct lease_break;
+       struct smb2_file_all_info file_all_info;
 };
 
 /*