File: disk_info.h

package info (click to toggle)
noflushd 2.7.5-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 792 kB
  • ctags: 302
  • sloc: ansic: 2,537; sh: 1,142; makefile: 85
file content (61 lines) | stat: -rw-r--r-- 1,675 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
 * <disk_info.h>
 * 
 * (C) 2000 Daniel Kobras <kobras@linux.de>
 * 
 * $Id: disk_info.h,v 1.7 2004/01/12 22:52:38 nold Exp $
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */             

#include <sys/time.h>

#ifndef _NFD_DISK_INFO_H
#define _NFD_DISK_INFO_H

typedef struct disk_info_s *disk_info_t;

#include "timeout.h"
#include "state.h"
#include "spindown.h"

struct disk_info_s {
	disk_info_t next;
	disk_state_t state;
	int	major;
	int	minor;
	int     time_left;
	tolist_t timeouts;
	int	is_rw;
	char    *name;		/* Name as given by user */
	time_t  spundown_at;
	spindown_t spindown;
};
	

disk_info_t disk_info_init(void);
disk_info_t disk_info_get_byname(disk_info_t head, char *name);
void disk_info_setup(disk_info_t di, tolist_t tohead);
void disk_info_mark_ro(disk_info_t);
char *disk_info_get_devname(disk_info_t);
void disk_info_release_devname(char *);

#define disk_info_foreach(head, di) \
	for (di=head; di; di=di->next)

#define disk_info_is_rw(di) \
	(di->is_rw != 0)

#endif