+2004-05-11 Theodore Ts'o <tytso@mit.edu>
+
+ * journal.c (sync_blockdev): Flush I/O caches to preserve ordering
+ constraints required by the journal recovery code. Thanks
+ to Junfeng Yang from the Stanford Metacompilation group
+ for pointing this out.
+
+ * jfs_user.h: Define sync_blockdev() as an emulated function,
+ instead just being a no-op.
+
2004-05-04 Theodore Ts'o <tytso@mit.edu>
* unix.c (check_if_skip): If the checkinterval is zero, then
typedef struct kdev_s *kdev_t;
-#define fsync_no_super(dev) do {} while(0)
-#define sync_blockdev(dev) do {} while(0)
#define lock_buffer(bh) do {} while(0)
#define unlock_buffer(bh) do {} while(0)
#define buffer_req(bh) 1
*/
int journal_bmap(journal_t *journal, blk_t block, unsigned long *phys);
struct buffer_head *getblk(kdev_t ctx, blk_t blocknr, int blocksize);
+void sync_blockdev(kdev_t kdev);
void ll_rw_block(int rw, int dummy, struct buffer_head *bh[]);
void mark_buffer_dirty(struct buffer_head *bh);
void mark_buffer_uptodate(struct buffer_head *bh, int val);
return bh;
}
+void sync_blockdev(kdev_t kdev)
+{
+ io_channel io;
+
+ if (kdev->k_dev == K_DEV_FS)
+ io = kdev->k_ctx->fs->io;
+ else
+ io = kdev->k_ctx->journal_io;
+
+ io_channel_flush(io);
+}
+
void ll_rw_block(int rw, int nr, struct buffer_head *bhp[])
{
int retval;