From: Laurent Riffard <laurent.riffard@free.fr>
To: "reiserfs-list@namesys.com" <reiserfs-list@namesys.com>
Subject: [PATCH 7/10] Reiser4: Replace inode.u.generic_ip with inode.i_private
Date: Sun, 03 Dec 2006 14:51:09 +0100 [thread overview]
Message-ID: <4572D64D.6060406@free.fr> (raw)
In-Reply-To: <4571D852.3080401@free.fr>
inode.u.generic_ip was replaced with inode.i_private to reduce the size
of the VFS inode structure. This patch updates reiser4 code to reflect
this change.
---
fs/reiser4/inode.h | 2 +-
fs/reiser4/plugin/file/symlink.c | 14 +++++++-------
fs/reiser4/plugin/inode_ops.c | 6 +++---
fs/reiser4/plugin/item/static_stat.c | 18 +++++++++---------
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/fs/reiser4/inode.h b/fs/reiser4/inode.h
index ed59b0f..88b155d 100644
--- a/fs/reiser4/inode.h
+++ b/fs/reiser4/inode.h
@@ -41,7 +41,7 @@ typedef enum {
REISER4_IMMUTABLE = 2,
/* inode was read from storage */
REISER4_LOADED = 3,
- /* this bit is set for symlinks. inode->u.generic_ip points to target
+ /* this bit is set for symlinks. inode->i_private points to target
name of symlink. */
REISER4_GENERIC_PTR_USED = 4,
/* set if size of stat-data item for this inode is known. If this is
diff --git a/fs/reiser4/plugin/file/symlink.c b/fs/reiser4/plugin/file/symlink.c
index 343e72e..4f3f05a 100644
--- a/fs/reiser4/plugin/file/symlink.c
+++ b/fs/reiser4/plugin/file/symlink.c
@@ -42,8 +42,8 @@ int create_symlink(struct inode *symlink,
*/
reiser4_inode_data(symlink)->extmask |= (1 << SYMLINK_STAT);
- assert("vs-838", symlink->u.generic_ip == NULL);
- symlink->u.generic_ip = (void *)data->name;
+ assert("vs-838", symlink->i_private == NULL);
+ symlink->i_private = (void *)data->name;
assert("vs-843", symlink->i_size == 0);
INODE_SET_FIELD(symlink, i_size, strlen(data->name));
@@ -51,14 +51,14 @@ int create_symlink(struct inode *symlink,
/* insert stat data appended with data->name */
result = inode_file_plugin(symlink)->write_sd_by_inode(symlink);
if (result) {
- /* FIXME-VS: Make sure that symlink->u.generic_ip is not attached
+ /* FIXME-VS: Make sure that symlink->i_private is not attached
to kmalloced data */
INODE_SET_FIELD(symlink, i_size, 0);
} else {
- assert("vs-849", symlink->u.generic_ip
+ assert("vs-849", symlink->i_private
&& inode_get_flag(symlink, REISER4_GENERIC_PTR_USED));
assert("vs-850",
- !memcmp((char *)symlink->u.generic_ip, data->name,
+ !memcmp((char *)symlink->i_private, data->name,
(size_t) symlink->i_size + 1));
}
return result;
@@ -76,8 +76,8 @@ void destroy_inode_symlink(struct inode *inode)
assert("edward-801", inode_get_flag(inode, REISER4_GENERIC_PTR_USED));
assert("vs-839", S_ISLNK(inode->i_mode));
- kfree(inode->u.generic_ip);
- inode->u.generic_ip = NULL;
+ kfree(inode->i_private);
+ inode->i_private = NULL;
inode_clr_flag(inode, REISER4_GENERIC_PTR_USED);
}
diff --git a/fs/reiser4/plugin/inode_ops.c b/fs/reiser4/plugin/inode_ops.c
index 73e6cbd..7c215af 100644
--- a/fs/reiser4/plugin/inode_ops.c
+++ b/fs/reiser4/plugin/inode_ops.c
@@ -389,16 +389,16 @@ int mknod_common(struct inode *parent, struct dentry *dentry,
*
* This is common implementation of vfs's followlink method of struct
* inode_operations.
- * Assumes that inode's generic_ip points to the content of symbolic link.
+ * Assumes that inode's i_private points to the content of symbolic link.
*/
void *follow_link_common(struct dentry *dentry, struct nameidata *nd)
{
assert("vs-851", S_ISLNK(dentry->d_inode->i_mode));
- if (!dentry->d_inode->u.generic_ip
+ if (!dentry->d_inode->i_private
|| !inode_get_flag(dentry->d_inode, REISER4_GENERIC_PTR_USED))
return ERR_PTR(RETERR(-EINVAL));
- nd_set_link(nd, dentry->d_inode->u.generic_ip);
+ nd_set_link(nd, dentry->d_inode->i_private);
return NULL;
}
diff --git a/fs/reiser4/plugin/item/static_stat.c b/fs/reiser4/plugin/item/static_stat.c
index d1a4a40..0ef01e6 100644
--- a/fs/reiser4/plugin/item/static_stat.c
+++ b/fs/reiser4/plugin/item/static_stat.c
@@ -430,21 +430,21 @@ save_large_times_sd(struct inode *inode /* object being processed */ ,
/* symlink stat data extension */
-/* allocate memory for symlink target and attach it to inode->u.generic_ip */
+/* allocate memory for symlink target and attach it to inode->i_private */
static int
symlink_target_to_inode(struct inode *inode, const char *target, int len)
{
- assert("vs-845", inode->u.generic_ip == NULL);
+ assert("vs-845", inode->i_private == NULL);
assert("vs-846", !inode_get_flag(inode, REISER4_GENERIC_PTR_USED));
/* FIXME-VS: this is prone to deadlock. Not more than other similar
places, though */
- inode->u.generic_ip = kmalloc((size_t) len + 1, get_gfp_mask());
- if (!inode->u.generic_ip)
+ inode->i_private = kmalloc((size_t) len + 1, get_gfp_mask());
+ if (!inode->i_private)
return RETERR(-ENOMEM);
- memcpy((char *)(inode->u.generic_ip), target, (size_t) len);
- ((char *)(inode->u.generic_ip))[len] = 0;
+ memcpy((char *)(inode->i_private), target, (size_t) len);
+ ((char *)(inode->i_private))[len] = 0;
inode_set_flag(inode, REISER4_GENERIC_PTR_USED);
return 0;
}
@@ -499,8 +499,8 @@ static int save_symlink_sd(struct inode *inode, char **area)
if (!inode_get_flag(inode, REISER4_GENERIC_PTR_USED)) {
const char *target;
- target = (const char *)(inode->u.generic_ip);
- inode->u.generic_ip = NULL;
+ target = (const char *)(inode->i_private);
+ inode->i_private = NULL;
result = symlink_target_to_inode(inode, target, length);
@@ -510,7 +510,7 @@ static int save_symlink_sd(struct inode *inode, char **area)
} else {
/* there is nothing to do in update but move area */
assert("vs-844",
- !memcmp(inode->u.generic_ip, sd->body,
+ !memcmp(inode->i_private, sd->body,
(size_t) length + 1));
}
-- 1.4.4.1.gaed4
next prev parent reply other threads:[~2006-12-03 13:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 13:49 Reiser4 for 2.6.19 Laurent Riffard
2006-12-03 13:49 ` [PATCH 1/10] Reiser4 for 2.6.18 version 3 Laurent Riffard
2006-12-03 13:50 ` [PATCH 2/10] Reiser4: cometics changes in mm/filemap.c Laurent Riffard
2006-12-03 13:50 ` [PATCH 3/10] Reiser4: fix use after free in jrelse_tail Laurent Riffard
2006-12-03 13:50 ` [PATCH 4/10] Reiser4: release d_ref Laurent Riffard
2006-12-03 13:50 ` [PATCH 5/10] Reiser4: release d_ref (fix) Laurent Riffard
2006-12-03 13:50 ` [PATCH 6/10] Reiser4: fix calls to kmem_cache_destroy Laurent Riffard
2006-12-03 13:51 ` Laurent Riffard [this message]
2006-12-03 13:51 ` [PATCH 8/10] Reiser4: inode.i_blksize suppression Laurent Riffard
2006-12-03 13:51 ` [PATCH 9/10] Reiser4: remove unnecessary config.h includes Laurent Riffard
2006-12-03 13:51 ` [PATCH 10/10] reiser4-generic_file_read-fix Laurent Riffard
2006-12-04 10:53 ` Reiser4 for 2.6.19 Guilherme Covolo
-- strict thread matches above, loose matches on Subject: below --
2006-12-02 13:16 Laurent Riffard
[not found] ` <1165065391122-git-send-email-laurent.riffard@free.fr>
2006-12-02 13:16 ` [PATCH 2/10] Reiser4: cometics changes in mm/filemap.c Laurent Riffard
[not found] ` <11650653912299-git-send-email-laurent.riffard@free.fr>
[not found] ` <11650653921903-git-send-email-laurent.riffard@free.fr>
[not found] ` <11650653921405-git-send-email-laurent.riffard@free.fr>
2006-12-02 13:16 ` [PATCH 6/10] Reiser4: fix calls to kmem_cache_destroy Laurent Riffard
2006-12-02 13:16 ` [PATCH 7/10] Reiser4: Replace inode.u.generic_ip with inode.i_private Laurent Riffard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4572D64D.6060406@free.fr \
--to=laurent.riffard@free.fr \
--cc=reiserfs-list@namesys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.