diff options
author | Shaohua Li <shli@fb.com> | 2017-07-12 14:49:50 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-07-29 11:00:03 -0400 |
commit | c53cd490b1a491ebf1d8e30da97e7231459a4208 (patch) | |
tree | 09edea3836ea440490dcc2993c802b65b93c1e6b /include/linux/kernfs.h | |
parent | 319ba91d352a74acb47678788109a14b9b4dd4c2 (diff) |
kernfs: introduce kernfs_node_id
inode number and generation can identify a kernfs node. We are going to
export the identification by exportfs operations, so put ino and
generation into a separate structure. It's convenient when later patches
use the identification.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/kernfs.h')
-rw-r--r-- | include/linux/kernfs.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h index 8c00d28f468a..06a0c5913e1d 100644 --- a/include/linux/kernfs.h +++ b/include/linux/kernfs.h | |||
@@ -95,6 +95,15 @@ struct kernfs_elem_attr { | |||
95 | struct kernfs_node *notify_next; /* for kernfs_notify() */ | 95 | struct kernfs_node *notify_next; /* for kernfs_notify() */ |
96 | }; | 96 | }; |
97 | 97 | ||
98 | /* represent a kernfs node */ | ||
99 | union kernfs_node_id { | ||
100 | struct { | ||
101 | u32 ino; | ||
102 | u32 generation; | ||
103 | }; | ||
104 | u64 id; | ||
105 | }; | ||
106 | |||
98 | /* | 107 | /* |
99 | * kernfs_node - the building block of kernfs hierarchy. Each and every | 108 | * kernfs_node - the building block of kernfs hierarchy. Each and every |
100 | * kernfs node is represented by single kernfs_node. Most fields are | 109 | * kernfs node is represented by single kernfs_node. Most fields are |
@@ -131,11 +140,10 @@ struct kernfs_node { | |||
131 | 140 | ||
132 | void *priv; | 141 | void *priv; |
133 | 142 | ||
143 | union kernfs_node_id id; | ||
134 | unsigned short flags; | 144 | unsigned short flags; |
135 | umode_t mode; | 145 | umode_t mode; |
136 | unsigned int ino; | ||
137 | struct kernfs_iattrs *iattr; | 146 | struct kernfs_iattrs *iattr; |
138 | u32 generation; | ||
139 | }; | 147 | }; |
140 | 148 | ||
141 | /* | 149 | /* |