aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/dir.c2
-rw-r--r--fs/afs/flock.c5
-rw-r--r--fs/afs/mntpt.c1
-rw-r--r--fs/afs/super.c24
-rw-r--r--fs/afs/write.c19
5 files changed, 12 insertions, 39 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 0d38c09bd55e..5439e1bc9a86 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -1045,7 +1045,7 @@ static int afs_link(struct dentry *from, struct inode *dir,
1045 if (ret < 0) 1045 if (ret < 0)
1046 goto link_error; 1046 goto link_error;
1047 1047
1048 atomic_inc(&vnode->vfs_inode.i_count); 1048 ihold(&vnode->vfs_inode);
1049 d_instantiate(dentry, &vnode->vfs_inode); 1049 d_instantiate(dentry, &vnode->vfs_inode);
1050 key_put(key); 1050 key_put(key);
1051 _leave(" = 0"); 1051 _leave(" = 0");
diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index 0931bc1325eb..757d664575dd 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -9,7 +9,6 @@
9 * 2 of the License, or (at your option) any later version. 9 * 2 of the License, or (at your option) any later version.
10 */ 10 */
11 11
12#include <linux/smp_lock.h>
13#include "internal.h" 12#include "internal.h"
14 13
15#define AFS_LOCK_GRANTED 0 14#define AFS_LOCK_GRANTED 0
@@ -274,7 +273,7 @@ static int afs_do_setlk(struct file *file, struct file_lock *fl)
274 273
275 type = (fl->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE; 274 type = (fl->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE;
276 275
277 lock_kernel(); 276 lock_flocks();
278 277
279 /* make sure we've got a callback on this file and that our view of the 278 /* make sure we've got a callback on this file and that our view of the
280 * data version is up to date */ 279 * data version is up to date */
@@ -421,7 +420,7 @@ given_lock:
421 afs_vnode_fetch_status(vnode, NULL, key); 420 afs_vnode_fetch_status(vnode, NULL, key);
422 421
423error: 422error:
424 unlock_kernel(); 423 unlock_flocks();
425 _leave(" = %d", ret); 424 _leave(" = %d", ret);
426 return ret; 425 return ret;
427 426
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c
index 6d552686c498..6153417caf57 100644
--- a/fs/afs/mntpt.c
+++ b/fs/afs/mntpt.c
@@ -29,6 +29,7 @@ static void afs_mntpt_expiry_timed_out(struct work_struct *work);
29 29
30const struct file_operations afs_mntpt_file_operations = { 30const struct file_operations afs_mntpt_file_operations = {
31 .open = afs_mntpt_open, 31 .open = afs_mntpt_open,
32 .llseek = noop_llseek,
32}; 33};
33 34
34const struct inode_operations afs_mntpt_inode_operations = { 35const struct inode_operations afs_mntpt_inode_operations = {
diff --git a/fs/afs/super.c b/fs/afs/super.c
index 77e1e5a61154..27201cffece4 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -19,7 +19,6 @@
19#include <linux/mount.h> 19#include <linux/mount.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/smp_lock.h>
23#include <linux/fs.h> 22#include <linux/fs.h>
24#include <linux/pagemap.h> 23#include <linux/pagemap.h>
25#include <linux/parser.h> 24#include <linux/parser.h>
@@ -30,9 +29,8 @@
30#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */ 29#define AFS_FS_MAGIC 0x6B414653 /* 'kAFS' */
31 30
32static void afs_i_init_once(void *foo); 31static void afs_i_init_once(void *foo);
33static int afs_get_sb(struct file_system_type *fs_type, 32static struct dentry *afs_mount(struct file_system_type *fs_type,
34 int flags, const char *dev_name, 33 int flags, const char *dev_name, void *data);
35 void *data, struct vfsmount *mnt);
36static struct inode *afs_alloc_inode(struct super_block *sb); 34static struct inode *afs_alloc_inode(struct super_block *sb);
37static void afs_put_super(struct super_block *sb); 35static void afs_put_super(struct super_block *sb);
38static void afs_destroy_inode(struct inode *inode); 36static void afs_destroy_inode(struct inode *inode);
@@ -41,7 +39,7 @@ static int afs_statfs(struct dentry *dentry, struct kstatfs *buf);
41struct file_system_type afs_fs_type = { 39struct file_system_type afs_fs_type = {
42 .owner = THIS_MODULE, 40 .owner = THIS_MODULE,
43 .name = "afs", 41 .name = "afs",
44 .get_sb = afs_get_sb, 42 .mount = afs_mount,
45 .kill_sb = kill_anon_super, 43 .kill_sb = kill_anon_super,
46 .fs_flags = 0, 44 .fs_flags = 0,
47}; 45};
@@ -360,11 +358,8 @@ error:
360/* 358/*
361 * get an AFS superblock 359 * get an AFS superblock
362 */ 360 */
363static int afs_get_sb(struct file_system_type *fs_type, 361static struct dentry *afs_mount(struct file_system_type *fs_type,
364 int flags, 362 int flags, const char *dev_name, void *options)
365 const char *dev_name,
366 void *options,
367 struct vfsmount *mnt)
368{ 363{
369 struct afs_mount_params params; 364 struct afs_mount_params params;
370 struct super_block *sb; 365 struct super_block *sb;
@@ -428,12 +423,11 @@ static int afs_get_sb(struct file_system_type *fs_type,
428 ASSERTCMP(sb->s_flags, &, MS_ACTIVE); 423 ASSERTCMP(sb->s_flags, &, MS_ACTIVE);
429 } 424 }
430 425
431 simple_set_mnt(mnt, sb);
432 afs_put_volume(params.volume); 426 afs_put_volume(params.volume);
433 afs_put_cell(params.cell); 427 afs_put_cell(params.cell);
434 kfree(new_opts); 428 kfree(new_opts);
435 _leave(" = 0 [%p]", sb); 429 _leave(" = 0 [%p]", sb);
436 return 0; 430 return dget(sb->s_root);
437 431
438error: 432error:
439 afs_put_volume(params.volume); 433 afs_put_volume(params.volume);
@@ -441,7 +435,7 @@ error:
441 key_put(params.key); 435 key_put(params.key);
442 kfree(new_opts); 436 kfree(new_opts);
443 _leave(" = %d", ret); 437 _leave(" = %d", ret);
444 return ret; 438 return ERR_PTR(ret);
445} 439}
446 440
447/* 441/*
@@ -453,12 +447,8 @@ static void afs_put_super(struct super_block *sb)
453 447
454 _enter(""); 448 _enter("");
455 449
456 lock_kernel();
457
458 afs_put_volume(as->volume); 450 afs_put_volume(as->volume);
459 451
460 unlock_kernel();
461
462 _leave(""); 452 _leave("");
463} 453}
464 454
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 722743b152d8..15690bb1d3b5 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -438,7 +438,6 @@ no_more:
438 */ 438 */
439int afs_writepage(struct page *page, struct writeback_control *wbc) 439int afs_writepage(struct page *page, struct writeback_control *wbc)
440{ 440{
441 struct backing_dev_info *bdi = page->mapping->backing_dev_info;
442 struct afs_writeback *wb; 441 struct afs_writeback *wb;
443 int ret; 442 int ret;
444 443
@@ -455,8 +454,6 @@ int afs_writepage(struct page *page, struct writeback_control *wbc)
455 } 454 }
456 455
457 wbc->nr_to_write -= ret; 456 wbc->nr_to_write -= ret;
458 if (wbc->nonblocking && bdi_write_congested(bdi))
459 wbc->encountered_congestion = 1;
460 457
461 _leave(" = 0"); 458 _leave(" = 0");
462 return 0; 459 return 0;
@@ -469,7 +466,6 @@ static int afs_writepages_region(struct address_space *mapping,
469 struct writeback_control *wbc, 466 struct writeback_control *wbc,
470 pgoff_t index, pgoff_t end, pgoff_t *_next) 467 pgoff_t index, pgoff_t end, pgoff_t *_next)
471{ 468{
472 struct backing_dev_info *bdi = mapping->backing_dev_info;
473 struct afs_writeback *wb; 469 struct afs_writeback *wb;
474 struct page *page; 470 struct page *page;
475 int ret, n; 471 int ret, n;
@@ -529,11 +525,6 @@ static int afs_writepages_region(struct address_space *mapping,
529 525
530 wbc->nr_to_write -= ret; 526 wbc->nr_to_write -= ret;
531 527
532 if (wbc->nonblocking && bdi_write_congested(bdi)) {
533 wbc->encountered_congestion = 1;
534 break;
535 }
536
537 cond_resched(); 528 cond_resched();
538 } while (index < end && wbc->nr_to_write > 0); 529 } while (index < end && wbc->nr_to_write > 0);
539 530
@@ -548,24 +539,16 @@ static int afs_writepages_region(struct address_space *mapping,
548int afs_writepages(struct address_space *mapping, 539int afs_writepages(struct address_space *mapping,
549 struct writeback_control *wbc) 540 struct writeback_control *wbc)
550{ 541{
551 struct backing_dev_info *bdi = mapping->backing_dev_info;
552 pgoff_t start, end, next; 542 pgoff_t start, end, next;
553 int ret; 543 int ret;
554 544
555 _enter(""); 545 _enter("");
556 546
557 if (wbc->nonblocking && bdi_write_congested(bdi)) {
558 wbc->encountered_congestion = 1;
559 _leave(" = 0 [congest]");
560 return 0;
561 }
562
563 if (wbc->range_cyclic) { 547 if (wbc->range_cyclic) {
564 start = mapping->writeback_index; 548 start = mapping->writeback_index;
565 end = -1; 549 end = -1;
566 ret = afs_writepages_region(mapping, wbc, start, end, &next); 550 ret = afs_writepages_region(mapping, wbc, start, end, &next);
567 if (start > 0 && wbc->nr_to_write > 0 && ret == 0 && 551 if (start > 0 && wbc->nr_to_write > 0 && ret == 0)
568 !(wbc->nonblocking && wbc->encountered_congestion))
569 ret = afs_writepages_region(mapping, wbc, 0, start, 552 ret = afs_writepages_region(mapping, wbc, 0, start,
570 &next); 553 &next);
571 mapping->writeback_index = next; 554 mapping->writeback_index = next;