xref: /openbmc/linux/fs/nilfs2/dat.h (revision 003ff182)
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  *
16a17564f5SKoji Sato  * You should have received a copy of the GNU General Public License
17a17564f5SKoji Sato  * along with this program; if not, write to the Free Software
18a17564f5SKoji Sato  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19a17564f5SKoji Sato  *
20a17564f5SKoji Sato  * Written by Koji Sato <koji@osrg.net>.
21a17564f5SKoji Sato  */
22a17564f5SKoji Sato 
23a17564f5SKoji Sato #ifndef _NILFS_DAT_H
24a17564f5SKoji Sato #define _NILFS_DAT_H
25a17564f5SKoji Sato 
26a17564f5SKoji Sato #include <linux/types.h>
27a17564f5SKoji Sato #include <linux/buffer_head.h>
28a17564f5SKoji Sato #include <linux/fs.h>
29a17564f5SKoji Sato 
30a17564f5SKoji Sato #define NILFS_DAT_GFP	NILFS_MDT_GFP
31a17564f5SKoji Sato 
32a17564f5SKoji Sato struct nilfs_palloc_req;
33a17564f5SKoji Sato 
34a17564f5SKoji Sato int nilfs_dat_translate(struct inode *, __u64, sector_t *);
35a17564f5SKoji Sato 
36a17564f5SKoji Sato int nilfs_dat_prepare_alloc(struct inode *, struct nilfs_palloc_req *);
37a17564f5SKoji Sato void nilfs_dat_commit_alloc(struct inode *, struct nilfs_palloc_req *);
38a17564f5SKoji Sato void nilfs_dat_abort_alloc(struct inode *, struct nilfs_palloc_req *);
39a17564f5SKoji Sato int nilfs_dat_prepare_start(struct inode *, struct nilfs_palloc_req *);
40a17564f5SKoji Sato void nilfs_dat_commit_start(struct inode *, struct nilfs_palloc_req *,
41a17564f5SKoji Sato 			    sector_t);
42a17564f5SKoji Sato void nilfs_dat_abort_start(struct inode *, struct nilfs_palloc_req *);
43a17564f5SKoji Sato int nilfs_dat_prepare_end(struct inode *, struct nilfs_palloc_req *);
44a17564f5SKoji Sato void nilfs_dat_commit_end(struct inode *, struct nilfs_palloc_req *, int);
45a17564f5SKoji Sato void nilfs_dat_abort_end(struct inode *, 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 
52a17564f5SKoji Sato #endif	/* _NILFS_DAT_H */
53