aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/seglist.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/seglist.h')
-rw-r--r--fs/nilfs2/seglist.h79
1 files changed, 0 insertions, 79 deletions
diff --git a/fs/nilfs2/seglist.h b/fs/nilfs2/seglist.h
deleted file mode 100644
index e448e40c1ecb..000000000000
--- a/fs/nilfs2/seglist.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * seglist.h - expediential structure and routines to handle list of segments
3 * (would be removed in a future release)
4 *
5 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 * Written by Ryusuke Konishi <ryusuke@osrg.net>
22 *
23 */
24#ifndef _NILFS_SEGLIST_H
25#define _NILFS_SEGLIST_H
26
27#include <linux/fs.h>
28#include <linux/buffer_head.h>
29#include <linux/nilfs2_fs.h>
30#include "sufile.h"
31
32struct nilfs_segment_entry {
33 __u64 segnum;
34
35 struct list_head list;
36 struct buffer_head *bh_su;
37 struct nilfs_segment_usage *raw_su;
38};
39
40
41void nilfs_dispose_segment_list(struct list_head *);
42
43static inline struct nilfs_segment_entry *
44nilfs_alloc_segment_entry(__u64 segnum)
45{
46 struct nilfs_segment_entry *ent = kmalloc(sizeof(*ent), GFP_NOFS);
47
48 if (likely(ent)) {
49 ent->segnum = segnum;
50 ent->bh_su = NULL;
51 ent->raw_su = NULL;
52 INIT_LIST_HEAD(&ent->list);
53 }
54 return ent;
55}
56
57static inline int nilfs_open_segment_entry(struct nilfs_segment_entry *ent,
58 struct inode *sufile)
59{
60 return nilfs_sufile_get_segment_usage(sufile, ent->segnum,
61 &ent->raw_su, &ent->bh_su);
62}
63
64static inline void nilfs_close_segment_entry(struct nilfs_segment_entry *ent,
65 struct inode *sufile)
66{
67 if (!ent->bh_su)
68 return;
69 nilfs_sufile_put_segment_usage(sufile, ent->segnum, ent->bh_su);
70 ent->bh_su = NULL;
71 ent->raw_su = NULL;
72}
73
74static inline void nilfs_free_segment_entry(struct nilfs_segment_entry *ent)
75{
76 kfree(ent);
77}
78
79#endif /* _NILFS_SEGLIST_H */