xref: /openbmc/linux/fs/nilfs2/dat.h (revision 4b420ab4eedc7a816ad0f2278871019de1a8ccef)
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  *
16*4b420ab4SRyusuke 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>
25a17564f5SKoji Sato 
26a17564f5SKoji Sato 
27a17564f5SKoji Sato struct nilfs_palloc_req;
28a17564f5SKoji Sato 
29a17564f5SKoji Sato int nilfs_dat_translate(struct inode *, __u64, sector_t *);
30a17564f5SKoji Sato 
31a17564f5SKoji Sato int nilfs_dat_prepare_alloc(struct inode *, struct nilfs_palloc_req *);
32a17564f5SKoji Sato void nilfs_dat_commit_alloc(struct inode *, struct nilfs_palloc_req *);
33a17564f5SKoji Sato void nilfs_dat_abort_alloc(struct inode *, struct nilfs_palloc_req *);
34a17564f5SKoji Sato int nilfs_dat_prepare_start(struct inode *, struct nilfs_palloc_req *);
35a17564f5SKoji Sato void nilfs_dat_commit_start(struct inode *, struct nilfs_palloc_req *,
36a17564f5SKoji Sato 			    sector_t);
37a17564f5SKoji Sato int nilfs_dat_prepare_end(struct inode *, struct nilfs_palloc_req *);
38a17564f5SKoji Sato void nilfs_dat_commit_end(struct inode *, struct nilfs_palloc_req *, int);
39a17564f5SKoji Sato void nilfs_dat_abort_end(struct inode *, struct nilfs_palloc_req *);
40bd8169efSRyusuke Konishi int nilfs_dat_prepare_update(struct inode *, struct nilfs_palloc_req *,
41bd8169efSRyusuke Konishi 			     struct nilfs_palloc_req *);
42bd8169efSRyusuke Konishi void nilfs_dat_commit_update(struct inode *, struct nilfs_palloc_req *,
43bd8169efSRyusuke Konishi 			     struct nilfs_palloc_req *, int);
44bd8169efSRyusuke Konishi void nilfs_dat_abort_update(struct inode *, struct nilfs_palloc_req *,
45bd8169efSRyusuke Konishi 			    struct nilfs_palloc_req *);
46a17564f5SKoji Sato 
47a17564f5SKoji Sato int nilfs_dat_mark_dirty(struct inode *, __u64);
48a17564f5SKoji Sato int nilfs_dat_freev(struct inode *, __u64 *, size_t);
49a17564f5SKoji Sato int nilfs_dat_move(struct inode *, __u64, sector_t);
50003ff182SRyusuke Konishi ssize_t nilfs_dat_get_vinfo(struct inode *, void *, unsigned, size_t);
51a17564f5SKoji Sato 
52f1e89c86SRyusuke Konishi int nilfs_dat_read(struct super_block *sb, size_t entry_size,
53f1e89c86SRyusuke Konishi 		   struct nilfs_inode *raw_inode, struct inode **inodep);
5479739565SRyusuke Konishi 
55a17564f5SKoji Sato #endif	/* _NILFS_DAT_H */
56