* [PATCH 0/2] Trivial changes found during code-review
@ 2019-08-30 9:17 Ritesh Harjani
2019-08-30 9:17 ` [RFC 1/2] direct-io: Change is_async member of struct dio from int to bool Ritesh Harjani
2019-08-30 9:17 ` [RFC 2/2] Doc: vfs: Update few inode specific super_operations methods Ritesh Harjani
0 siblings, 2 replies; 3+ messages in thread
From: Ritesh Harjani @ 2019-08-30 9:17 UTC (permalink / raw)
To: linux-fsdevel; +Cc: riteshh
Just couple of trivial changes, found during code-review.
Ritesh Harjani (2):
direct-io: Change is_async member of struct dio from int to bool
Doc: vfs: Update few inode specific super_operations methods
Documentation/filesystems/vfs.rst | 26 ++++++++++++++++++--------
fs/direct-io.c | 2 +-
2 files changed, 19 insertions(+), 9 deletions(-)
--
2.21.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC 1/2] direct-io: Change is_async member of struct dio from int to bool
2019-08-30 9:17 [PATCH 0/2] Trivial changes found during code-review Ritesh Harjani
@ 2019-08-30 9:17 ` Ritesh Harjani
2019-08-30 9:17 ` [RFC 2/2] Doc: vfs: Update few inode specific super_operations methods Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2019-08-30 9:17 UTC (permalink / raw)
To: linux-fsdevel; +Cc: riteshh
Change is_async member of struct dio from int to bool.
Found this during code review.
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
fs/direct-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/direct-io.c b/fs/direct-io.c
index ae196784f487..b139876653ef 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -128,7 +128,7 @@ struct dio {
/* BIO completion state */
spinlock_t bio_lock; /* protects BIO fields below */
int page_errors; /* errno from get_user_pages() */
- int is_async; /* is IO async ? */
+ bool is_async; /* is IO async ? */
bool defer_completion; /* defer AIO completion to workqueue? */
bool should_dirty; /* if pages should be dirtied */
int io_error; /* IO error in completion path */
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC 2/2] Doc: vfs: Update few inode specific super_operations methods
2019-08-30 9:17 [PATCH 0/2] Trivial changes found during code-review Ritesh Harjani
2019-08-30 9:17 ` [RFC 1/2] direct-io: Change is_async member of struct dio from int to bool Ritesh Harjani
@ 2019-08-30 9:17 ` Ritesh Harjani
1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2019-08-30 9:17 UTC (permalink / raw)
To: linux-fsdevel; +Cc: riteshh
Remove delete_inode & clear_inode method from super_operations
as these are no more present.
Also add documentation about free_inode & evict_inode methods.
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
Documentation/filesystems/vfs.rst | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
index 0f85ab21c2ca..f5e8a0133e1f 100644
--- a/Documentation/filesystems/vfs.rst
+++ b/Documentation/filesystems/vfs.rst
@@ -229,18 +229,18 @@ filesystem. As of kernel 2.6.22, the following members are defined:
struct super_operations {
struct inode *(*alloc_inode)(struct super_block *sb);
void (*destroy_inode)(struct inode *);
+ void (*free_inode)(struct inode *);
void (*dirty_inode) (struct inode *, int flags);
int (*write_inode) (struct inode *, int);
void (*drop_inode) (struct inode *);
- void (*delete_inode) (struct inode *);
+ void (*evict_inode) (struct inode *);
void (*put_super) (struct super_block *);
int (*sync_fs)(struct super_block *sb, int wait);
int (*freeze_fs) (struct super_block *);
int (*unfreeze_fs) (struct super_block *);
int (*statfs) (struct dentry *, struct kstatfs *);
int (*remount_fs) (struct super_block *, int *, char *);
- void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
int (*show_options)(struct seq_file *, struct dentry *);
@@ -269,6 +269,12 @@ or bottom half).
->alloc_inode was defined and simply undoes anything done by
->alloc_inode.
+``free_inode``
+ This is the last part of resource freeing for inode done
+ in RCU-delayed way. This is called at the end by
+ destroy_inode method using call_rcu, mostly to free FS specific
+ inodep cache object.
+
``dirty_inode``
this method is called by the VFS to mark an inode dirty.
@@ -283,15 +289,22 @@ or bottom half).
This method should be either NULL (normal UNIX filesystem
semantics) or "generic_delete_inode" (for filesystems that do
- not want to cache inodes - causing "delete_inode" to always be
+ not want to cache inodes - causing "evict_inode" to always be
called regardless of the value of i_nlink)
The "generic_delete_inode()" behavior is equivalent to the old
practice of using "force_delete" in the put_inode() case, but
does not have the races that the "force_delete()" approach had.
-``delete_inode``
- called when the VFS wants to delete an inode
+``evict_inode``
+ Called by iput_final when the inode reference count reaches
+ zero and the inode is not in lru list. Method is used to clean anything
+ by FS that needs to be, before the inode is completely destroyed and
+ put on the free list.
+ For stacked filesystems, this is the place where the reference of
+ lower inodes are dropped.
+ For local filesystems, this is the place to truncate all pages
+ before inode dies and also to perform necessary cleanup.
``put_super``
called when the VFS wishes to free the superblock
@@ -318,9 +331,6 @@ or bottom half).
called when the filesystem is remounted. This is called with
the kernel lock held
-``clear_inode``
- called then the VFS clears the inode. Optional
-
``umount_begin``
called when the VFS is unmounting a filesystem.
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-30 9:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-30 9:17 [PATCH 0/2] Trivial changes found during code-review Ritesh Harjani
2019-08-30 9:17 ` [RFC 1/2] direct-io: Change is_async member of struct dio from int to bool Ritesh Harjani
2019-08-30 9:17 ` [RFC 2/2] Doc: vfs: Update few inode specific super_operations methods Ritesh Harjani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).