Add test to dereference symlink
[yaffs2.git] / yaffs_packedtags2.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
3  *
4  * Copyright (C) 2002-2018 Aleph One Ltd.
5  *
6  * Created by Charles Manning <charles@aleph1.co.uk>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License version 2.1 as
10  * published by the Free Software Foundation.
11  *
12  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
13  */
14
15 /* This is used to pack YAFFS2 tags, not YAFFS1tags. */
16
17 #ifndef __YAFFS_PACKEDTAGS2_H__
18 #define __YAFFS_PACKEDTAGS2_H__
19
20 #include "yaffs_guts.h"
21 #include "yaffs_ecc.h"
22
23 struct yaffs_packed_tags2_tags_only {
24         unsigned seq_number;
25         unsigned obj_id;
26         unsigned chunk_id;
27         unsigned n_bytes;
28 };
29
30 struct yaffs_packed_tags2 {
31         struct yaffs_packed_tags2_tags_only t;
32         struct yaffs_ecc_other ecc;
33 };
34
35 /* Full packed tags with ECC, used for oob tags */
36 void yaffs_pack_tags2(struct yaffs_dev *dev,
37                       struct yaffs_packed_tags2 *pt,
38                       const struct yaffs_ext_tags *t, int tags_ecc);
39 void yaffs_unpack_tags2(struct yaffs_dev *dev,
40                         struct yaffs_ext_tags *t, struct yaffs_packed_tags2 *pt,
41                         int tags_ecc);
42
43 /* Only the tags part (no ECC for use with inband tags */
44 void yaffs_pack_tags2_tags_only(struct yaffs_dev *dev,
45                                 struct yaffs_packed_tags2_tags_only *pt,
46                                 const struct yaffs_ext_tags *t);
47 void yaffs_unpack_tags2_tags_only(struct yaffs_dev *dev,
48                                   struct yaffs_ext_tags *t,
49                                   struct yaffs_packed_tags2_tags_only *pt);
50 #endif