From e76e0cc745db7c0786d38ce4a8e8406e7ea533fb Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Wed, 26 Jun 2024 00:58:08 +0800 Subject: [PATCH] Apply editorial changes --- extent.c | 5 ++--- file.c | 5 ++--- simplefs.h | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/extent.c b/extent.c index 5844b3a..00c80fa 100644 --- a/extent.c +++ b/extent.c @@ -59,9 +59,8 @@ uint32_t simplefs_ext_search(struct simplefs_file_ei_block *index, } } - /* return 'end' if it directs to valid block - * return 'boundary' if index is not found - * and eiblock has remaining space + /* Return 'end' if it directs to valid block. + * Return 'boundary' if index is not found and eiblock has remaining space */ end_block = index->extents[end].ee_block; end_len = index->extents[end].ee_len; diff --git a/file.c b/file.c index d59de09..b6cfc6d 100644 --- a/file.c +++ b/file.c @@ -311,7 +311,6 @@ static ssize_t simplefs_read(struct file *file, struct simplefs_file_ei_block *ei_block = (struct simplefs_file_ei_block *) bh->b_data; - if (pos + len > inode->i_size) len = inode->i_size - pos; @@ -469,10 +468,10 @@ const struct address_space_operations simplefs_aops = { }; const struct file_operations simplefs_file_ops = { - .llseek = generic_file_llseek, .owner = THIS_MODULE, - .fsync = generic_file_fsync, .open = simplefs_open, .read = simplefs_read, .write = simplefs_write, + .llseek = generic_file_llseek, + .fsync = generic_file_fsync, }; diff --git a/simplefs.h b/simplefs.h index 5c384bd..301f2ab 100644 --- a/simplefs.h +++ b/simplefs.h @@ -142,6 +142,7 @@ extern uint32_t simplefs_ext_search(struct simplefs_file_ei_block *index, /* Extract a simplefs_inode_info object from a VFS inode */ #define SIMPLEFS_INODE(inode) \ (container_of(inode, struct simplefs_inode_info, vfs_inode)) + #endif /* __KERNEL__ */ #endif /* SIMPLEFS_H */