xref: /openbmc/linux/fs/nilfs2/dat.h (revision e63e88bc53bac7e4c3f592f8126c51a7569be673)
1a17564f5SKoji Sato /*
2a17564f5SKoji Sato  * dat.h - NILFS disk address translation.
3a17564f5SKoji Sato  *
4a17564f5SKoji Sato  * Copyright (C) 2006-2008 Nippon Telegraph and Telephone Corporation.
5a17564f5SKoji Sato  *
6a17564f5SKoji Sato  * This program is free software; you can redistribute it and/or modify
7a17564f5SKoji Sato  * it under the terms of the GNU General Public License as published by
8a17564f5SKoji Sato  * the Free Software Foundation; either version 2 of the License, or
9a17564f5SKoji Sato  * (at your option) any later version.
10a17564f5SKoji Sato  *
11a17564f5SKoji Sato  * This program is distributed in the hope that it will be useful,
12a17564f5SKoji Sato  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13a17564f5SKoji Sato  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14a17564f5SKoji Sato  * GNU General Public License for more details.
15a17564f5SKoji Sato  *
164b420ab4SRyusuke Konishi  * Written by Koji Sato.
17a17564f5SKoji Sato  */
18a17564f5SKoji Sato 
19a17564f5SKoji Sato #ifndef _NILFS_DAT_H
20a17564f5SKoji Sato #define _NILFS_DAT_H
21a17564f5SKoji Sato 
22a17564f5SKoji Sato #include <linux/types.h>
23a17564f5SKoji Sato #include <linux/buffer_head.h>
24a17564f5SKoji Sato #include <linux/fs.h>
25*e63e88bcSRyusuke Konishi #include <linux/nilfs2_ondisk.h>	/* nilfs_inode, nilfs_checkpoint */
26a17564f5SKoji Sato 
27a17564f5SKoji Sato 
28a17564f5SKoji Sato struct nilfs_palloc_req;
29a17564f5SKoji Sato 
30a17564f5SKoji Sato int nilfs_dat_translate(struct inode *, __u64, sector_t *);
31a17564f5SKoji Sato 
32a17564f5SKoji Sato int nilfs_dat_prepare_alloc(struct inode *, struct nilfs_palloc_req *);
33a17564f5SKoji Sato void nilfs_dat_commit_alloc(struct inode *, struct nilfs_palloc_req *);
34a17564f5SKoji Sato void nilfs_dat_abort_alloc(struct inode *, struct nilfs_palloc_req *);
35a17564f5SKoji Sato int nilfs_dat_prepare_start(struct inode *, struct nilfs_palloc_req *);
36a17564f5SKoji Sato void nilfs_dat_commit_start(struct inode *, struct nilfs_palloc_req *,
37a17564f5SKoji Sato 			    sector_t);
38a17564f5SKoji Sato int nilfs_dat_prepare_end(struct inode *, struct nilfs_palloc_req *);
39a17564f5SKoji Sato void nilfs_dat_commit_end(struct inode *, struct nilfs_palloc_req *, int);
40a17564f5SKoji Sato void nilfs_dat_abort_end(struct inode *, struct nilfs_palloc_req *);
41bd8169efSRyusuke Konishi int nilfs_dat_prepare_update(struct inode *, struct nilfs_palloc_req *,
42bd8169efSRyusuke Konishi 			     struct nilfs_palloc_req *);
43bd8169efSRyusuke Konishi void nilfs_dat_commit_update(struct inode *, struct nilfs_palloc_req *,
44bd8169efSRyusuke Konishi 			     struct nilfs_palloc_req *, int);
45bd8169efSRyusuke Konishi void nilfs_dat_abort_update(struct inode *, struct nilfs_palloc_req *,
46bd8169efSRyusuke Konishi 			    struct nilfs_palloc_req *);
47a17564f5SKoji Sato 
48a17564f5SKoji Sato int nilfs_dat_mark_dirty(struct inode *, __u64);
49a17564f5SKoji Sato int nilfs_dat_freev(struct inode *, __u64 *, size_t);
50a17564f5SKoji Sato int nilfs_dat_move(struct inode *, __u64, sector_t);
510c6c44cbSRyusuke Konishi ssize_t nilfs_dat_get_vinfo(struct inode *, void *, unsigned int, size_t);
52a17564f5SKoji Sato 
53f1e89c86SRyusuke Konishi int nilfs_dat_read(struct super_block *sb, size_t entry_size,
54f1e89c86SRyusuke Konishi 		   struct nilfs_inode *raw_inode, struct inode **inodep);
5579739565SRyusuke Konishi 
56a17564f5SKoji Sato #endif	/* _NILFS_DAT_H */
57