git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git]
/
fs
/
xfs
/
linux-2.6
/
xfs_iops.c
diff --git
a/fs/xfs/linux-2.6/xfs_iops.c
b/fs/xfs/linux-2.6/xfs_iops.c
index
8a08140
..
962cf8d
100644
(file)
--- a/
fs/xfs/linux-2.6/xfs_iops.c
+++ b/
fs/xfs/linux-2.6/xfs_iops.c
@@
-67,6
+67,7
@@
#include "xfs_utils.h"
#include <linux/xattr.h>
#include "xfs_utils.h"
#include <linux/xattr.h>
+#include <linux/namei.h>
/*
/*
@@
-419,13
+420,16
@@
linvfs_follow_link(
ASSERT(nd);
link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
ASSERT(nd);
link = (char *)kmalloc(MAXNAMELEN+1, GFP_KERNEL);
- if (!link)
- return -ENOMEM;
+ if (!link) {
+ nd_set_link(nd, ERR_PTR(-ENOMEM));
+ return 0;
+ }
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) {
kfree(link);
uio = (uio_t *)kmalloc(sizeof(uio_t), GFP_KERNEL);
if (!uio) {
kfree(link);
- return -ENOMEM;
+ nd_set_link(nd, ERR_PTR(-ENOMEM));
+ return 0;
}
vp = LINVFS_GET_VP(dentry->d_inode);
}
vp = LINVFS_GET_VP(dentry->d_inode);
@@
-441,18
+445,22
@@
linvfs_follow_link(
VOP_READLINK(vp, uio, 0, NULL, error);
if (error) {
VOP_READLINK(vp, uio, 0, NULL, error);
if (error) {
- kfree(uio);
kfree(link);
kfree(link);
- return -error;
+ link = ERR_PTR(-error);
+ } else {
+ link[MAXNAMELEN - uio->uio_resid] = '\0';
}
}
-
- link[MAXNAMELEN - uio->uio_resid] = '\0';
kfree(uio);
kfree(uio);
- /* vfs_follow_link returns (-) errors */
- error = vfs_follow_link(nd, link);
- kfree(link);
- return error;
+ nd_set_link(nd, link);
+ return 0;
+}
+
+static void linvfs_put_link(struct dentry *dentry, struct nameidata *nd)
+{
+ char *s = nd_get_link(nd);
+ if (!IS_ERR(s))
+ kfree(s);
}
#ifdef CONFIG_XFS_POSIX_ACL
}
#ifdef CONFIG_XFS_POSIX_ACL
@@
-719,6
+727,7
@@
struct inode_operations linvfs_dir_inode_operations = {
struct inode_operations linvfs_symlink_inode_operations = {
.readlink = linvfs_readlink,
.follow_link = linvfs_follow_link,
struct inode_operations linvfs_symlink_inode_operations = {
.readlink = linvfs_readlink,
.follow_link = linvfs_follow_link,
+ .put_link = linvfs_put_link,
.permission = linvfs_permission,
.getattr = linvfs_getattr,
.setattr = linvfs_setattr,
.permission = linvfs_permission,
.getattr = linvfs_getattr,
.setattr = linvfs_setattr,