23 #include <linux/types.h>
25 #include <linux/string.h>
26 #include <linux/errno.h>
33 #define NILFS_CNO_MIN ((__u64)1)
34 #define NILFS_CNO_MAX (~(__u64)0)
53 static int nilfs_dat_prepare_entry(
struct inode *dat,
60 static void nilfs_dat_commit_entry(
struct inode *dat,
64 nilfs_mdt_mark_dirty(dat);
68 static void nilfs_dat_abort_entry(
struct inode *dat,
82 ret = nilfs_dat_prepare_entry(dat, req, 1);
103 nilfs_dat_commit_entry(dat, req);
108 nilfs_dat_abort_entry(dat, req);
112 static void nilfs_dat_commit_free(
struct inode *dat,
126 nilfs_dat_commit_entry(dat, req);
134 ret = nilfs_dat_prepare_entry(dat, req, 0);
152 nilfs_dat_commit_entry(dat, req);
163 ret = nilfs_dat_prepare_entry(dat, req, 0);
179 nilfs_dat_abort_entry(dat, req);
200 end = nilfs_mdt_cno(dat);
208 nilfs_dat_commit_free(dat, req);
210 nilfs_dat_commit_entry(dat, req);
227 if (start == nilfs_mdt_cno(dat) && blocknr == 0)
229 nilfs_dat_abort_entry(dat, req);
283 ret = nilfs_dat_prepare_entry(dat, &req, 0);
285 nilfs_dat_commit_entry(dat, &req);
330 struct buffer_head *entry_bh;
347 if (!buffer_nilfs_redirected(entry_bh)) {
359 (
unsigned long long)vblocknr,
371 nilfs_mdt_mark_dirty(dat);
399 struct buffer_head *entry_bh, *bh;
409 if (!nilfs_doing_gc() && buffer_nilfs_redirected(entry_bh)) {
436 struct buffer_head *entry_bh;
441 unsigned long entries_per_block = NILFS_MDT(dat)->mi_entries_per_block;
444 for (i = 0; i < nvi; i +=
n) {
452 do_div(first, entries_per_block);
453 first *= entries_per_block;
454 last = first + entries_per_block - 1;
458 j++, n++, vinfo = (
void *)vinfo + visz) {
460 dat, vinfo->vi_vblocknr, entry_bh, kaddr);
501 di = NILFS_DAT_I(dat);