1 /* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
5 #if !defined( __FS_REISER4_PLUGIN_DIRECTORY_ENTRY_H__ )
6 #define __FS_REISER4_PLUGIN_DIRECTORY_ENTRY_H__
8 #include "../../forward.h"
9 #include "../../dformat.h"
10 #include "../../kassign.h"
11 #include "../../key.h"
14 #include <linux/dcache.h> /* for struct dentry */
16 typedef struct directory_entry_format
{
17 /* key of object stat-data. It's not necessary to store whole
18 key here, because it's always key of stat-data, so minor
19 packing locality and offset can be omitted here. But this
20 relies on particular key allocation scheme for stat-data, so,
21 for extensibility sake, whole key can be stored here.
23 We store key as array of bytes, because we don't want 8-byte
24 alignment of dir entries.
27 /* file name. Null terminated string. */
29 } directory_entry_format
;
31 void print_de(const char *prefix
, coord_t
* coord
);
32 int extract_key_de(const coord_t
* coord
, reiser4_key
* key
);
33 int update_key_de(const coord_t
* coord
, const reiser4_key
* key
,
35 char *extract_name_de(const coord_t
* coord
, char *buf
);
36 unsigned extract_file_type_de(const coord_t
* coord
);
37 int add_entry_de(struct inode
*dir
, coord_t
* coord
,
38 lock_handle
* lh
, const struct dentry
*name
,
39 reiser4_dir_entry_desc
* entry
);
40 int rem_entry_de(struct inode
*dir
, const struct qstr
*name
, coord_t
* coord
,
41 lock_handle
* lh
, reiser4_dir_entry_desc
* entry
);
42 int max_name_len_de(const struct inode
*dir
);
44 int de_rem_and_shrink(struct inode
*dir
, coord_t
* coord
, int length
);
46 char *extract_dent_name(const coord_t
* coord
,
47 directory_entry_format
* dent
, char *buf
);
50 #define DE_NAME_BUF_LEN (24)
52 #define DE_NAME_BUF_LEN (16)
55 /* __FS_REISER4_PLUGIN_DIRECTORY_ENTRY_H__ */
60 c-indentation-style: "K&R"