aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/Kconfig5
-rw-r--r--fs/aio.c7
-rw-r--r--fs/buffer.c18
-rw-r--r--fs/cifs/file.c26
-rw-r--r--fs/dlm/lowcomms-tcp.c2
-rw-r--r--fs/file.c2
-rw-r--r--fs/fuse/file.c4
-rw-r--r--fs/gfs2/Kconfig4
-rw-r--r--fs/hugetlbfs/inode.c2
-rw-r--r--fs/jbd/commit.c8
-rw-r--r--fs/jfs/jfs_metapage.c15
-rw-r--r--fs/pipe.c5
-rw-r--r--fs/ramfs/file-mmu.c4
-rw-r--r--fs/ramfs/file-nommu.c4
-rw-r--r--fs/reiserfs/stree.c2
-rw-r--r--fs/stack.c2
-rw-r--r--fs/sysv/super.c3
-rw-r--r--fs/sysv/sysv.h3
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c4
19 files changed, 61 insertions, 59 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index 276ff3baaafe..8cd2417a14db 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1198,13 +1198,16 @@ config EFS_FS
1198 1198
1199config JFFS_FS 1199config JFFS_FS
1200 tristate "Journalling Flash File System (JFFS) support" 1200 tristate "Journalling Flash File System (JFFS) support"
1201 depends on MTD && BLOCK 1201 depends on MTD && BLOCK && BROKEN
1202 help 1202 help
1203 JFFS is the Journalling Flash File System developed by Axis 1203 JFFS is the Journalling Flash File System developed by Axis
1204 Communications in Sweden, aimed at providing a crash/powerdown-safe 1204 Communications in Sweden, aimed at providing a crash/powerdown-safe
1205 file system for disk-less embedded devices. Further information is 1205 file system for disk-less embedded devices. Further information is
1206 available at (<http://developer.axis.com/software/jffs/>). 1206 available at (<http://developer.axis.com/software/jffs/>).
1207 1207
1208 NOTE: This filesystem is deprecated and is scheduled for removal in
1209 2.6.21. See Documentation/feature-removal-schedule.txt
1210
1208config JFFS_FS_VERBOSE 1211config JFFS_FS_VERBOSE
1209 int "JFFS debugging verbosity (0 = quiet, 3 = noisy)" 1212 int "JFFS debugging verbosity (0 = quiet, 3 = noisy)"
1210 depends on JFFS_FS 1213 depends on JFFS_FS
diff --git a/fs/aio.c b/fs/aio.c
index 5f577a63bdf0..ee20fc4240e0 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -599,9 +599,6 @@ static void use_mm(struct mm_struct *mm)
599 * by the calling kernel thread 599 * by the calling kernel thread
600 * (Note: this routine is intended to be called only 600 * (Note: this routine is intended to be called only
601 * from a kernel thread context) 601 * from a kernel thread context)
602 *
603 * Comments: Called with ctx->ctx_lock held. This nests
604 * task_lock instead ctx_lock.
605 */ 602 */
606static void unuse_mm(struct mm_struct *mm) 603static void unuse_mm(struct mm_struct *mm)
607{ 604{
@@ -850,14 +847,16 @@ static void aio_kick_handler(struct work_struct *work)
850{ 847{
851 struct kioctx *ctx = container_of(work, struct kioctx, wq.work); 848 struct kioctx *ctx = container_of(work, struct kioctx, wq.work);
852 mm_segment_t oldfs = get_fs(); 849 mm_segment_t oldfs = get_fs();
850 struct mm_struct *mm;
853 int requeue; 851 int requeue;
854 852
855 set_fs(USER_DS); 853 set_fs(USER_DS);
856 use_mm(ctx->mm); 854 use_mm(ctx->mm);
857 spin_lock_irq(&ctx->ctx_lock); 855 spin_lock_irq(&ctx->ctx_lock);
858 requeue =__aio_run_iocbs(ctx); 856 requeue =__aio_run_iocbs(ctx);
859 unuse_mm(ctx->mm); 857 mm = ctx->mm;
860 spin_unlock_irq(&ctx->ctx_lock); 858 spin_unlock_irq(&ctx->ctx_lock);
859 unuse_mm(mm);
861 set_fs(oldfs); 860 set_fs(oldfs);
862 /* 861 /*
863 * we're in a worker thread already, don't use queue_delayed_work, 862 * we're in a worker thread already, don't use queue_delayed_work,
diff --git a/fs/buffer.c b/fs/buffer.c
index d1f1b54d3108..263f88e4dffb 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2834,7 +2834,7 @@ int try_to_free_buffers(struct page *page)
2834 int ret = 0; 2834 int ret = 0;
2835 2835
2836 BUG_ON(!PageLocked(page)); 2836 BUG_ON(!PageLocked(page));
2837 if (PageWriteback(page)) 2837 if (PageDirty(page) || PageWriteback(page))
2838 return 0; 2838 return 0;
2839 2839
2840 if (mapping == NULL) { /* can this still happen? */ 2840 if (mapping == NULL) { /* can this still happen? */
@@ -2845,22 +2845,6 @@ int try_to_free_buffers(struct page *page)
2845 spin_lock(&mapping->private_lock); 2845 spin_lock(&mapping->private_lock);
2846 ret = drop_buffers(page, &buffers_to_free); 2846 ret = drop_buffers(page, &buffers_to_free);
2847 spin_unlock(&mapping->private_lock); 2847 spin_unlock(&mapping->private_lock);
2848 if (ret) {
2849 /*
2850 * If the filesystem writes its buffers by hand (eg ext3)
2851 * then we can have clean buffers against a dirty page. We
2852 * clean the page here; otherwise later reattachment of buffers
2853 * could encounter a non-uptodate page, which is unresolvable.
2854 * This only applies in the rare case where try_to_free_buffers
2855 * succeeds but the page is not freed.
2856 *
2857 * Also, during truncate, discard_buffer will have marked all
2858 * the page's buffers clean. We discover that here and clean
2859 * the page also.
2860 */
2861 if (test_clear_page_dirty(page))
2862 task_io_account_cancelled_write(PAGE_CACHE_SIZE);
2863 }
2864out: 2848out:
2865 if (buffers_to_free) { 2849 if (buffers_to_free) {
2866 struct buffer_head *bh = buffers_to_free; 2850 struct buffer_head *bh = buffers_to_free;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 0f05cab5d24a..8a49b2e77d37 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1245,14 +1245,21 @@ retry:
1245 wait_on_page_writeback(page); 1245 wait_on_page_writeback(page);
1246 1246
1247 if (PageWriteback(page) || 1247 if (PageWriteback(page) ||
1248 !test_clear_page_dirty(page)) { 1248 !clear_page_dirty_for_io(page)) {
1249 unlock_page(page); 1249 unlock_page(page);
1250 break; 1250 break;
1251 } 1251 }
1252 1252
1253 /*
1254 * This actually clears the dirty bit in the radix tree.
1255 * See cifs_writepage() for more commentary.
1256 */
1257 set_page_writeback(page);
1258
1253 if (page_offset(page) >= mapping->host->i_size) { 1259 if (page_offset(page) >= mapping->host->i_size) {
1254 done = 1; 1260 done = 1;
1255 unlock_page(page); 1261 unlock_page(page);
1262 end_page_writeback(page);
1256 break; 1263 break;
1257 } 1264 }
1258 1265
@@ -1316,6 +1323,7 @@ retry:
1316 SetPageError(page); 1323 SetPageError(page);
1317 kunmap(page); 1324 kunmap(page);
1318 unlock_page(page); 1325 unlock_page(page);
1326 end_page_writeback(page);
1319 page_cache_release(page); 1327 page_cache_release(page);
1320 } 1328 }
1321 if ((wbc->nr_to_write -= n_iov) <= 0) 1329 if ((wbc->nr_to_write -= n_iov) <= 0)
@@ -1352,11 +1360,23 @@ static int cifs_writepage(struct page* page, struct writeback_control *wbc)
1352 if (!PageUptodate(page)) { 1360 if (!PageUptodate(page)) {
1353 cFYI(1, ("ppw - page not up to date")); 1361 cFYI(1, ("ppw - page not up to date"));
1354 } 1362 }
1355 1363
1364 /*
1365 * Set the "writeback" flag, and clear "dirty" in the radix tree.
1366 *
1367 * A writepage() implementation always needs to do either this,
1368 * or re-dirty the page with "redirty_page_for_writepage()" in
1369 * the case of a failure.
1370 *
1371 * Just unlocking the page will cause the radix tree tag-bits
1372 * to fail to update with the state of the page correctly.
1373 */
1374 set_page_writeback(page);
1356 rc = cifs_partialpagewrite(page, 0, PAGE_CACHE_SIZE); 1375 rc = cifs_partialpagewrite(page, 0, PAGE_CACHE_SIZE);
1357 SetPageUptodate(page); /* BB add check for error and Clearuptodate? */ 1376 SetPageUptodate(page); /* BB add check for error and Clearuptodate? */
1358 unlock_page(page); 1377 unlock_page(page);
1359 page_cache_release(page); 1378 end_page_writeback(page);
1379 page_cache_release(page);
1360 FreeXid(xid); 1380 FreeXid(xid);
1361 return rc; 1381 return rc;
1362} 1382}
diff --git a/fs/dlm/lowcomms-tcp.c b/fs/dlm/lowcomms-tcp.c
index 8f2791fc8447..9be3a440c42a 100644
--- a/fs/dlm/lowcomms-tcp.c
+++ b/fs/dlm/lowcomms-tcp.c
@@ -143,7 +143,7 @@ static DECLARE_WAIT_QUEUE_HEAD(lowcomms_recv_waitq);
143/* An array of pointers to connections, indexed by NODEID */ 143/* An array of pointers to connections, indexed by NODEID */
144static struct connection **connections; 144static struct connection **connections;
145static DECLARE_MUTEX(connections_lock); 145static DECLARE_MUTEX(connections_lock);
146static kmem_cache_t *con_cache; 146static struct kmem_cache *con_cache;
147static int conn_array_size; 147static int conn_array_size;
148 148
149/* List of sockets that have reads pending */ 149/* List of sockets that have reads pending */
diff --git a/fs/file.c b/fs/file.c
index 857fa49e984c..c5575de01113 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -206,7 +206,7 @@ static int expand_fdtable(struct files_struct *files, int nr)
206 copy_fdtable(new_fdt, cur_fdt); 206 copy_fdtable(new_fdt, cur_fdt);
207 rcu_assign_pointer(files->fdt, new_fdt); 207 rcu_assign_pointer(files->fdt, new_fdt);
208 if (cur_fdt->max_fds > NR_OPEN_DEFAULT) 208 if (cur_fdt->max_fds > NR_OPEN_DEFAULT)
209 call_rcu(&cur_fdt->rcu, free_fdtable_rcu); 209 free_fdtable(cur_fdt);
210 } else { 210 } else {
211 /* Somebody else expanded, so undo our attempt */ 211 /* Somebody else expanded, so undo our attempt */
212 free_fdarr(new_fdt); 212 free_fdarr(new_fdt);
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 1387749201b3..f63efe1337ec 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -483,10 +483,8 @@ static int fuse_commit_write(struct file *file, struct page *page,
483 i_size_write(inode, pos); 483 i_size_write(inode, pos);
484 spin_unlock(&fc->lock); 484 spin_unlock(&fc->lock);
485 485
486 if (offset == 0 && to == PAGE_CACHE_SIZE) { 486 if (offset == 0 && to == PAGE_CACHE_SIZE)
487 clear_page_dirty(page);
488 SetPageUptodate(page); 487 SetPageUptodate(page);
489 }
490 } 488 }
491 fuse_invalidate_attr(inode); 489 fuse_invalidate_attr(inode);
492 return err; 490 return err;
diff --git a/fs/gfs2/Kconfig b/fs/gfs2/Kconfig
index c0791cbacad9..6a2ffa2db14f 100644
--- a/fs/gfs2/Kconfig
+++ b/fs/gfs2/Kconfig
@@ -34,7 +34,9 @@ config GFS2_FS_LOCKING_NOLOCK
34 34
35config GFS2_FS_LOCKING_DLM 35config GFS2_FS_LOCKING_DLM
36 tristate "GFS2 DLM locking module" 36 tristate "GFS2 DLM locking module"
37 depends on GFS2_FS 37 depends on GFS2_FS && NET && INET && (IPV6 || IPV6=n)
38 select IP_SCTP if DLM_SCTP
39 select CONFIGFS_FS
38 select DLM 40 select DLM
39 help 41 help
40 Multiple node locking module for GFS2 42 Multiple node locking module for GFS2
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index ed2c22340ad7..4f4cd132b571 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -176,7 +176,7 @@ static int hugetlbfs_commit_write(struct file *file,
176 176
177static void truncate_huge_page(struct page *page) 177static void truncate_huge_page(struct page *page)
178{ 178{
179 clear_page_dirty(page); 179 cancel_dirty_page(page, /* No IO accounting for huge pages? */0);
180 ClearPageUptodate(page); 180 ClearPageUptodate(page);
181 remove_from_page_cache(page); 181 remove_from_page_cache(page);
182 put_page(page); 182 put_page(page);
diff --git a/fs/jbd/commit.c b/fs/jbd/commit.c
index 10be51290a27..be4648bc7a2f 100644
--- a/fs/jbd/commit.c
+++ b/fs/jbd/commit.c
@@ -248,8 +248,12 @@ write_out_data:
248 bufs = 0; 248 bufs = 0;
249 goto write_out_data; 249 goto write_out_data;
250 } 250 }
251 } 251 } else if (!locked && buffer_locked(bh)) {
252 else { 252 __journal_file_buffer(jh, commit_transaction,
253 BJ_Locked);
254 jbd_unlock_bh_state(bh);
255 put_bh(bh);
256 } else {
253 BUFFER_TRACE(bh, "writeout complete: unfile"); 257 BUFFER_TRACE(bh, "writeout complete: unfile");
254 __journal_unfile_buffer(jh); 258 __journal_unfile_buffer(jh);
255 jbd_unlock_bh_state(bh); 259 jbd_unlock_bh_state(bh);
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index b1a1c7296014..ceaf03b94935 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -764,22 +764,9 @@ void release_metapage(struct metapage * mp)
764 } else if (mp->lsn) /* discard_metapage doesn't remove it */ 764 } else if (mp->lsn) /* discard_metapage doesn't remove it */
765 remove_from_logsync(mp); 765 remove_from_logsync(mp);
766 766
767#if MPS_PER_PAGE == 1
768 /*
769 * If we know this is the only thing in the page, we can throw
770 * the page out of the page cache. If pages are larger, we
771 * don't want to do this.
772 */
773
774 /* Retest mp->count since we may have released page lock */
775 if (test_bit(META_discard, &mp->flag) && !mp->count) {
776 clear_page_dirty(page);
777 ClearPageUptodate(page);
778 }
779#else
780 /* Try to keep metapages from using up too much memory */ 767 /* Try to keep metapages from using up too much memory */
781 drop_metapage(page, mp); 768 drop_metapage(page, mp);
782#endif 769
783 unlock_page(page); 770 unlock_page(page);
784 page_cache_release(page); 771 page_cache_release(page);
785} 772}
diff --git a/fs/pipe.c b/fs/pipe.c
index 9a06e8e48e8d..68090e84f589 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -935,8 +935,9 @@ struct file *create_write_pipe(void)
935 935
936void free_write_pipe(struct file *f) 936void free_write_pipe(struct file *f)
937{ 937{
938 mntput(f->f_path.mnt); 938 free_pipe_info(f->f_dentry->d_inode);
939 dput(f->f_path.dentry); 939 dput(f->f_path.dentry);
940 mntput(f->f_path.mnt);
940 put_filp(f); 941 put_filp(f);
941} 942}
942 943
@@ -994,6 +995,8 @@ int do_pipe(int *fd)
994 err_fdr: 995 err_fdr:
995 put_unused_fd(fdr); 996 put_unused_fd(fdr);
996 err_read_pipe: 997 err_read_pipe:
998 dput(fr->f_dentry);
999 mntput(fr->f_vfsmnt);
997 put_filp(fr); 1000 put_filp(fr);
998 err_write_pipe: 1001 err_write_pipe:
999 free_write_pipe(fw); 1002 free_write_pipe(fw);
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c
index 0947fb57dcf3..54ebbc84207f 100644
--- a/fs/ramfs/file-mmu.c
+++ b/fs/ramfs/file-mmu.c
@@ -25,11 +25,13 @@
25 */ 25 */
26 26
27#include <linux/fs.h> 27#include <linux/fs.h>
28#include <linux/mm.h>
28 29
29const struct address_space_operations ramfs_aops = { 30const struct address_space_operations ramfs_aops = {
30 .readpage = simple_readpage, 31 .readpage = simple_readpage,
31 .prepare_write = simple_prepare_write, 32 .prepare_write = simple_prepare_write,
32 .commit_write = simple_commit_write 33 .commit_write = simple_commit_write,
34 .set_page_dirty = __set_page_dirty_nobuffers,
33}; 35};
34 36
35const struct file_operations ramfs_file_operations = { 37const struct file_operations ramfs_file_operations = {
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 61cbe1ef06b9..e9d6c4733282 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/fs.h> 13#include <linux/fs.h>
14#include <linux/mm.h>
14#include <linux/pagemap.h> 15#include <linux/pagemap.h>
15#include <linux/highmem.h> 16#include <linux/highmem.h>
16#include <linux/init.h> 17#include <linux/init.h>
@@ -30,7 +31,8 @@ static int ramfs_nommu_setattr(struct dentry *, struct iattr *);
30const struct address_space_operations ramfs_aops = { 31const struct address_space_operations ramfs_aops = {
31 .readpage = simple_readpage, 32 .readpage = simple_readpage,
32 .prepare_write = simple_prepare_write, 33 .prepare_write = simple_prepare_write,
33 .commit_write = simple_commit_write 34 .commit_write = simple_commit_write,
35 .set_page_dirty = __set_page_dirty_nobuffers,
34}; 36};
35 37
36const struct file_operations ramfs_file_operations = { 38const struct file_operations ramfs_file_operations = {
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c
index 47e7027ea39f..afb21ea45302 100644
--- a/fs/reiserfs/stree.c
+++ b/fs/reiserfs/stree.c
@@ -1459,7 +1459,7 @@ static void unmap_buffers(struct page *page, loff_t pos)
1459 bh = next; 1459 bh = next;
1460 } while (bh != head); 1460 } while (bh != head);
1461 if (PAGE_SIZE == bh->b_size) { 1461 if (PAGE_SIZE == bh->b_size) {
1462 clear_page_dirty(page); 1462 cancel_dirty_page(page, PAGE_CACHE_SIZE);
1463 } 1463 }
1464 } 1464 }
1465 } 1465 }
diff --git a/fs/stack.c b/fs/stack.c
index 5ddbc34535f9..8ffb880d2f46 100644
--- a/fs/stack.c
+++ b/fs/stack.c
@@ -34,7 +34,5 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
34 dest->i_ctime = src->i_ctime; 34 dest->i_ctime = src->i_ctime;
35 dest->i_blkbits = src->i_blkbits; 35 dest->i_blkbits = src->i_blkbits;
36 dest->i_flags = src->i_flags; 36 dest->i_flags = src->i_flags;
37
38 fsstack_copy_inode_size(dest, src);
39} 37}
40EXPORT_SYMBOL_GPL(fsstack_copy_attr_all); 38EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
diff --git a/fs/sysv/super.c b/fs/sysv/super.c
index dc9e7dc07fb7..6f9707a1b954 100644
--- a/fs/sysv/super.c
+++ b/fs/sysv/super.c
@@ -528,9 +528,6 @@ static struct file_system_type v7_fs_type = {
528 .fs_flags = FS_REQUIRES_DEV, 528 .fs_flags = FS_REQUIRES_DEV,
529}; 529};
530 530
531extern int sysv_init_icache(void) __init;
532extern void sysv_destroy_icache(void);
533
534static int __init init_sysv_fs(void) 531static int __init init_sysv_fs(void)
535{ 532{
536 int error; 533 int error;
diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h
index 9dcc82120935..dcb18b2171fe 100644
--- a/fs/sysv/sysv.h
+++ b/fs/sysv/sysv.h
@@ -143,6 +143,9 @@ extern int sysv_sync_inode(struct inode *);
143extern int sysv_sync_file(struct file *, struct dentry *, int); 143extern int sysv_sync_file(struct file *, struct dentry *, int);
144extern void sysv_set_inode(struct inode *, dev_t); 144extern void sysv_set_inode(struct inode *, dev_t);
145extern int sysv_getattr(struct vfsmount *, struct dentry *, struct kstat *); 145extern int sysv_getattr(struct vfsmount *, struct dentry *, struct kstat *);
146extern int sysv_init_icache(void);
147extern void sysv_destroy_icache(void);
148
146 149
147/* dir.c */ 150/* dir.c */
148extern struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct page **); 151extern struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct page **);
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index b56eb754e2d2..7b54461695e2 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -341,9 +341,9 @@ xfs_start_page_writeback(
341{ 341{
342 ASSERT(PageLocked(page)); 342 ASSERT(PageLocked(page));
343 ASSERT(!PageWriteback(page)); 343 ASSERT(!PageWriteback(page));
344 set_page_writeback(page);
345 if (clear_dirty) 344 if (clear_dirty)
346 clear_page_dirty(page); 345 clear_page_dirty_for_io(page);
346 set_page_writeback(page);
347 unlock_page(page); 347 unlock_page(page);
348 if (!buffers) { 348 if (!buffers) {
349 end_page_writeback(page); 349 end_page_writeback(page);