~ubuntu-branches/ubuntu/trusty/nilfs-tools/trusty

« back to all changes in this revision

Viewing changes to sbin/cleanerd/cleanerd.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2011-07-10 17:10:21 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110710171021-xkbtr81jprb97iec
Tags: upstream-2.1.0~rc1
ImportĀ upstreamĀ versionĀ 2.1.0~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * cleanerd.h - NILFS cleaner daemon.
3
 
 *
4
 
 * Copyright (C) 2007 Nippon Telegraph and Telephone Corporation.
5
 
 *
6
 
 * This file is part of NILFS.
7
 
 *
8
 
 * NILFS is free software; you can redistribute it and/or modify
9
 
 * it under the terms of the GNU General Public License as published by
10
 
 * the Free Software Foundation; either version 2 of the License, or
11
 
 * (at your option) any later version.
12
 
 *
13
 
 * NILFS is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with NILFS; if not, write to the Free Software
20
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21
 
 *
22
 
 * Written by Koji Sato <koji@osrg.net>.
23
 
 *
24
 
 * Maintained by Ryusuke Konishi <ryusuke@osrg.net> from 2008.
25
 
 */
26
 
 
27
 
#ifndef CLEANERD_H
28
 
#define CLEANERD_H
29
 
 
30
 
#include <sys/types.h>
31
 
#include <sys/stat.h>
32
 
#include <fcntl.h>
33
 
#include <string.h>
34
 
#include "nilfs.h"
35
 
#include "cldconfig.h"
36
 
 
37
 
 
38
 
/**
39
 
 * struct nilfs_cleanerd - nilfs cleaner daemon
40
 
 * @c_nilfs: nilfs
41
 
 * @c_config: config structure
42
 
 * @c_conffile: configuration file name
43
 
 * @c_running: running state
44
 
 * @c_fallback: fallback state
45
 
 * @c_ncleansegs: number of semgents cleaned per cycle
46
 
 * @c_cleaning_interval: cleaning interval
47
 
 * @c_protcno: the minimum of checkpoint numbers within protection period
48
 
 * @c_prottime: start time of protection period
49
 
 * @c_target: target time for sleeping
50
 
 */
51
 
struct nilfs_cleanerd {
52
 
        struct nilfs *c_nilfs;
53
 
        struct nilfs_cldconfig c_config;
54
 
        char *c_conffile;
55
 
        int c_running;
56
 
        int c_fallback;
57
 
        int c_ncleansegs;
58
 
        time_t c_cleaning_interval;
59
 
        nilfs_cno_t c_protcno;
60
 
        __u64 c_prottime;
61
 
        struct timeval c_target;
62
 
};
63
 
 
64
 
#ifndef SYSCONFDIR
65
 
#define SYSCONFDIR              "/etc"
66
 
#endif  /* SYSCONFDIR */
67
 
#define NILFS_CLEANERD_CONFFILE SYSCONFDIR "/nilfs_cleanerd.conf"
68
 
 
69
 
/**
70
 
 * struct nilfs_segimp - segment importance
71
 
 * @si_segnum: segment number
72
 
 * @si_importance: importance of segment
73
 
 */
74
 
struct nilfs_segimp {
75
 
        __u64 si_segnum;
76
 
        unsigned long long si_importance;
77
 
};
78
 
 
79
 
#endif  /* CLEANERD_H */