Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725167

[PATCH 02/17] autofs4: switch autofs4_write to __kernel_write

From Christoph Hellwig <hch@lst.de>
Newsgroups linux.kernel
Subject [PATCH 02/17] autofs4: switch autofs4_write to __kernel_write
Date 2017-09-01 17:50 +0200
Message-ID <ukWmL-71s-35@gated-at.bofh.it> (permalink)
References <ukWd4-6Xx-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Instead of playing games with the address limit..

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/autofs4/waitq.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 24a58bf9ca72..4ac49d038bf3 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -56,19 +56,14 @@ static int autofs4_write(struct autofs_sb_info *sbi,
 			 struct file *file, const void *addr, int bytes)
 {
 	unsigned long sigpipe, flags;
-	mm_segment_t fs;
 	const char *data = (const char *)addr;
 	ssize_t wr = 0;
 
 	sigpipe = sigismember(&current->pending.signal, SIGPIPE);
 
-	/* Save pointer to user space and point back to kernel space */
-	fs = get_fs();
-	set_fs(KERNEL_DS);
-
 	mutex_lock(&sbi->pipe_mutex);
 	while (bytes) {
-		wr = __vfs_write(file, data, bytes, &file->f_pos);
+		wr = __kernel_write(file, data, bytes, &file->f_pos);
 		if (wr <= 0)
 			break;
 		data += wr;
@@ -76,8 +71,6 @@ static int autofs4_write(struct autofs_sb_info *sbi,
 	}
 	mutex_unlock(&sbi->pipe_mutex);
 
-	set_fs(fs);
-
 	/* Keep the currently executing process from receiving a
 	 * SIGPIPE unless it was already supposed to get one
 	 */
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

switch in-kernel read/write calls to kernel_read/write V2 Christoph Hellwig <hch@lst.de> - 2017-09-01 17:40 +0200
  [PATCH 01/17] ashmem: switch to ->read_iter Christoph Hellwig <hch@lst.de> - 2017-09-01 17:40 +0200
  [PATCH 06/17] fs: fix kernel_write prototype Christoph Hellwig <hch@lst.de> - 2017-09-01 17:40 +0200
  [PATCH 04/17] fs: move kernel_read to fs/read_write.c Christoph Hellwig <hch@lst.de> - 2017-09-01 17:40 +0200
  [PATCH 03/17] fs: move kernel_write to fs/read_write.c Christoph Hellwig <hch@lst.de> - 2017-09-01 17:40 +0200
  [PATCH 15/17] fs: unexport __vfs_read/__vfs_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 16/17] fs: unexport vfs_read and vfs_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 07/17] fs: make the buf argument to __kernel_write a void pointer Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 14/17] lustre: switch to kernel_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 02/17] autofs4: switch autofs4_write to __kernel_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 10/17] net/9p: switch p9_fd_read to kernel_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 09/17] mm/nommu: switch do_mmap_private to kernel_read Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 05/17] fs: fix kernel_read prototype Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 13/17] gadget/f_mass_storage: stop messing with the address limit Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 12/17] mconsole: switch to kernel_read Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 08/17] serial2002: switch serial2002_tty_write to kernel_{read/write} Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 17/17] fs: unexport vfs_readv and vfs_writev Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200
  [PATCH 11/17] btrfs: switch write_buf to kernel_write Christoph Hellwig <hch@lst.de> - 2017-09-01 17:50 +0200

csiph-web