~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/jffs2/summary.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /fs/jffs2/summary.h (Version linux-6.12-rc7) and /fs/jffs2/summary.h (Version linux-4.16.18)


  1 /*                                                  1 /*
  2  * JFFS2 -- Journalling Flash File System, Ver      2  * JFFS2 -- Journalling Flash File System, Version 2.
  3  *                                                  3  *
  4  * Copyright © 2004  Ferenc Havasi <havasi@in      4  * Copyright © 2004  Ferenc Havasi <havasi@inf.u-szeged.hu>,
  5  *                   Zoltan Sogor <weth@inf.u-      5  *                   Zoltan Sogor <weth@inf.u-szeged.hu>,
  6  *                   Patrik Kluba <pajko@halom      6  *                   Patrik Kluba <pajko@halom.u-szeged.hu>,
  7  *                   University of Szeged, Hun      7  *                   University of Szeged, Hungary
  8  *                                                  8  *
  9  * For licensing information, see the file 'LI      9  * For licensing information, see the file 'LICENCE' in this directory.
 10  *                                                 10  *
 11  */                                                11  */
 12                                                    12 
 13 #ifndef JFFS2_SUMMARY_H                            13 #ifndef JFFS2_SUMMARY_H
 14 #define JFFS2_SUMMARY_H                            14 #define JFFS2_SUMMARY_H
 15                                                    15 
 16 /* Limit summary size to 64KiB so that we can      16 /* Limit summary size to 64KiB so that we can kmalloc it. If the summary
 17    is larger than that, we have to just ditch      17    is larger than that, we have to just ditch it and avoid using summary
 18    for the eraseblock in question... and it pr     18    for the eraseblock in question... and it probably doesn't hurt us much
 19    anyway. */                                      19    anyway. */
 20 #define MAX_SUMMARY_SIZE 65536                     20 #define MAX_SUMMARY_SIZE 65536
 21                                                    21 
 22 #include <linux/uio.h>                             22 #include <linux/uio.h>
 23 #include <linux/jffs2.h>                           23 #include <linux/jffs2.h>
 24                                                    24 
 25 #define BLK_STATE_ALLFF         0                  25 #define BLK_STATE_ALLFF         0
 26 #define BLK_STATE_CLEAN         1                  26 #define BLK_STATE_CLEAN         1
 27 #define BLK_STATE_PARTDIRTY     2                  27 #define BLK_STATE_PARTDIRTY     2
 28 #define BLK_STATE_CLEANMARKER   3                  28 #define BLK_STATE_CLEANMARKER   3
 29 #define BLK_STATE_ALLDIRTY      4                  29 #define BLK_STATE_ALLDIRTY      4
 30 #define BLK_STATE_BADBLOCK      5                  30 #define BLK_STATE_BADBLOCK      5
 31                                                    31 
 32 #define JFFS2_SUMMARY_NOSUM_SIZE 0xffffffff        32 #define JFFS2_SUMMARY_NOSUM_SIZE 0xffffffff
 33 #define JFFS2_SUMMARY_INODE_SIZE (sizeof(struc     33 #define JFFS2_SUMMARY_INODE_SIZE (sizeof(struct jffs2_sum_inode_flash))
 34 #define JFFS2_SUMMARY_DIRENT_SIZE(x) (sizeof(s     34 #define JFFS2_SUMMARY_DIRENT_SIZE(x) (sizeof(struct jffs2_sum_dirent_flash) + (x))
 35 #define JFFS2_SUMMARY_XATTR_SIZE (sizeof(struc     35 #define JFFS2_SUMMARY_XATTR_SIZE (sizeof(struct jffs2_sum_xattr_flash))
 36 #define JFFS2_SUMMARY_XREF_SIZE (sizeof(struct     36 #define JFFS2_SUMMARY_XREF_SIZE (sizeof(struct jffs2_sum_xref_flash))
 37                                                    37 
 38 /* Summary structures used on flash */             38 /* Summary structures used on flash */
 39                                                    39 
 40 struct jffs2_sum_unknown_flash                     40 struct jffs2_sum_unknown_flash
 41 {                                                  41 {
 42         jint16_t nodetype;      /* node type *     42         jint16_t nodetype;      /* node type */
 43 };                                                 43 };
 44                                                    44 
 45 struct jffs2_sum_inode_flash                       45 struct jffs2_sum_inode_flash
 46 {                                                  46 {
 47         jint16_t nodetype;      /* node type *     47         jint16_t nodetype;      /* node type */
 48         jint32_t inode;         /* inode numbe     48         jint32_t inode;         /* inode number */
 49         jint32_t version;       /* inode versi     49         jint32_t version;       /* inode version */
 50         jint32_t offset;        /* offset on j     50         jint32_t offset;        /* offset on jeb */
 51         jint32_t totlen;        /* record leng     51         jint32_t totlen;        /* record length */
 52 } __attribute__((packed));                         52 } __attribute__((packed));
 53                                                    53 
 54 struct jffs2_sum_dirent_flash                      54 struct jffs2_sum_dirent_flash
 55 {                                                  55 {
 56         jint16_t nodetype;      /* == JFFS_NOD     56         jint16_t nodetype;      /* == JFFS_NODETYPE_DIRENT */
 57         jint32_t totlen;        /* record leng     57         jint32_t totlen;        /* record length */
 58         jint32_t offset;        /* offset on j     58         jint32_t offset;        /* offset on jeb */
 59         jint32_t pino;          /* parent inod     59         jint32_t pino;          /* parent inode */
 60         jint32_t version;       /* dirent vers     60         jint32_t version;       /* dirent version */
 61         jint32_t ino;           /* == zero for     61         jint32_t ino;           /* == zero for unlink */
 62         uint8_t nsize;          /* dirent name     62         uint8_t nsize;          /* dirent name size */
 63         uint8_t type;           /* dirent type     63         uint8_t type;           /* dirent type */
 64         uint8_t name[]; /* dirent name */      !!  64         uint8_t name[0];        /* dirent name */
 65 } __attribute__((packed));                         65 } __attribute__((packed));
 66                                                    66 
 67 struct jffs2_sum_xattr_flash                       67 struct jffs2_sum_xattr_flash
 68 {                                                  68 {
 69         jint16_t nodetype;      /* == JFFS2_NO     69         jint16_t nodetype;      /* == JFFS2_NODETYPE_XATR */
 70         jint32_t xid;           /* xattr ident     70         jint32_t xid;           /* xattr identifier */
 71         jint32_t version;       /* version num     71         jint32_t version;       /* version number */
 72         jint32_t offset;        /* offset on j     72         jint32_t offset;        /* offset on jeb */
 73         jint32_t totlen;        /* node length     73         jint32_t totlen;        /* node length */
 74 } __attribute__((packed));                         74 } __attribute__((packed));
 75                                                    75 
 76 struct jffs2_sum_xref_flash                        76 struct jffs2_sum_xref_flash
 77 {                                                  77 {
 78         jint16_t nodetype;      /* == JFFS2_NO     78         jint16_t nodetype;      /* == JFFS2_NODETYPE_XREF */
 79         jint32_t offset;        /* offset on j     79         jint32_t offset;        /* offset on jeb */
 80 } __attribute__((packed));                         80 } __attribute__((packed));
 81                                                    81 
 82 union jffs2_sum_flash                              82 union jffs2_sum_flash
 83 {                                                  83 {
 84         struct jffs2_sum_unknown_flash u;          84         struct jffs2_sum_unknown_flash u;
 85         struct jffs2_sum_inode_flash i;            85         struct jffs2_sum_inode_flash i;
 86         struct jffs2_sum_dirent_flash d;           86         struct jffs2_sum_dirent_flash d;
 87         struct jffs2_sum_xattr_flash x;            87         struct jffs2_sum_xattr_flash x;
 88         struct jffs2_sum_xref_flash r;             88         struct jffs2_sum_xref_flash r;
 89 };                                                 89 };
 90                                                    90 
 91 /* Summary structures used in the memory */        91 /* Summary structures used in the memory */
 92                                                    92 
 93 struct jffs2_sum_unknown_mem                       93 struct jffs2_sum_unknown_mem
 94 {                                                  94 {
 95         union jffs2_sum_mem *next;                 95         union jffs2_sum_mem *next;
 96         jint16_t nodetype;      /* node type *     96         jint16_t nodetype;      /* node type */
 97 };                                                 97 };
 98                                                    98 
 99 struct jffs2_sum_inode_mem                         99 struct jffs2_sum_inode_mem
