diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-12-09 11:09:30 +0000 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-01-20 20:12:41 -0500 |
commit | a317120bf7f8306b594ee650ee14f08a0e599602 (patch) | |
tree | 4725119a5fbeccba04b2babcc345c34fefa51478 /fs/adfs/adfs.h | |
parent | acf5f0be8a520c02bfed74cfc6735bf5fdd4a9e5 (diff) |
fs/adfs: dir: add generic copy functions
Directories can span multiple buffers, and we currently open-code
memcpy access to these buffers, including dealing with entries that
are split across multiple buffers. Such code exists in both
directory format implementations.
Provide common functions to allow data to be copied from/to the
directory buffers as if they were a contiguous set of buffers, and
use them when accessing directories.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs/adfs.h')
-rw-r--r-- | fs/adfs/adfs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h index 5f1acee768f5..92cbc4b1d902 100644 --- a/fs/adfs/adfs.h +++ b/fs/adfs/adfs.h @@ -165,6 +165,10 @@ extern const struct dentry_operations adfs_dentry_operations; extern const struct adfs_dir_ops adfs_f_dir_ops; extern const struct adfs_dir_ops adfs_fplus_dir_ops; +int adfs_dir_copyfrom(void *dst, struct adfs_dir *dir, unsigned int offset, + size_t len); +int adfs_dir_copyto(struct adfs_dir *dir, unsigned int offset, const void *src, + size_t len); void adfs_dir_relse(struct adfs_dir *dir); void adfs_object_fixup(struct adfs_dir *dir, struct object_info *obj); extern int adfs_dir_update(struct super_block *sb, struct object_info *obj, |