aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifsfs.c4
-rw-r--r--fs/cifs/cifsglob.h39
-rw-r--r--fs/cifs/smb1ops.c3
-rw-r--r--fs/cifs/smb2ops.c3
4 files changed, 0 insertions, 49 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 4dda4890d776..3a3e2fee0b3e 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -88,10 +88,6 @@ extern mempool_t *cifs_mid_poolp;
88 88
89struct workqueue_struct *cifsiod_wq; 89struct workqueue_struct *cifsiod_wq;
90 90
91#ifdef CONFIG_HIGHMEM
92DEFINE_MUTEX(cifs_kmap_mutex);
93#endif
94
95static int 91static int
96cifs_read_super(struct super_block *sb) 92cifs_read_super(struct super_block *sb)
97{ 93{
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 79e8b6f06021..b2bb941d8ddd 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -638,45 +638,6 @@ get_next_mid(struct TCP_Server_Info *server)
638#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) 638#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536)
639 639
640/* 640/*
641 * On hosts with high memory, we can't currently support wsize/rsize that are
642 * larger than we can kmap at once. Cap the rsize/wsize at
643 * LAST_PKMAP * PAGE_SIZE. We'll never be able to fill a read or write request
644 * larger than that anyway.
645 */
646#ifdef CONFIG_HIGHMEM
647#define CIFS_KMAP_SIZE_LIMIT (LAST_PKMAP * PAGE_CACHE_SIZE)
648#else /* CONFIG_HIGHMEM */
649#define CIFS_KMAP_SIZE_LIMIT (1<<24)
650#endif /* CONFIG_HIGHMEM */
651
652#ifdef CONFIG_HIGHMEM
653/*
654 * On arches that have high memory, kmap address space is limited. By
655 * serializing the kmap operations on those arches, we ensure that we don't
656 * end up with a bunch of threads in writeback with partially mapped page
657 * arrays, stuck waiting for kmap to come back. That situation prevents
658 * progress and can deadlock.
659 */
660
661extern struct mutex cifs_kmap_mutex;
662
663static inline void
664cifs_kmap_lock(void)
665{
666 mutex_lock(&cifs_kmap_mutex);
667}
668
669static inline void
670cifs_kmap_unlock(void)
671{
672 mutex_unlock(&cifs_kmap_mutex);
673}
674#else /* !CONFIG_HIGHMEM */
675#define cifs_kmap_lock() do { ; } while (0)
676#define cifs_kmap_unlock() do { ; } while (0)
677#endif /* CONFIG_HIGHMEM */
678
679/*
680 * Macros to allow the TCP_Server_Info->net field and related code to drop out 641 * Macros to allow the TCP_Server_Info->net field and related code to drop out
681 * when CONFIG_NET_NS isn't set. 642 * when CONFIG_NET_NS isn't set.
682 */ 643 */
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 8727ef712a3c..ed7f95532383 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -483,9 +483,6 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
483 if (!(server->capabilities & CAP_LARGE_READ_X)) 483 if (!(server->capabilities & CAP_LARGE_READ_X))
484 rsize = min_t(unsigned int, CIFSMaxBufSize, rsize); 484 rsize = min_t(unsigned int, CIFSMaxBufSize, rsize);
485 485
486 /* limit to the amount that we can kmap at once */
487 rsize = min_t(unsigned int, rsize, CIFS_KMAP_SIZE_LIMIT);
488
489 /* hard limit of CIFS_MAX_RSIZE */ 486 /* hard limit of CIFS_MAX_RSIZE */
490 rsize = min_t(unsigned int, rsize, CIFS_MAX_RSIZE); 487 rsize = min_t(unsigned int, rsize, CIFS_MAX_RSIZE);
491 488
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index a621d6125367..b1dedf8cb372 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -205,9 +205,6 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info)
205 */ 205 */
206 rsize = min_t(unsigned int, rsize, 2 << 15); 206 rsize = min_t(unsigned int, rsize, 2 << 15);
207 207
208 /* limit to the amount that we can kmap at once */
209 rsize = min_t(unsigned int, rsize, CIFS_KMAP_SIZE_LIMIT);
210
211 return rsize; 208 return rsize;
212} 209}
213 210