diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2013-04-29 18:07:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:33 -0400 |
commit | 7136851117744f1d291bed6d307432699d405109 (patch) | |
tree | 6dc7d6bef45e24ad0d3d5d1b9290a81109758172 /include | |
parent | 106c992a5ebef28193cf5958e49ceff5e4aebb04 (diff) |
mm: make snapshotting pages for stable writes a per-bio operation
Walking a bio's page mappings has proved problematic, so create a new
bio flag to indicate that a bio's data needs to be snapshotted in order
to guarantee stable pages during writeback. Next, for the one user
(ext3/jbd) of snapshotting, hook all the places where writes can be
initiated without PG_writeback set, and set BIO_SNAP_STABLE there.
We must also flag journal "metadata" bios for stable writeout, since
file data can be written through the journal. Finally, the
MS_SNAP_STABLE mount flag (only used by ext3) is now superfluous, so get
rid of it.
[akpm@linux-foundation.org: rename _submit_bh()'s `flags' to `bio_flags', delobotomize the _submit_bh declaration]
[akpm@linux-foundation.org: teeny cleanup]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blk_types.h | 3 | ||||
-rw-r--r-- | include/linux/buffer_head.h | 1 | ||||
-rw-r--r-- | include/uapi/linux/fs.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index cdf11191e645..22990cf4439d 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -111,12 +111,13 @@ struct bio { | |||
111 | #define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ | 111 | #define BIO_FS_INTEGRITY 9 /* fs owns integrity data, not block layer */ |
112 | #define BIO_QUIET 10 /* Make BIO Quiet */ | 112 | #define BIO_QUIET 10 /* Make BIO Quiet */ |
113 | #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ | 113 | #define BIO_MAPPED_INTEGRITY 11/* integrity metadata has been remapped */ |
114 | #define BIO_SNAP_STABLE 12 /* bio data must be snapshotted during write */ | ||
114 | 115 | ||
115 | /* | 116 | /* |
116 | * Flags starting here get preserved by bio_reset() - this includes | 117 | * Flags starting here get preserved by bio_reset() - this includes |
117 | * BIO_POOL_IDX() | 118 | * BIO_POOL_IDX() |
118 | */ | 119 | */ |
119 | #define BIO_RESET_BITS 12 | 120 | #define BIO_RESET_BITS 13 |
120 | 121 | ||
121 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 122 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
122 | 123 | ||
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5afc4f94d110..4c16c4a88d47 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -181,6 +181,7 @@ void ll_rw_block(int, int, struct buffer_head * bh[]); | |||
181 | int sync_dirty_buffer(struct buffer_head *bh); | 181 | int sync_dirty_buffer(struct buffer_head *bh); |
182 | int __sync_dirty_buffer(struct buffer_head *bh, int rw); | 182 | int __sync_dirty_buffer(struct buffer_head *bh, int rw); |
183 | void write_dirty_buffer(struct buffer_head *bh, int rw); | 183 | void write_dirty_buffer(struct buffer_head *bh, int rw); |
184 | int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags); | ||
184 | int submit_bh(int, struct buffer_head *); | 185 | int submit_bh(int, struct buffer_head *); |
185 | void write_boundary_block(struct block_device *bdev, | 186 | void write_boundary_block(struct block_device *bdev, |
186 | sector_t bblock, unsigned blocksize); | 187 | sector_t bblock, unsigned blocksize); |
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index c7fc1e6517c3..a4ed56cf0eac 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h | |||
@@ -88,7 +88,6 @@ struct inodes_stat_t { | |||
88 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ | 88 | #define MS_STRICTATIME (1<<24) /* Always perform atime updates */ |
89 | 89 | ||
90 | /* These sb flags are internal to the kernel */ | 90 | /* These sb flags are internal to the kernel */ |
91 | #define MS_SNAP_STABLE (1<<27) /* Snapshot pages during writeback, if needed */ | ||
92 | #define MS_NOSEC (1<<28) | 91 | #define MS_NOSEC (1<<28) |
93 | #define MS_BORN (1<<29) | 92 | #define MS_BORN (1<<29) |
94 | #define MS_ACTIVE (1<<30) | 93 | #define MS_ACTIVE (1<<30) |