From cd7fef3d792cb28eacc97f318937e50abb1cd8d0 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Wed, 2 Oct 2002 23:00:32 -0700 Subject: [PATCH] shmem: remove info->sem Between inode->i_sem and info->lock comes info->sem; but it doesn't guard thoroughly against the difficult races (truncate during read), and serializes reads from tmpfs unlike other filesystems. I'd prefer to work with just i_sem and info->lock, backtracking when necessary (when another task allocates block or metablock at the same time). (I am not satisfied with the locked setting of next_index at the start of shmem_getpage_locked: it's one lock hold too many, and it doesn't really fix races against truncate better than before: another patch in a later batch will resolve that.) --- include/linux/shmem_fs.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux/shmem_fs.h') diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index 9d39c403c0a0..81c150bb8081 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -11,7 +11,6 @@ extern atomic_t shmem_nrpages; struct shmem_inode_info { spinlock_t lock; - struct semaphore sem; unsigned long next_index; swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* for the first blocks */ void **i_indirect; /* indirect blocks */ -- cgit v1.2.3