diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/Kconfig | 2 | ||||
-rw-r--r-- | fs/direct-io.c | 10 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 72 | ||||
-rw-r--r-- | fs/gfs2/inode.h | 1 | ||||
-rw-r--r-- | fs/gfs2/super.c | 1 | ||||
-rw-r--r-- | fs/pipe.c | 10 | ||||
-rw-r--r-- | fs/proc/Kconfig | 6 | ||||
-rw-r--r-- | fs/sysfs/Kconfig | 2 |
8 files changed, 40 insertions, 64 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index 9a7921ae4763..3db9caa57edc 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -50,7 +50,7 @@ config EXPORTFS | |||
50 | tristate | 50 | tristate |
51 | 51 | ||
52 | config FILE_LOCKING | 52 | config FILE_LOCKING |
53 | bool "Enable POSIX file locking API" if EMBEDDED | 53 | bool "Enable POSIX file locking API" if EXPERT |
54 | default y | 54 | default y |
55 | help | 55 | help |
56 | This option enables standard file locking support, required | 56 | This option enables standard file locking support, required |
diff --git a/fs/direct-io.c b/fs/direct-io.c index 85882f6ba5f7..b044705eedd4 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c | |||
@@ -325,12 +325,16 @@ void dio_end_io(struct bio *bio, int error) | |||
325 | } | 325 | } |
326 | EXPORT_SYMBOL_GPL(dio_end_io); | 326 | EXPORT_SYMBOL_GPL(dio_end_io); |
327 | 327 | ||
328 | static int | 328 | static void |
329 | dio_bio_alloc(struct dio *dio, struct block_device *bdev, | 329 | dio_bio_alloc(struct dio *dio, struct block_device *bdev, |
330 | sector_t first_sector, int nr_vecs) | 330 | sector_t first_sector, int nr_vecs) |
331 | { | 331 | { |
332 | struct bio *bio; | 332 | struct bio *bio; |
333 | 333 | ||
334 | /* | ||
335 | * bio_alloc() is guaranteed to return a bio when called with | ||
336 | * __GFP_WAIT and we request a valid number of vectors. | ||
337 | */ | ||
334 | bio = bio_alloc(GFP_KERNEL, nr_vecs); | 338 | bio = bio_alloc(GFP_KERNEL, nr_vecs); |
335 | 339 | ||
336 | bio->bi_bdev = bdev; | 340 | bio->bi_bdev = bdev; |
@@ -342,7 +346,6 @@ dio_bio_alloc(struct dio *dio, struct block_device *bdev, | |||
342 | 346 | ||
343 | dio->bio = bio; | 347 | dio->bio = bio; |
344 | dio->logical_offset_in_bio = dio->cur_page_fs_offset; | 348 | dio->logical_offset_in_bio = dio->cur_page_fs_offset; |
345 | return 0; | ||
346 | } | 349 | } |
347 | 350 | ||
348 | /* | 351 | /* |
@@ -583,8 +586,9 @@ static int dio_new_bio(struct dio *dio, sector_t start_sector) | |||
583 | goto out; | 586 | goto out; |
584 | sector = start_sector << (dio->blkbits - 9); | 587 | sector = start_sector << (dio->blkbits - 9); |
585 | nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev)); | 588 | nr_pages = min(dio->pages_in_io, bio_get_nr_vecs(dio->map_bh.b_bdev)); |
589 | nr_pages = min(nr_pages, BIO_MAX_PAGES); | ||
586 | BUG_ON(nr_pages <= 0); | 590 | BUG_ON(nr_pages <= 0); |
587 | ret = dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); | 591 | dio_bio_alloc(dio, dio->map_bh.b_bdev, sector, nr_pages); |
588 | dio->boundary = 0; | 592 | dio->boundary = 0; |
589 | out: | 593 | out: |
590 | return ret; | 594 | return ret; |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 2232b3c780bd..7aa7d4f8984a 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -74,16 +74,14 @@ static struct inode *gfs2_iget(struct super_block *sb, u64 no_addr) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * GFS2 lookup code fills in vfs inode contents based on info obtained | 77 | * gfs2_set_iop - Sets inode operations |
78 | * from directory entry inside gfs2_inode_lookup(). This has caused issues | 78 | * @inode: The inode with correct i_mode filled in |
79 | * with NFS code path since its get_dentry routine doesn't have the relevant | ||
80 | * directory entry when gfs2_inode_lookup() is invoked. Part of the code | ||
81 | * segment inside gfs2_inode_lookup code needs to get moved around. | ||
82 | * | 79 | * |
83 | * Clears I_NEW as well. | 80 | * GFS2 lookup code fills in vfs inode contents based on info obtained |
84 | **/ | 81 | * from directory entry inside gfs2_inode_lookup(). |
82 | */ | ||
85 | 83 | ||
86 | void gfs2_set_iop(struct inode *inode) | 84 | static void gfs2_set_iop(struct inode *inode) |
87 | { | 85 | { |
88 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 86 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
89 | umode_t mode = inode->i_mode; | 87 | umode_t mode = inode->i_mode; |
@@ -106,8 +104,6 @@ void gfs2_set_iop(struct inode *inode) | |||
106 | inode->i_op = &gfs2_file_iops; | 104 | inode->i_op = &gfs2_file_iops; |
107 | init_special_inode(inode, inode->i_mode, inode->i_rdev); | 105 | init_special_inode(inode, inode->i_mode, inode->i_rdev); |
108 | } | 106 | } |
109 | |||
110 | unlock_new_inode(inode); | ||
111 | } | 107 | } |
112 | 108 | ||
113 | /** | 109 | /** |
@@ -119,10 +115,8 @@ void gfs2_set_iop(struct inode *inode) | |||
119 | * Returns: A VFS inode, or an error | 115 | * Returns: A VFS inode, or an error |
120 | */ | 116 | */ |
121 | 117 | ||
122 | struct inode *gfs2_inode_lookup(struct super_block *sb, | 118 | struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type, |
123 | unsigned int type, | 119 | u64 no_addr, u64 no_formal_ino) |
124 | u64 no_addr, | ||
125 | u64 no_formal_ino) | ||
126 | { | 120 | { |
127 | struct inode *inode; | 121 | struct inode *inode; |
128 | struct gfs2_inode *ip; | 122 | struct gfs2_inode *ip; |
@@ -152,51 +146,37 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, | |||
152 | error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh); | 146 | error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh); |
153 | if (unlikely(error)) | 147 | if (unlikely(error)) |
154 | goto fail_iopen; | 148 | goto fail_iopen; |
155 | ip->i_iopen_gh.gh_gl->gl_object = ip; | ||
156 | 149 | ||
150 | ip->i_iopen_gh.gh_gl->gl_object = ip; | ||
157 | gfs2_glock_put(io_gl); | 151 | gfs2_glock_put(io_gl); |
158 | io_gl = NULL; | 152 | io_gl = NULL; |
159 | 153 | ||
160 | if ((type == DT_UNKNOWN) && (no_formal_ino == 0)) | ||
161 | goto gfs2_nfsbypass; | ||
162 | |||
163 | inode->i_mode = DT2IF(type); | ||
164 | |||
165 | /* | ||
166 | * We must read the inode in order to work out its type in | ||
167 | * this case. Note that this doesn't happen often as we normally | ||
168 | * know the type beforehand. This code path only occurs during | ||
169 | * unlinked inode recovery (where it is safe to do this glock, | ||
170 | * which is not true in the general case). | ||
171 | */ | ||
172 | if (type == DT_UNKNOWN) { | 154 | if (type == DT_UNKNOWN) { |
173 | struct gfs2_holder gh; | 155 | /* Inode glock must be locked already */ |
174 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); | 156 | error = gfs2_inode_refresh(GFS2_I(inode)); |
175 | if (unlikely(error)) | 157 | if (error) |
176 | goto fail_glock; | 158 | goto fail_refresh; |
177 | /* Inode is now uptodate */ | 159 | } else { |
178 | gfs2_glock_dq_uninit(&gh); | 160 | inode->i_mode = DT2IF(type); |
179 | } | 161 | } |
180 | 162 | ||
181 | gfs2_set_iop(inode); | 163 | gfs2_set_iop(inode); |
164 | unlock_new_inode(inode); | ||
182 | } | 165 | } |
183 | 166 | ||
184 | gfs2_nfsbypass: | ||
185 | return inode; | 167 | return inode; |
186 | fail_glock: | 168 | |
187 | gfs2_glock_dq(&ip->i_iopen_gh); | 169 | fail_refresh: |
170 | ip->i_iopen_gh.gh_gl->gl_object = NULL; | ||
171 | gfs2_glock_dq_uninit(&ip->i_iopen_gh); | ||
188 | fail_iopen: | 172 | fail_iopen: |
189 | if (io_gl) | 173 | if (io_gl) |
190 | gfs2_glock_put(io_gl); | 174 | gfs2_glock_put(io_gl); |
191 | fail_put: | 175 | fail_put: |
192 | if (inode->i_state & I_NEW) | 176 | ip->i_gl->gl_object = NULL; |
193 | ip->i_gl->gl_object = NULL; | ||
194 | gfs2_glock_put(ip->i_gl); | 177 | gfs2_glock_put(ip->i_gl); |
195 | fail: | 178 | fail: |
196 | if (inode->i_state & I_NEW) | 179 | iget_failed(inode); |
197 | iget_failed(inode); | ||
198 | else | ||
199 | iput(inode); | ||
200 | return ERR_PTR(error); | 180 | return ERR_PTR(error); |
201 | } | 181 | } |
202 | 182 | ||
@@ -221,14 +201,6 @@ struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, | |||
221 | if (IS_ERR(inode)) | 201 | if (IS_ERR(inode)) |
222 | goto fail; | 202 | goto fail; |
223 | 203 | ||
224 | error = gfs2_inode_refresh(GFS2_I(inode)); | ||
225 | if (error) | ||
226 | goto fail_iput; | ||
227 | |||
228 | /* Pick up the works we bypass in gfs2_inode_lookup */ | ||
229 | if (inode->i_state & I_NEW) | ||
230 | gfs2_set_iop(inode); | ||
231 | |||
232 | /* Two extra checks for NFS only */ | 204 | /* Two extra checks for NFS only */ |
233 | if (no_formal_ino) { | 205 | if (no_formal_ino) { |
234 | error = -ESTALE; | 206 | error = -ESTALE; |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 732a183efdb3..3e00a66e7cbd 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -96,7 +96,6 @@ err: | |||
96 | return -EIO; | 96 | return -EIO; |
97 | } | 97 | } |
98 | 98 | ||
99 | extern void gfs2_set_iop(struct inode *inode); | ||
100 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, | 99 | extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type, |
101 | u64 no_addr, u64 no_formal_ino); | 100 | u64 no_addr, u64 no_formal_ino); |
102 | extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, | 101 | extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr, |
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 16c2ecac7eb7..ec73ed70bae1 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -1336,6 +1336,7 @@ static void gfs2_evict_inode(struct inode *inode) | |||
1336 | if (error) | 1336 | if (error) |
1337 | goto out_truncate; | 1337 | goto out_truncate; |
1338 | 1338 | ||
1339 | ip->i_iopen_gh.gh_flags |= GL_NOCACHE; | ||
1339 | gfs2_glock_dq_wait(&ip->i_iopen_gh); | 1340 | gfs2_glock_dq_wait(&ip->i_iopen_gh); |
1340 | gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh); | 1341 | gfs2_holder_reinit(LM_ST_EXCLUSIVE, LM_FLAG_TRY_1CB | GL_NOCACHE, &ip->i_iopen_gh); |
1341 | error = gfs2_glock_nq(&ip->i_iopen_gh); | 1342 | error = gfs2_glock_nq(&ip->i_iopen_gh); |
@@ -441,7 +441,7 @@ redo: | |||
441 | break; | 441 | break; |
442 | } | 442 | } |
443 | if (do_wakeup) { | 443 | if (do_wakeup) { |
444 | wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT); | 444 | wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); |
445 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); | 445 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); |
446 | } | 446 | } |
447 | pipe_wait(pipe); | 447 | pipe_wait(pipe); |
@@ -450,7 +450,7 @@ redo: | |||
450 | 450 | ||
451 | /* Signal writers asynchronously that there is more room. */ | 451 | /* Signal writers asynchronously that there is more room. */ |
452 | if (do_wakeup) { | 452 | if (do_wakeup) { |
453 | wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT); | 453 | wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM); |
454 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); | 454 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); |
455 | } | 455 | } |
456 | if (ret > 0) | 456 | if (ret > 0) |
@@ -612,7 +612,7 @@ redo2: | |||
612 | break; | 612 | break; |
613 | } | 613 | } |
614 | if (do_wakeup) { | 614 | if (do_wakeup) { |
615 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN); | 615 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); |
616 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); | 616 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); |
617 | do_wakeup = 0; | 617 | do_wakeup = 0; |
618 | } | 618 | } |
@@ -623,7 +623,7 @@ redo2: | |||
623 | out: | 623 | out: |
624 | mutex_unlock(&inode->i_mutex); | 624 | mutex_unlock(&inode->i_mutex); |
625 | if (do_wakeup) { | 625 | if (do_wakeup) { |
626 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN); | 626 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM); |
627 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); | 627 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); |
628 | } | 628 | } |
629 | if (ret > 0) | 629 | if (ret > 0) |
@@ -715,7 +715,7 @@ pipe_release(struct inode *inode, int decr, int decw) | |||
715 | if (!pipe->readers && !pipe->writers) { | 715 | if (!pipe->readers && !pipe->writers) { |
716 | free_pipe_info(inode); | 716 | free_pipe_info(inode); |
717 | } else { | 717 | } else { |
718 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT); | 718 | wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP); |
719 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); | 719 | kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN); |
720 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); | 720 | kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT); |
721 | } | 721 | } |
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig index 6a0068841d96..15af6222f8a4 100644 --- a/fs/proc/Kconfig +++ b/fs/proc/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | config PROC_FS | 1 | config PROC_FS |
2 | bool "/proc file system support" if EMBEDDED | 2 | bool "/proc file system support" if EXPERT |
3 | default y | 3 | default y |
4 | help | 4 | help |
5 | This is a virtual file system providing information about the status | 5 | This is a virtual file system providing information about the status |
@@ -40,7 +40,7 @@ config PROC_VMCORE | |||
40 | Exports the dump image of crashed kernel in ELF format. | 40 | Exports the dump image of crashed kernel in ELF format. |
41 | 41 | ||
42 | config PROC_SYSCTL | 42 | config PROC_SYSCTL |
43 | bool "Sysctl support (/proc/sys)" if EMBEDDED | 43 | bool "Sysctl support (/proc/sys)" if EXPERT |
44 | depends on PROC_FS | 44 | depends on PROC_FS |
45 | select SYSCTL | 45 | select SYSCTL |
46 | default y | 46 | default y |
@@ -61,7 +61,7 @@ config PROC_SYSCTL | |||
61 | config PROC_PAGE_MONITOR | 61 | config PROC_PAGE_MONITOR |
62 | default y | 62 | default y |
63 | depends on PROC_FS && MMU | 63 | depends on PROC_FS && MMU |
64 | bool "Enable /proc page monitoring" if EMBEDDED | 64 | bool "Enable /proc page monitoring" if EXPERT |
65 | help | 65 | help |
66 | Various /proc files exist to monitor process memory utilization: | 66 | Various /proc files exist to monitor process memory utilization: |
67 | /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap, | 67 | /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap, |
diff --git a/fs/sysfs/Kconfig b/fs/sysfs/Kconfig index f4b67588b9d6..8c41feacbac5 100644 --- a/fs/sysfs/Kconfig +++ b/fs/sysfs/Kconfig | |||
@@ -1,5 +1,5 @@ | |||
1 | config SYSFS | 1 | config SYSFS |
2 | bool "sysfs file system support" if EMBEDDED | 2 | bool "sysfs file system support" if EXPERT |
3 | default y | 3 | default y |
4 | help | 4 | help |
5 | The sysfs filesystem is a virtual filesystem that the kernel uses to | 5 | The sysfs filesystem is a virtual filesystem that the kernel uses to |