]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/cifs/cifsglob.h
CIFS: Fix wrong restart readdir for SMB1
[mirror_ubuntu-zesty-kernel.git] / fs / cifs / cifsglob.h
index de6aed8c78e562e468f015a02a71a8a75e3ff36a..dfc731b02aa9b3daca3a15d95346bcd82cc2b3d5 100644 (file)
@@ -404,6 +404,15 @@ struct smb_version_operations {
                        const struct cifs_fid *, u32 *);
        int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *,
                        int);
+       /* writepages retry size */
+       unsigned int (*wp_retry_size)(struct inode *);
+       /* get mtu credits */
+       int (*wait_mtu_credits)(struct TCP_Server_Info *, unsigned int,
+                               unsigned int *, unsigned int *);
+       /* check if we need to issue closedir */
+       bool (*dir_needs_close)(struct cifsFileInfo *);
+       long (*fallocate)(struct file *, struct cifs_tcon *, int, loff_t,
+                         loff_t);
 };
 
 struct smb_version_values {
@@ -639,6 +648,16 @@ add_credits(struct TCP_Server_Info *server, const unsigned int add,
        server->ops->add_credits(server, add, optype);
 }
 
+static inline void
+add_credits_and_wake_if(struct TCP_Server_Info *server, const unsigned int add,
+                       const int optype)
+{
+       if (add) {
+               server->ops->add_credits(server, add, optype);
+               wake_up(&server->request_q);
+       }
+}
+
 static inline void
 set_credits(struct TCP_Server_Info *server, const int val)
 {
@@ -868,6 +887,7 @@ struct cifs_tcon {
                                for this mount even if server would support */
        bool local_lease:1; /* check leases (only) on local system not remote */
        bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */
+       bool broken_sparse_sup; /* if server or share does not support sparse */
        bool need_reconnect:1; /* connection reset, tid now invalid */
 #ifdef CONFIG_CIFS_SMB2
        bool print:1;           /* set if connection to printer share */
@@ -1044,6 +1064,7 @@ struct cifs_readdata {
        struct address_space            *mapping;
        __u64                           offset;
        unsigned int                    bytes;
+       unsigned int                    got_bytes;
        pid_t                           pid;
        int                             result;
        struct work_struct              work;
@@ -1053,6 +1074,7 @@ struct cifs_readdata {
        struct kvec                     iov;
        unsigned int                    pagesz;
        unsigned int                    tailsz;
+       unsigned int                    credits;
        unsigned int                    nr_pages;
        struct page                     *pages[];
 };
@@ -1073,6 +1095,7 @@ struct cifs_writedata {
        int                             result;
        unsigned int                    pagesz;
        unsigned int                    tailsz;
+       unsigned int                    credits;
        unsigned int                    nr_pages;
        struct page                     *pages[];
 };
@@ -1398,6 +1421,7 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param,
 #define   CIFS_OBREAK_OP   0x0100    /* oplock break request */
 #define   CIFS_NEG_OP      0x0200    /* negotiate request */
 #define   CIFS_OP_MASK     0x0380    /* mask request type */
+#define   CIFS_HAS_CREDITS 0x0400    /* already has credits */
 
 /* Security Flags: indicate type of session setup needed */
 #define   CIFSSEC_MAY_SIGN     0x00001