diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-21 05:09:22 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-09-21 05:09:22 -0400 |
commit | 7cce2f4cb7f5f641f78c8e3eea4e7b1b96cb71c0 (patch) | |
tree | b064d077928cf224660ab1e1841cdab2c9fd8b08 /fs/ubifs | |
parent | e055f7e873d900925c222cf2d1ec955af4a9ca90 (diff) | |
parent | ebc79c4f8da0f92efa968e0328f32334a2ce80cf (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into linux-next
Conflicts:
fs/ubifs/super.c
Merge the upstream tree in order to resolve a conflict with the
per-bdi writeback changes from the linux-2.6-block tree.
Diffstat (limited to 'fs/ubifs')
-rw-r--r-- | fs/ubifs/budget.c | 32 | ||||
-rw-r--r-- | fs/ubifs/super.c | 2 |
2 files changed, 5 insertions, 29 deletions
diff --git a/fs/ubifs/budget.c b/fs/ubifs/budget.c index c1f3f99b2939..076ca50e9933 100644 --- a/fs/ubifs/budget.c +++ b/fs/ubifs/budget.c | |||
@@ -54,41 +54,15 @@ | |||
54 | * @nr_to_write: how many dirty pages to write-back | 54 | * @nr_to_write: how many dirty pages to write-back |
55 | * | 55 | * |
56 | * This function shrinks UBIFS liability by means of writing back some amount | 56 | * This function shrinks UBIFS liability by means of writing back some amount |
57 | * of dirty inodes and their pages. Returns the amount of pages which were | 57 | * of dirty inodes and their pages. |
58 | * written back. The returned value does not include dirty inodes which were | ||
59 | * synchronized. | ||
60 | * | 58 | * |
61 | * Note, this function synchronizes even VFS inodes which are locked | 59 | * Note, this function synchronizes even VFS inodes which are locked |
62 | * (@i_mutex) by the caller of the budgeting function, because write-back does | 60 | * (@i_mutex) by the caller of the budgeting function, because write-back does |
63 | * not touch @i_mutex. | 61 | * not touch @i_mutex. |
64 | */ | 62 | */ |
65 | static int shrink_liability(struct ubifs_info *c, int nr_to_write) | 63 | static void shrink_liability(struct ubifs_info *c, int nr_to_write) |
66 | { | 64 | { |
67 | int nr_written; | 65 | writeback_inodes_sb(c->vfs_sb); |
68 | struct writeback_control wbc = { | ||
69 | .sync_mode = WB_SYNC_NONE, | ||
70 | .range_end = LLONG_MAX, | ||
71 | .nr_to_write = nr_to_write, | ||
72 | }; | ||
73 | |||
74 | generic_sync_sb_inodes(c->vfs_sb, &wbc); | ||
75 | nr_written = nr_to_write - wbc.nr_to_write; | ||
76 | |||
77 | if (!nr_written) { | ||
78 | /* | ||
79 | * Re-try again but wait on pages/inodes which are being | ||
80 | * written-back concurrently (e.g., by pdflush). | ||
81 | */ | ||
82 | memset(&wbc, 0, sizeof(struct writeback_control)); | ||
83 | wbc.sync_mode = WB_SYNC_ALL; | ||
84 | wbc.range_end = LLONG_MAX; | ||
85 | wbc.nr_to_write = nr_to_write; | ||
86 | generic_sync_sb_inodes(c->vfs_sb, &wbc); | ||
87 | nr_written = nr_to_write - wbc.nr_to_write; | ||
88 | } | ||
89 | |||
90 | dbg_budg("%d pages were written back", nr_written); | ||
91 | return nr_written; | ||
92 | } | 66 | } |
93 | 67 | ||
94 | /** | 68 | /** |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 7e2b3d4d487a..333e181ee987 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -1952,6 +1952,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) | |||
1952 | * | 1952 | * |
1953 | * Read-ahead will be disabled because @c->bdi.ra_pages is 0. | 1953 | * Read-ahead will be disabled because @c->bdi.ra_pages is 0. |
1954 | */ | 1954 | */ |
1955 | c->bdi.name = "ubifs", | ||
1955 | c->bdi.capabilities = BDI_CAP_MAP_COPY; | 1956 | c->bdi.capabilities = BDI_CAP_MAP_COPY; |
1956 | c->bdi.unplug_io_fn = default_unplug_io_fn; | 1957 | c->bdi.unplug_io_fn = default_unplug_io_fn; |
1957 | err = bdi_init(&c->bdi); | 1958 | err = bdi_init(&c->bdi); |
@@ -1966,6 +1967,7 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) | |||
1966 | if (err) | 1967 | if (err) |
1967 | goto out_bdi; | 1968 | goto out_bdi; |
1968 | 1969 | ||
1970 | sb->s_bdi = &c->bdi; | ||
1969 | sb->s_fs_info = c; | 1971 | sb->s_fs_info = c; |
1970 | sb->s_magic = UBIFS_SUPER_MAGIC; | 1972 | sb->s_magic = UBIFS_SUPER_MAGIC; |
1971 | sb->s_blocksize = UBIFS_BLOCK_SIZE; | 1973 | sb->s_blocksize = UBIFS_BLOCK_SIZE; |