2 * linux/fs/befs/attribute.c
4 * Copyright (C) 2002 Will Dyson <will_dyson@pobox.com>
6 * Many thanks to Dominic Giampaolo, author of "Practical File System
7 * Design with the Be File System", for such a helpful book.
12 #include <linux/kernel.h>
13 #include <linux/string.h>
19 (void*)((char*)sd + sizeof(*sd) + (sd->name_size - sizeof(sd->name)))
22 (befs_small_data*)((char*)sd + sizeof(*sd) + (sd->name_size - \
23 sizeof(sd->name) + sd->data_size))
26 list_small_data(struct super_block *sb, befs_inode * inode, filldir_t filldir);
28 befs_small_data *find_small_data(struct super_block *sb, befs_inode * inode,
31 read_small_data(struct super_block *sb, befs_inode * inode,
32 befs_small_data * sdata, void *buf, size_t bufsize);
42 find_small_data(struct super_block *sb, befs_inode * inode, const char *name)
44 befs_small_data *sdata = inode->small_data;
46 while (sdata->type != 0) {
47 if (strcmp(name, sdata->name) != 0) {
50 sdata = SD_NEXT(sdata);
63 read_small_data(struct super_block *sb, befs_inode * inode,
64 const char *name, void *buf, size_t bufsize)
66 befs_small_data *sdata;
68 sdata = find_small_data(sb, inode, name);
71 else if (sdata->data_size > bufsize)
74 memcpy(buf, SD_DATA(sdata), sdata->data_size);
87 list_small_data(struct super_block *sb, befs_inode * inode)
100 list_attr(struct super_block *sb, befs_inode * inode)
113 read_attr(struct super_block *sb, befs_inode * inode)