From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.6.12-rc2 Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip! --- fs/befs/attribute.c | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 fs/befs/attribute.c (limited to 'fs/befs/attribute.c') diff --git a/fs/befs/attribute.c b/fs/befs/attribute.c new file mode 100644 index 00000000000..e329d727053 --- /dev/null +++ b/fs/befs/attribute.c @@ -0,0 +1,117 @@ +/* + * linux/fs/befs/attribute.c + * + * Copyright (C) 2002 Will Dyson + * + * Many thanks to Dominic Giampaolo, author of "Practical File System + * Design with the Be File System", for such a helpful book. + * + */ + +#include +#include +#include + +#include "befs.h" +#include "endian.h" + +#define SD_DATA(sd)\ + (void*)((char*)sd + sizeof(*sd) + (sd->name_size - sizeof(sd->name))) + +#define SD_NEXT(sd)\ + (befs_small_data*)((char*)sd + sizeof(*sd) + (sd->name_size - \ + sizeof(sd->name) + sd->data_size)) + +int +list_small_data(struct super_block *sb, befs_inode * inode, filldir_t filldir); + +befs_small_data * +find_small_data(struct super_block *sb, befs_inode * inode, + const char *name); +int +read_small_data(struct super_block *sb, befs_inode * inode, + befs_small_data * sdata, void *buf, size_t bufsize); + +/** + * + * + * + * + * + */ +befs_small_data * +find_small_data(struct super_block *sb, befs_inode * inode, const char *name) +{ + befs_small_data *sdata = inode->small_data; + + while (sdata->type != 0) { + if (strcmp(name, sdata->name) != 0) { + return sdata; + } + sdata = SD_NEXT(sdata); + } + return NULL; +} + +/** + * + * + * + * + * + */ +int +read_small_data(struct super_block *sb, befs_inode * inode, + const char *name, void *buf, size_t bufsize) +{ + befs_small_data *sdata; + + sdata = find_small_data(sb, inode, name); + if (sdata == NULL) + return BEFS_ERR; + else if (sdata->data_size > bufsize) + return BEFS_ERR; + + memcpy(buf, SD_DATA(sdata), sdata->data_size); + + return BEFS_OK; +} + +/** + * + * + * + * + * + */ +int +list_small_data(struct super_block *sb, befs_inode * inode) +{ + +} + +/** + * + * + * + * + * + */ +int +list_attr(struct super_block *sb, befs_inode * inode) +{ + +} + +/** + * + * + * + * + * + */ +int +read_attr(struct super_block *sb, befs_inode * inode) +{ + +} -- cgit v1.2.3