Skip to content

Commit 5307040

Browse files
committed
Merge branch 'work.adfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull adfs updates from Al Viro: "adfs stuff for this cycle" * 'work.adfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (42 commits) fs/adfs: bigdir: Fix an error code in adfs_fplus_read() Documentation: update adfs filesystem documentation fs/adfs: mostly divorse inode number from indirect disc address fs/adfs: super: add support for E and E+ floppy image formats fs/adfs: super: extract filesystem block probe fs/adfs: dir: remove debug in adfs_dir_update() fs/adfs: super: fix inode dropping fs/adfs: bigdir: implement directory update support fs/adfs: bigdir: calculate and validate directory checkbyte fs/adfs: bigdir: directory validation strengthening fs/adfs: bigdir: extract directory validation fs/adfs: bigdir: factor out directory entry offset calculation fs/adfs: newdir: split out directory commit from update fs/adfs: newdir: clean up adfs_f_update() fs/adfs: newdir: merge adfs_dir_read() into adfs_f_read() fs/adfs: newdir: improve directory validation fs/adfs: newdir: factor out directory format validation fs/adfs: dir: use pointers to access directory head/tails fs/adfs: dir: add more efficient iterate() per-format method fs/adfs: dir: switch to iterate_shared method ...
2 parents 6aee4ba + 587065d commit 5307040

File tree

10 files changed

+914
-740
lines changed

10 files changed

+914
-740
lines changed

Documentation/filesystems/adfs.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
Filesystems supported by ADFS
2+
-----------------------------
3+
4+
The ADFS module supports the following Filecore formats which have:
5+
6+
- new maps
7+
- new directories or big directories
8+
9+
In terms of the named formats, this means we support:
10+
11+
- E and E+, with or without boot block
12+
- F and F+
13+
14+
We fully support reading files from these filesystems, and writing to
15+
existing files within their existing allocation. Essentially, we do
16+
not support changing any of the filesystem metadata.
17+
18+
This is intended to support loopback mounted Linux native filesystems
19+
on a RISC OS Filecore filesystem, but will allow the data within files
20+
to be changed.
21+
22+
If write support (ADFS_FS_RW) is configured, we allow rudimentary
23+
directory updates, specifically updating the access mode and timestamp.
24+
125
Mount options for ADFS
226
----------------------
327

fs/adfs/adfs.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ static inline u16 adfs_filetype(u32 loadaddr)
2626
#define ADFS_NDA_PUBLIC_READ (1 << 5)
2727
#define ADFS_NDA_PUBLIC_WRITE (1 << 6)
2828

29-
#include "dir_f.h"
30-
3129
/*
3230
* adfs file system inode data in memory
3331
*/
3432
struct adfs_inode_info {
3533
loff_t mmu_private;
3634
__u32 parent_id; /* parent indirect disc address */
35+
__u32 indaddr; /* object indirect disc address */
3736
__u32 loadaddr; /* RISC OS load address */
3837
__u32 execaddr; /* RISC OS exec address */
3938
unsigned int attr; /* RISC OS permissions */
@@ -93,15 +92,19 @@ struct adfs_dir {
9392

9493
int nr_buffers;
9594
struct buffer_head *bh[4];
96-
97-
/* big directories need allocated buffers */
98-
struct buffer_head **bh_fplus;
95+
struct buffer_head **bhs;
9996

10097
unsigned int pos;
10198
__u32 parent_id;
10299

103-
struct adfs_dirheader dirhead;
104-
union adfs_dirtail dirtail;
100+
union {
101+
struct adfs_dirheader *dirhead;
102+
struct adfs_bigdirheader *bighead;
103+
};
104+
union {
105+
struct adfs_newdirtail *newtail;
106+
struct adfs_bigdirtail *bigtail;
107+
};
105108
};
106109

107110
/*
@@ -122,13 +125,13 @@ struct object_info {
122125
struct adfs_dir_ops {
123126
int (*read)(struct super_block *sb, unsigned int indaddr,
124127
unsigned int size, struct adfs_dir *dir);
128+
int (*iterate)(struct adfs_dir *dir, struct dir_context *ctx);
125129
int (*setpos)(struct adfs_dir *dir, unsigned int fpos);
126130
int (*getnext)(struct adfs_dir *dir, struct object_info *obj);
127131
int (*update)(struct adfs_dir *dir, struct object_info *obj);
128132
int (*create)(struct adfs_dir *dir, struct object_info *obj);
129133
int (*remove)(struct adfs_dir *dir, struct object_info *obj);
130-
int (*sync)(struct adfs_dir *dir);
131-
void (*free)(struct adfs_dir *dir);
134+
int (*commit)(struct adfs_dir *dir);
132135
};
133136

134137
struct adfs_discmap {
@@ -145,7 +148,9 @@ int adfs_notify_change(struct dentry *dentry, struct iattr *attr);
145148

146149
/* map.c */
147150
int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset);
148-
extern unsigned int adfs_map_free(struct super_block *sb);
151+
void adfs_map_statfs(struct super_block *sb, struct kstatfs *buf);
152+
struct adfs_discmap *adfs_read_map(struct super_block *sb, struct adfs_discrecord *dr);
153+
void adfs_free_map(struct super_block *sb);
149154

150155
/* Misc */
151156
__printf(3, 4)
@@ -167,6 +172,13 @@ extern const struct dentry_operations adfs_dentry_operations;
167172
extern const struct adfs_dir_ops adfs_f_dir_ops;
168173
extern const struct adfs_dir_ops adfs_fplus_dir_ops;
169174

175+
int adfs_dir_copyfrom(void *dst, struct adfs_dir *dir, unsigned int offset,
176+
size_t len);
177+
int adfs_dir_copyto(struct adfs_dir *dir, unsigned int offset, const void *src,
178+
size_t len);
179+
void adfs_dir_relse(struct adfs_dir *dir);
180+
int adfs_dir_read_buffers(struct super_block *sb, u32 indaddr,
181+
unsigned int size, struct adfs_dir *dir);
170182
void adfs_object_fixup(struct adfs_dir *dir, struct object_info *obj);
171183
extern int adfs_dir_update(struct super_block *sb, struct object_info *obj,
172184
int wait);

0 commit comments

Comments
 (0)