100 {                                                 100 {
101         union jffs2_sum_mem *next;                101         union jffs2_sum_mem *next;
102         jint16_t nodetype;      /* node type *    102         jint16_t nodetype;      /* node type */
103         jint32_t inode;         /* inode numbe    103         jint32_t inode;         /* inode number */
104         jint32_t version;       /* inode versi    104         jint32_t version;       /* inode version */
105         jint32_t offset;        /* offset on j    105         jint32_t offset;        /* offset on jeb */
106         jint32_t totlen;        /* record leng    106         jint32_t totlen;        /* record length */
107 } __attribute__((packed));                        107 } __attribute__((packed));
108                                                   108 
109 struct jffs2_sum_dirent_mem                       109 struct jffs2_sum_dirent_mem
110 {                                                 110 {
111         union jffs2_sum_mem *next;                111         union jffs2_sum_mem *next;
112         jint16_t nodetype;      /* == JFFS_NOD    112         jint16_t nodetype;      /* == JFFS_NODETYPE_DIRENT */
113         jint32_t totlen;        /* record leng    113         jint32_t totlen;        /* record length */
114         jint32_t offset;        /* ofset on je    114         jint32_t offset;        /* ofset on jeb */
115         jint32_t pino;          /* parent inod    115         jint32_t pino;          /* parent inode */
116         jint32_t version;       /* dirent vers    116         jint32_t version;       /* dirent version */
117         jint32_t ino;           /* == zero for    117         jint32_t ino;           /* == zero for unlink */
118         uint8_t nsize;          /* dirent name    118         uint8_t nsize;          /* dirent name size */
119         uint8_t type;           /* dirent type    119         uint8_t type;           /* dirent type */
120         uint8_t name[]; /* dirent name */      !! 120         uint8_t name[0];        /* dirent name */
121 } __attribute__((packed));                        121 } __attribute__((packed));
122                                                   122 
123 struct jffs2_sum_xattr_mem                        123 struct jffs2_sum_xattr_mem
124 {                                                 124 {
125         union jffs2_sum_mem *next;                125         union jffs2_sum_mem *next;
126         jint16_t nodetype;                        126         jint16_t nodetype;
127         jint32_t xid;                             127         jint32_t xid;
128         jint32_t version;                         128         jint32_t version;
129         jint32_t offset;                          129         jint32_t offset;
130         jint32_t totlen;                          130         jint32_t totlen;
131 } __attribute__((packed));                        131 } __attribute__((packed));
132                                                   132 
133 struct jffs2_sum_xref_mem                         133 struct jffs2_sum_xref_mem
134 {                                                 134 {
135         union jffs2_sum_mem *next;                135         union jffs2_sum_mem *next;
136         jint16_t nodetype;                        136         jint16_t nodetype;
137         jint32_t offset;                          137         jint32_t offset;
138 } __attribute__((packed));                        138 } __attribute__((packed));
139                                                   139 
140 union jffs2_sum_mem                               140 union jffs2_sum_mem
141 {                                                 141 {
142         struct jffs2_sum_unknown_mem u;           142         struct jffs2_sum_unknown_mem u;
143         struct jffs2_sum_inode_mem i;             143         struct jffs2_sum_inode_mem i;
144         struct jffs2_sum_dirent_mem d;            144         struct jffs2_sum_dirent_mem d;
145         struct jffs2_sum_xattr_mem x;             145         struct jffs2_sum_xattr_mem x;
146         struct jffs2_sum_xref_mem r;              146         struct jffs2_sum_xref_mem r;
147 };                                                147 };
148                                                   148 
149 /* Summary related information stored in super    149 /* Summary related information stored in superblock */
150                                                   150 
151 struct jffs2_summary                              151 struct jffs2_summary
152 {                                                 152 {
153         uint32_t sum_size;      /* collected s    153         uint32_t sum_size;      /* collected summary information for nextblock */
154         uint32_t sum_num;                         154         uint32_t sum_num;
155         uint32_t sum_padded;                      155         uint32_t sum_padded;
156         union jffs2_sum_mem *sum_list_head;       156         union jffs2_sum_mem *sum_list_head;
157         union jffs2_sum_mem *sum_list_tail;       157         union jffs2_sum_mem *sum_list_tail;
158                                                   158 
159         jint32_t *sum_buf;      /* buffer for     159         jint32_t *sum_buf;      /* buffer for writing out summary */
160 };                                                160 };
161                                                   161 
162 /* Summary marker is stored at the end of ever    162 /* Summary marker is stored at the end of every sumarized erase block */
163                                                   163 
164 struct jffs2_sum_marker                           164 struct jffs2_sum_marker
165 {                                                 165 {
166         jint32_t offset;        /* offset of t    166         jint32_t offset;        /* offset of the summary node in the jeb */
167         jint32_t magic;         /* == JFFS2_SU    167         jint32_t magic;         /* == JFFS2_SUM_MAGIC */
168 };                                                168 };
169                                                   169 
170 #define JFFS2_SUMMARY_FRAME_SIZE (sizeof(struc    170 #define JFFS2_SUMMARY_FRAME_SIZE (sizeof(struct jffs2_raw_summary) + sizeof(struct jffs2_sum_marker))
171                                                   171 
172 #ifdef CONFIG_JFFS2_SUMMARY     /* SUMMARY SUP    172 #ifdef CONFIG_JFFS2_SUMMARY     /* SUMMARY SUPPORT ENABLED */
173                                                   173 
174 #define jffs2_sum_active() (1)                    174 #define jffs2_sum_active() (1)
175 int jffs2_sum_init(struct jffs2_sb_info *c);      175 int jffs2_sum_init(struct jffs2_sb_info *c);
176 void jffs2_sum_exit(struct jffs2_sb_info *c);     176 void jffs2_sum_exit(struct jffs2_sb_info *c);
177 void jffs2_sum_disable_collecting(struct jffs2    177 void jffs2_sum_disable_collecting(struct jffs2_summary *s);
178 int jffs2_sum_is_disabled(struct jffs2_summary    178 int jffs2_sum_is_disabled(struct jffs2_summary *s);
179 void jffs2_sum_reset_collected(struct jffs2_su    179 void jffs2_sum_reset_collected(struct jffs2_summary *s);
180 void jffs2_sum_move_collected(struct jffs2_sb_    180 void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s);
181 int jffs2_sum_add_kvec(struct jffs2_sb_info *c    181 int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs,
182                         unsigned long count,      182                         unsigned long count,  uint32_t to);
183 int jffs2_sum_write_sumnode(struct jffs2_sb_in    183 int jffs2_sum_write_sumnode(struct jffs2_sb_info *c);
184 int jffs2_sum_add_padding_mem(struct jffs2_sum    184 int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size);
185 int jffs2_sum_add_inode_mem(struct jffs2_summa    185 int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs);
186 int jffs2_sum_add_dirent_mem(struct jffs2_summ    186 int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, uint32_t ofs);
187 int jffs2_sum_add_xattr_mem(struct jffs2_summa    187 int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs);
188 int jffs2_sum_add_xref_mem(struct jffs2_summar    188 int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs);
189 int jffs2_sum_scan_sumnode(struct jffs2_sb_inf    189 int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,
190                            struct jffs2_raw_su    190                            struct jffs2_raw_summary *summary, uint32_t sumlen,
191                            uint32_t *pseudo_ra    191                            uint32_t *pseudo_random);
192                                                   192 
193 #else                           /* SUMMARY DIS    193 #else                           /* SUMMARY DISABLED */
194                                                   194 
195 #define jffs2_sum_active() (0)                    195 #define jffs2_sum_active() (0)
196 #define jffs2_sum_init(a) (0)                     196 #define jffs2_sum_init(a) (0)
197 #define jffs2_sum_exit(a) do { } while (0)     !! 197 #define jffs2_sum_exit(a)
198 #define jffs2_sum_disable_collecting(a)           198 #define jffs2_sum_disable_collecting(a)
199 #define jffs2_sum_is_disabled(a) (0)              199 #define jffs2_sum_is_disabled(a) (0)
200 #define jffs2_sum_reset_collected(a) do { } wh !! 200 #define jffs2_sum_reset_collected(a)
201 #define jffs2_sum_add_kvec(a,b,c,d) (0)           201 #define jffs2_sum_add_kvec(a,b,c,d) (0)
202 #define jffs2_sum_move_collected(a,b) do { } w !! 202 #define jffs2_sum_move_collected(a,b)
203 #define jffs2_sum_write_sumnode(a) (0)            203 #define jffs2_sum_write_sumnode(a) (0)
204 #define jffs2_sum_add_padding_mem(a,b) do { }  !! 204 #define jffs2_sum_add_padding_mem(a,b)
205 #define jffs2_sum_add_inode_mem(a,b,c) do { }  !! 205 #define jffs2_sum_add_inode_mem(a,b,c)
206 #define jffs2_sum_add_dirent_mem(a,b,c) do { } !! 206 #define jffs2_sum_add_dirent_mem(a,b,c)
207 #define jffs2_sum_add_xattr_mem(a,b,c) do { }  !! 207 #define jffs2_sum_add_xattr_mem(a,b,c)
208 #define jffs2_sum_add_xref_mem(a,b,c) do { } w !! 208 #define jffs2_sum_add_xref_mem(a,b,c)
209 #define jffs2_sum_scan_sumnode(a,b,c,d,e) (0)     209 #define jffs2_sum_scan_sumnode(a,b,c,d,e) (0)
210                                                   210 
211 #endif /* CONFIG_JFFS2_SUMMARY */                 211 #endif /* CONFIG_JFFS2_SUMMARY */
212                                                   212 
213 #endif /* JFFS2_SUMMARY_H */                      213 #endif /* JFFS2_SUMMARY_H */
214                                                   214 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php