diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /fs/befs/attribute.c |
Linux-2.6.12-rc2v2.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!
Diffstat (limited to 'fs/befs/attribute.c')
-rw-r--r-- | fs/befs/attribute.c | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/fs/befs/attribute.c b/fs/befs/attribute.c new file mode 100644 index 000000000000..e329d727053e --- /dev/null +++ b/fs/befs/attribute.c | |||
@@ -0,0 +1,117 @@ | |||
1 | /* | ||
2 | * linux/fs/befs/attribute.c | ||
3 | * | ||
4 | * Copyright (C) 2002 Will Dyson <will_dyson@pobox.com> | ||
5 | * | ||
6 | * Many thanks to Dominic Giampaolo, author of "Practical File System | ||
7 | * Design with the Be File System", for such a helpful book. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/fs.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/string.h> | ||
14 | |||
15 | #include "befs.h" | ||
16 | #include "endian.h" | ||
17 | |||
18 | #define SD_DATA(sd)\ | ||
19 | (void*)((char*)sd + sizeof(*sd) + (sd->name_size - sizeof(sd->name))) | ||
20 | |||
21 | #define SD_NEXT(sd)\ | ||
22 | (befs_small_data*)((char*)sd + sizeof(*sd) + (sd->name_size - \ | ||
23 | sizeof(sd->name) + sd->data_size)) | ||
24 | |||
25 | int | ||
26 | list_small_data(struct super_block *sb, befs_inode * inode, filldir_t filldir); | ||
27 | |||
28 | befs_small_data * | ||
29 | find_small_data(struct super_block *sb, befs_inode * inode, | ||
30 | const char *name); | ||
31 | int | ||
32 | read_small_data(struct super_block *sb, befs_inode * inode, | ||
33 | befs_small_data * sdata, void *buf, size_t bufsize); | ||
34 | |||
35 | /** | ||
36 | * | ||
37 | * | ||
38 | * | ||
39 | * | ||
40 | * | ||
41 | */ | ||
42 | befs_small_data * | ||
43 | find_small_data(struct super_block *sb, befs_inode * inode, const char *name) | ||
44 | { | ||
45 | befs_small_data *sdata = inode->small_data; | ||
46 | |||
47 | while (sdata->type != 0) { | ||
48 | if (strcmp(name, sdata->name) != 0) { | ||
49 | return sdata; | ||
50 | } | ||
51 | sdata = SD_NEXT(sdata); | ||
52 | } | ||
53 | return NULL; | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * | ||
58 | * | ||
59 | * | ||
60 | * | ||
61 | * | ||
62 | */ | ||
63 | int | ||
64 | read_small_data(struct super_block *sb, befs_inode * inode, | ||
65 | const char *name, void *buf, size_t bufsize) | ||
66 | { | ||
67 | befs_small_data *sdata; | ||
68 | |||
69 | sdata = find_small_data(sb, inode, name); | ||
70 | if (sdata == NULL) | ||
71 | return BEFS_ERR; | ||
72 | else if (sdata->data_size > bufsize) | ||
73 | return BEFS_ERR; | ||
74 | |||
75 | memcpy(buf, SD_DATA(sdata), sdata->data_size); | ||
76 | |||
77 | return BEFS_OK; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * | ||
82 | * | ||
83 | * | ||
84 | * | ||
85 | * | ||
86 | */ | ||
87 | int | ||
88 | list_small_data(struct super_block *sb, befs_inode * inode) | ||
89 | { | ||
90 | |||
91 | } | ||
92 | |||
93 | /** | ||
94 | * | ||
95 | * | ||
96 | * | ||
97 | * | ||
98 | * | ||
99 | */ | ||
100 | int | ||
101 | list_attr(struct super_block *sb, befs_inode * inode) | ||
102 | { | ||
103 | |||
104 | } | ||
105 | |||
106 | /** | ||
107 | * | ||
108 | * | ||
109 | * | ||
110 | * | ||
111 | * | ||
112 | */ | ||
113 | int | ||
114 | read_attr(struct super_block *sb, befs_inode * inode) | ||
115 | { | ||
116 | |||
117 | } | ||