cifs: make sure that channel scaling is done only once
[linux-block.git] / fs / smb / client / cifsglob.h
index 879d5ef8a66eda8bd3c0aeb8dcea6556ce7acef8..9093c507042fa12ed867bc5297aa5ca8abf50458 100644 (file)
  */
 #define CIFS_DEF_ACTIMEO (1 * HZ)
 
+/*
+ * max sleep time before retry to server
+ */
+#define CIFS_MAX_SLEEP 2000
+
 /*
  * max attribute cache timeout (jiffies) - 2^30
  */
@@ -204,6 +209,8 @@ struct cifs_open_info_data {
                };
        } reparse;
        char *symlink_target;
+       struct cifs_sid posix_owner;
+       struct cifs_sid posix_group;
        union {
                struct smb2_file_all_info fi;
                struct smb311_posix_qinfo posix_fi;
@@ -751,6 +758,7 @@ struct TCP_Server_Info {
        unsigned int    max_read;
        unsigned int    max_write;
        unsigned int    min_offload;
+       unsigned int    retrans;
        __le16  compress_algorithm;
        __u16   signing_algorithm;
        __le16  cipher_type;
@@ -1024,6 +1032,8 @@ struct cifs_chan {
        __u8 signkey[SMB3_SIGN_KEY_SIZE];
 };
 
+#define CIFS_SES_FLAG_SCALE_CHANNELS (0x1)
+
 /*
  * Session structure.  One of these for each uid session with a particular host
  */
@@ -1056,6 +1066,7 @@ struct cifs_ses {
        enum securityEnum sectype; /* what security flavor was specified? */
        bool sign;              /* is signing required? */
        bool domainAuto:1;
+       unsigned int flags;
        __u16 session_flags;
        __u8 smb3signingkey[SMB3_SIGN_KEY_SIZE];
        __u8 smb3encryptionkey[SMB3_ENC_DEC_KEY_SIZE];
@@ -1207,6 +1218,7 @@ struct cifs_tcon {
        __u64    bytes_read;
        __u64    bytes_written;
        spinlock_t stat_lock;  /* protects the two fields above */
+       time64_t stats_from_time;
        FILE_SYSTEM_DEVICE_INFO fsDevInfo;
        FILE_SYSTEM_ATTRIBUTE_INFO fsAttrInfo; /* ok if fs name truncated */
        FILE_SYSTEM_UNIX_INFO fsUnixInfo;
@@ -1497,6 +1509,7 @@ struct cifs_writedata {
        struct smbd_mr                  *mr;
 #endif
        struct cifs_credits             credits;
+       bool                            replay;
 };
 
 /*
@@ -1557,7 +1570,6 @@ struct cifsInodeInfo {
        spinlock_t writers_lock;
        unsigned int writers;           /* Number of writers on this inode */
        unsigned long time;             /* jiffies of last update of inode */
-       u64  server_eof;                /* current file size on server -- protected by i_lock */
        u64  uniqueid;                  /* server inode number */
        u64  createtime;                /* creation time on server */
        __u8 lease_key[SMB2_LEASE_KEY_SIZE];    /* lease key for this inode */
@@ -1827,6 +1839,13 @@ static inline bool is_retryable_error(int error)
        return false;
 }
 
+static inline bool is_replayable_error(int error)
+{
+       if (error == -EAGAIN || error == -ECONNABORTED)
+               return true;
+       return false;
+}
+
 
 /* cifs_get_writable_file() flags */
 #define FIND_WR_ANY         0