Skip to contentSkip to conversation

reiser4-fix-readlink.patch]

PATCH New Hans Reiser 1 participant 1 message Nov 11, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 reiser4-fix-readlink.patch]

From: Hans Reiser <[email protected]>

There is no need to implement reiser4 specific readlink. Use generic function.

 fs/reiser4/plugin/inode_ops.c |   19 -------------------
 fs/reiser4/plugin/object.c    |    2 +-
 fs/reiser4/plugin/object.h    |    1 -
 3 files changed, 1 insertion(+), 21 deletions(-)
fs/reiser4/plugin/inode_ops.c renamed from fs/reiser4/plugin/inode_ops.c~reiser4-fix-readlink +0 -19
diff -puN fs/reiser4/plugin/inode_ops.c~reiser4-fix-readlink fs/reiser4/plugin/inode_ops.c
@@ -383,25 +383,6 @@ int mknod_common(struct inode *parent, s
  */
 
 /**
- * readlink_common - readlink of inode operations
- * @dentry: dentry of symlink
- * @buf: user buffer to read symlink content to
- * @buflen: size of user buffer
- *
- * This is common implementation of vfs's readlink method of struct
- * inode_operations.
- * Assumes that inode's generic_ip points to the content of symbolic link.
- */
-int readlink_common(struct dentry *dentry, char __user *buf, int buflen)
-{
-	assert("vs-852", S_ISLNK(dentry->d_inode->i_mode));
-	if (!dentry->d_inode->u.generic_ip
-	    || !inode_get_flag(dentry->d_inode, REISER4_GENERIC_PTR_USED))
-		return RETERR(-EINVAL);
-	return vfs_readlink(dentry, buf, buflen, dentry->d_inode->u.generic_ip);
-}
-
-/**
  * follow_link_common - follow_link of inode operations
  * @dentry: dentry of symlink
  * @data:
fs/reiser4/plugin/object.c renamed from fs/reiser4/plugin/object.c~reiser4-fix-readlink +1 -1
diff -puN fs/reiser4/plugin/object.c~reiser4-fix-readlink fs/reiser4/plugin/object.c
@@ -202,7 +202,7 @@ file_plugin file_plugins[LAST_FILE_PLUGI
 			.linkage = {NULL,NULL}
 		},
 		.inode_ops = {
-			.readlink = readlink_common,
+			.readlink = generic_readlink,
 			.follow_link = follow_link_common,
 			.permission = permission_common,
 			.setattr = setattr_common,
fs/reiser4/plugin/object.h renamed from fs/reiser4/plugin/object.h~reiser4-fix-readlink +0 -1
diff -puN fs/reiser4/plugin/object.h~reiser4-fix-readlink fs/reiser4/plugin/object.h
@@ -23,7 +23,6 @@ int mknod_common(struct inode *parent, s
 		 int mode, dev_t rdev);
 int rename_common(struct inode *old_dir, struct dentry *old_name,
 		  struct inode *new_dir, struct dentry *new_name);
-int readlink_common(struct dentry *, char __user *buf, int buflen);
 void *follow_link_common(struct dentry *, struct nameidata *data);
 int permission_common(struct inode *, int mask,	/* mode bits to check permissions for */
 		      struct nameidata *nameidata);

_