Mercurial > yaffs-ecoscentric-gpl
annotate devextras.h @ 403:205fa93db422
yaffs New background garbage collector and related tweaks
This commit
- introduces the yaffs background garbage collection feature
- tweaks the foregound garbage collection to do less work
- changes the way auto-checkpointing works
- tweaks the block refreshing logic.
The aim of the background garbage collector is to do at least some of the
garbage collection in the background so that writing operations will not have
to do as much garbage collection which should make writes faster. The amount of
background garbage collection is controlled by the ratio between the amount of
erased space vs the amount of free space:
* If less than quarter of free space is erased, then background gc is frequent.
* Else if less than a half of the free space is erased, then background gc is
still done reasonably frequently.
* else (at least half of the free space is erased) the background gc is done
infrequently.
Background gc is not attempted if the partition is checkpointed since that would
invalidate the checkpoint.
The auto-checkpointing feature has changed slightly. If the yaffs_auto_checkpoint
value is set to 1 or 2 then the auto checkpointing will be blocked if the erased
space is less than half the free space (ie. the auto-checkpointing is blocked to
allow background gc to progress). Oring in 4 into the yaffs_auto_checkpoint will
do a one-shot override, forcing a checkpoint and suspending background gc until
the partition is dirtied by a write, erase etc.
The block refreshing control has been changed. The dev->param.refreshPeriod now
controls how many blocks are garbage collected before another refresh is performed.
Values around 1000 probably make the best sense.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
| author | Charles Manning <cdhmanning@gmail.com> |
|---|---|
| date | Fri, 16 Apr 2010 15:39:16 +1200 |
| parents | f66f490d76b6 |
| children | b5309c9b6d7f |
| rev | line source |
|---|---|
| 0 | 1 /* |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system. |
| 0 | 3 * |
| 168 | 4 * Copyright (C) 2002-2007 Aleph One Ltd. |
| 0 | 5 * for Toby Churchill Ltd and Brightstar Engineering |
| 6 * | |
| 7 * Created by Charles Manning <charles@aleph1.co.uk> | |
| 8 * | |
| 9 * This program is free software; you can redistribute it and/or modify | |
| 10 * it under the terms of the GNU Lesser General Public License version 2.1 as | |
| 11 * published by the Free Software Foundation. | |
| 12 * | |
| 13 * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. | |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
14 */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
15 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
16 /* |
| 202 | 17 * This file is just holds extra declarations of macros that would normally |
| 18 * be providesd in the Linux kernel. These macros have been written from | |
| 19 * scratch but are functionally equivalent to the Linux ones. | |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
20 * |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
21 */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
22 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
23 #ifndef __EXTRAS_H__ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
24 #define __EXTRAS_H__ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
25 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
26 |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
27 #if !(defined __KERNEL__) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
28 |
| 202 | 29 /* Definition of types */ |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
30 typedef unsigned char __u8; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
31 typedef unsigned short __u16; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
32 typedef unsigned __u32; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
33 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
34 #endif |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
35 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
36 /* |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
37 * This is a simple doubly linked list implementation that matches the |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
38 * way the Linux kernel doubly linked list implementation works. |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
39 */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
40 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
41 struct ylist_head { |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
42 struct ylist_head *next; /* next in chain */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
43 struct ylist_head *prev; /* previous in chain */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
44 }; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
45 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
46 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
47 /* Initialise a static list */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
48 #define YLIST_HEAD(name) \ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
49 struct ylist_head name = { &(name), &(name)} |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
50 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
51 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
52 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
53 /* Initialise a list head to an empty list */ |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
54 #define YINIT_LIST_HEAD(p) \ |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
55 do { \ |
| 275 | 56 (p)->next = (p);\ |
| 57 (p)->prev = (p); \ | |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
58 } while (0) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
59 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
60 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
61 /* Add an element to a list */ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
62 static __inline__ void ylist_add(struct ylist_head *newEntry, |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
63 struct ylist_head *list) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
64 { |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
65 struct ylist_head *listNext = list->next; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
66 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
67 list->next = newEntry; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
68 newEntry->prev = list; |
| 202 | 69 newEntry->next = listNext; |
| 70 listNext->prev = newEntry; | |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
71 |
| 0 | 72 } |
| 73 | |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
74 static __inline__ void ylist_add_tail(struct ylist_head *newEntry, |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
75 struct ylist_head *list) |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
76 { |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
77 struct ylist_head *listPrev = list->prev; |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
78 |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
79 list->prev = newEntry; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
80 newEntry->next = list; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
81 newEntry->prev = listPrev; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
82 listPrev->next = newEntry; |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
83 |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
84 } |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
85 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
86 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
87 /* Take an element out of its current list, with or without |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
88 * reinitialising the links.of the entry*/ |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
89 static __inline__ void ylist_del(struct ylist_head *entry) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
90 { |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
91 struct ylist_head *listNext = entry->next; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
92 struct ylist_head *listPrev = entry->prev; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
93 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
94 listNext->prev = listPrev; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
95 listPrev->next = listNext; |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
96 |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
97 } |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
98 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
99 static __inline__ void ylist_del_init(struct ylist_head *entry) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
100 { |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
101 ylist_del(entry); |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
102 entry->next = entry->prev = entry; |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
103 } |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
104 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
105 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
106 /* Test if the list is empty */ |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
107 static __inline__ int ylist_empty(struct ylist_head *entry) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
108 { |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
109 return (entry->next == entry); |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
110 } |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
111 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
112 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
113 /* ylist_entry takes a pointer to a list entry and offsets it to that |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
114 * we can find a pointer to the object it is embedded in. |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
115 */ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
116 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
117 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
118 #define ylist_entry(entry, type, member) \ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
119 ((type *)((char *)(entry)-(unsigned long)(&((type *)NULL)->member))) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
120 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
121 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
122 /* ylist_for_each and list_for_each_safe iterate over lists. |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
123 * ylist_for_each_safe uses temporary storage to make the list delete safe |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
124 */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
125 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
126 #define ylist_for_each(itervar, list) \ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
127 for (itervar = (list)->next; itervar != (list); itervar = itervar->next) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
128 |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
129 #define ylist_for_each_safe(itervar, saveVar, list) \ |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
130 for (itervar = (list)->next, saveVar = (list)->next->next; \ |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
131 itervar != (list); itervar = saveVar, saveVar = saveVar->next) |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
132 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
133 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
134 #if !(defined __KERNEL__) |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
135 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
136 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
137 #ifndef WIN32 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
138 #include <sys/stat.h> |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
139 #endif |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
140 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
141 |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
142 #ifdef CONFIG_YAFFS_PROVIDE_DEFS |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
143 /* File types */ |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
144 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
145 |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
146 #define DT_UNKNOWN 0 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
147 #define DT_FIFO 1 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
148 #define DT_CHR 2 |
| 0 | 149 #define DT_DIR 4 |
| 150 #define DT_BLK 6 | |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
151 #define DT_REG 8 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
152 #define DT_LNK 10 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
153 #define DT_SOCK 12 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
154 #define DT_WHT 14 |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
155 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
156 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
157 #ifndef WIN32 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
158 #include <sys/stat.h> |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
159 #endif |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
160 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
161 /* |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
162 * Attribute flags. These should be or-ed together to figure out what |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
163 * has been changed! |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
164 */ |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
165 #define ATTR_MODE 1 |
|
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
166 #define ATTR_UID 2 |
| 0 | 167 #define ATTR_GID 4 |
| 168 #define ATTR_SIZE 8 | |
| 169 #define ATTR_ATIME 16 | |
| 170 #define ATTR_MTIME 32 | |
| 171 #define ATTR_CTIME 64 | |
| 202 | 172 |
| 0 | 173 struct iattr { |
| 77 | 174 unsigned int ia_valid; |
| 175 unsigned ia_mode; | |
| 176 unsigned ia_uid; | |
| 177 unsigned ia_gid; | |
| 178 unsigned ia_size; | |
| 179 unsigned ia_atime; | |
| 180 unsigned ia_mtime; | |
| 181 unsigned ia_ctime; | |
|
271
c0dfae9e8073
Major whitespace/style changes to match Linux checkpatch.pl code style
wookey <wookey>
parents:
210
diff
changeset
|
182 unsigned int ia_attr_flags; |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
183 }; |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
184 |
|
204
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
185 #endif |
|
0f70320a2274
Check in inband tags, some extra yaffs direct functions and some other changes
charles <charles>
parents:
203
diff
changeset
|
186 |
|
210
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
187 #else |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
188 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
189 #include <linux/types.h> |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
190 #include <linux/fs.h> |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
191 #include <linux/stat.h> |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
192 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
193 #endif |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
194 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
195 |
|
8a4f31e59ad8
Some cleanups, Linux 2.6.25 handling, fix handing of root permissions
charles <charles>
parents:
208
diff
changeset
|
196 #endif |
