Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
[linux/fpc-iii.git] / drivers / staging / cowloop / cowloop.h
blobbbd4a35ac6677e48dc6239b6c28a2cb4b76b6587
1 /*
2 ** DO NOT MODIFY THESE VALUES (would make old cowfiles unusable)
3 */
4 #define MAPUNIT 1024 /* blocksize for bit in bitmap */
5 #define MUSHIFT 10 /* bitshift for bit in bitmap */
6 #define MUMASK 0x3ff /* bitmask for bit in bitmap */
8 #define COWMAGIC 0x574f437f /* byte-swapped '7f C O W' */
9 #define COWDIRTY 0x01
10 #define COWPACKED 0x02
11 #define COWVERSION 1
13 struct cowhead
15 int magic; /* identifies a cowfile */
16 short version; /* version of cowhead */
17 short flags; /* flags indicating status */
18 unsigned long mapunit; /* blocksize per bit in bitmap */
19 unsigned long mapsize; /* total size of bitmap (bytes) */
20 unsigned long doffset; /* start-offset datablocks in cow */
21 unsigned long rdoblocks; /* size of related read-only file */
22 unsigned long rdofingerprint; /* fingerprint of read-only file */
23 unsigned long cowused; /* number of datablocks used in cow */
26 #define COWDEVDIR "/dev/cow/"
27 #define COWDEVICE COWDEVDIR "%ld"
28 #define COWCONTROL COWDEVDIR "ctl"
30 #define MAXCOWS 1024
31 #define COWCTL (MAXCOWS-1) /* minor number of /dev/cow/ctl */
33 #define COWPROCDIR "/proc/cow/"
34 #define COWPROCFILE COWPROCDIR "%d"
37 ** ioctl related stuff
39 #define ANYDEV ((unsigned long)-1)
41 struct cowpair
43 unsigned char *rdofile; /* pathname of the rdofile */
44 unsigned char *cowfile; /* pathname of the cowfile */
45 unsigned short rdoflen; /* length of rdofile pathname */
46 unsigned short cowflen; /* length of cowfile pathname */
47 unsigned long device; /* requested/returned device number */
50 struct cowwatch
52 int flags; /* request flags */
53 unsigned long device; /* requested device number */
54 unsigned long threshold; /* continue if free Kb < threshold */
55 unsigned long totalkb; /* ret: total filesystem size (Kb) */
56 unsigned long availkb; /* ret: free filesystem size (Kb) */
59 #define WATCHWAIT 0x01 /* block until threshold reached */
61 #define COWSYNC _IO ('C', 1)
62 #define COWMKPAIR _IOW ('C', 2, struct cowpair)
63 #define COWRMPAIR _IOW ('C', 3, unsigned long)
64 #define COWWATCH _IOW ('C', 4, struct cowwatch)
65 #define COWCLOSE _IOW ('C', 5, unsigned long)
66 #define COWRDOPEN _IOW ('C', 6, unsigned long)