rpdfs: Add basic getattr and setattr support.
PATCH 1/1 rpdfs: Add basic getattr and setattr support.
Add basic getattr and setattr support.
For now, the only statx request supported by getattr is STATX_BTIME. All other stat info is filled in from the vfs inode using generic_fillattr().
setattr lacks support for ATTR_SIZE, since we don't have a truncate operation yet.
Signed-off-by Chris Kirby <[email protected]>
--- fs/rpdfs/balloc.c | 2 +- fs/rpdfs/dir.c | 2 ++ fs/rpdfs/file.c | 3 ++ fs/rpdfs/inode.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++ fs/rpdfs/inode.h | 7 +++++ 5 files changed, 84 insertions(+), 1 deletion(-)
fs/rpdfs/balloc.c +1 -1
@@ -96,7 +96,7 @@ void rpdfs_balloc_start_apply(struct rpdfs_fs_info *rfi, struct rpdfs_transactio/* * Apply and return the result of an allocation that was prepared by -* _prepare_alloc. The caller can use _txn_use_prepare() to get the +* _prepare_alloc. The caller can use _txn_use_prepared() to get the * allocated block. */ int rpdfs_balloc_apply_alloc(struct rpdfs_fs_info *rfi, struct rpdfs_transaction *txn,
fs/rpdfs/dir.c +2 -0
@@ -677,9 +677,11 @@ static int rpdfs_readdir(struct file *file, struct dir_context *ctx)const struct inode_operations rpdfs_dir_iops = { .create = rpdfs_create, + .getattr = rpdfs_getattr, .lookup = rpdfs_lookup, .mkdir = rpdfs_mkdir, .rename = rpdfs_rename, + .setattr = rpdfs_setattr, };const struct file_operations rpdfs_dir_fops = {
fs/rpdfs/file.c +3 -0
@@ -3,8 +3,11 @@#include <linux/fs.h> #include "file.h" +#include "inode.h" const struct inode_operations rpdfs_file_iops = { + .getattr = rpdfs_getattr, + .setattr = rpdfs_setattr, };const struct file_operations rpdfs_file_fops = {
fs/rpdfs/inode.c +71 -0
89 lines not on this page · raw message
fs/rpdfs/inode.h +7 -0
@@ -52,6 +52,13 @@ int rpdfs_write_inode(struct inode *inode, struct writeback_control *wbc);void rpdfs_inode_init_ops (struct inode *inode); +int rpdfs_getattr (struct mnt_idmap *idmap,const struct path *path, +struct kstat *stat,u32 request_mask, +unsigned int query_flags); + +int rpdfs_setattr (struct mnt_idmap *idmap,struct dentry *dentry, +struct iattr *attr); +struct inode *rpdfs_iget (struct super_block *sb,struct rpdfs_ino_gen *ig);struct inode *rpdfs_new_inode (struct super_block *sb,struct rpdfs_ino_gen *ig); int rpdfs_inode_txn_prepare(struct rpdfs_fs_info *rfi, struct rpdfs_transaction *txn,
Signature · 1 line
2.53.0
Zach Brown
AppliedQuoted 1 line · Chris Kirby
Add basic getattr and setattr support.
Applied, thanks!
- z