aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 19:20:29 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:28 -0400
commit33319141252fd14b58cf13685156c23dcaac2527 (patch)
treeeebda8dab0fd4e759f58111f7a3d2fcef3e90b7f /fs/cifs/cifsglob.h
parentc9de5c80d536e556568ccd45b9599870d4993b7d (diff)
CIFS: Add SMB2 support for cifs_iovec_write
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index aef167470654..330f6259bb6d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -582,6 +582,33 @@ get_next_mid(struct TCP_Server_Info *server)
582#define CIFS_KMAP_SIZE_LIMIT (1<<24) 582#define CIFS_KMAP_SIZE_LIMIT (1<<24)
583#endif /* CONFIG_HIGHMEM */ 583#endif /* CONFIG_HIGHMEM */
584 584
585#ifdef CONFIG_HIGHMEM
586/*
587 * On arches that have high memory, kmap address space is limited. By
588 * serializing the kmap operations on those arches, we ensure that we don't
589 * end up with a bunch of threads in writeback with partially mapped page
590 * arrays, stuck waiting for kmap to come back. That situation prevents
591 * progress and can deadlock.
592 */
593
594extern struct mutex cifs_kmap_mutex;
595
596static inline void
597cifs_kmap_lock(void)
598{
599 mutex_lock(&cifs_kmap_mutex);
600}
601
602static inline void
603cifs_kmap_unlock(void)
604{
605 mutex_unlock(&cifs_kmap_mutex);
606}
607#else /* !CONFIG_HIGHMEM */
608#define cifs_kmap_lock() do { ; } while (0)
609#define cifs_kmap_unlock() do { ; } while (0)
610#endif /* CONFIG_HIGHMEM */
611
585/* 612/*
586 * Macros to allow the TCP_Server_Info->net field and related code to drop out 613 * Macros to allow the TCP_Server_Info->net field and related code to drop out
587 * when CONFIG_NET_NS isn't set. 614 * when CONFIG_NET_NS isn't set.
@@ -891,6 +918,26 @@ struct cifs_readdata {
891 struct kvec iov[1]; 918 struct kvec iov[1];
892}; 919};
893 920
921struct cifs_writedata;
922
923/* asynchronous write support */
924struct cifs_writedata {
925 struct kref refcount;
926 struct list_head list;
927 struct completion done;
928 enum writeback_sync_modes sync_mode;
929 struct work_struct work;
930 struct cifsFileInfo *cfile;
931 __u64 offset;
932 pid_t pid;
933 unsigned int bytes;
934 int result;
935 void (*marshal_iov) (struct kvec *iov,
936 struct cifs_writedata *wdata);
937 unsigned int nr_pages;
938 struct page *pages[1];
939};
940
894/* 941/*
895 * Take a reference on the file private data. Must be called with 942 * Take a reference on the file private data. Must be called with
896 * cifs_file_list_lock held. 943 * cifs_file_list_lock held.