aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-07-12 11:49:50 -0700
committerJens Axboe <axboe@kernel.dk>2017-07-29 09:00:03 -0600
commitc53cd490b1a491ebf1d8e30da97e7231459a4208 (patch)
tree09edea3836ea440490dcc2993c802b65b93c1e6b /include
parentkernfs: don't set dentry->d_fsdata (diff)
downloadlinux-dev-c53cd490b1a491ebf1d8e30da97e7231459a4208.tar.xz
linux-dev-c53cd490b1a491ebf1d8e30da97e7231459a4208.zip
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')
-rw-r--r--include/linux/cgroup.h2
-rw-r--r--include/linux/kernfs.h12
-rw-r--r--include/trace/events/writeback.h2
3 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 710a005c6b7a..30c68773fd1e 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -543,7 +543,7 @@ static inline bool cgroup_is_populated(struct cgroup *cgrp)
/* returns ino associated with a cgroup */
static inline ino_t cgroup_ino(struct cgroup *cgrp)
{
- return cgrp->kn->ino;
+ return cgrp->kn->id.ino;
}
/* cft/css accessors for cftype->write() operation */
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 {
struct kernfs_node *notify_next; /* for kernfs_notify() */
};
+/* represent a kernfs node */
+union kernfs_node_id {
+ struct {
+ u32 ino;
+ u32 generation;
+ };
+ u64 id;
+};
+
/*
* kernfs_node - the building block of kernfs hierarchy. Each and every
* kernfs node is represented by single kernfs_node. Most fields are
@@ -131,11 +140,10 @@ struct kernfs_node {
void *priv;
+ union kernfs_node_id id;
unsigned short flags;
umode_t mode;
- unsigned int ino;
struct kernfs_iattrs *iattr;
- u32 generation;
};
/*
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 7bd8783a590f..9b57f014d79d 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -136,7 +136,7 @@ DEFINE_EVENT(writeback_dirty_inode_template, writeback_dirty_inode,
static inline unsigned int __trace_wb_assign_cgroup(struct bdi_writeback *wb)
{
- return wb->memcg_css->cgroup->kn->ino;
+ return wb->memcg_css->cgroup->kn->id.ino;
}
static inline unsigned int __trace_wbc_assign_cgroup(struct writeback_control *wbc)