patch-2.1.32 linux/fs/nfs/symlink.c

Next file: linux/fs/nfs/write.c
Previous file: linux/fs/nfs/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.31/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c
@@ -48,9 +48,10 @@
 static int nfs_follow_link(struct inode *dir, struct inode *inode,
 			   int flag, int mode, struct inode **res_inode)
 {
-	int error, *mem;
+	int error;
 	unsigned int len;
 	char *res, *res2;
+	void *mem;
 
 	*res_inode = NULL;
 	if (!dir) {
@@ -95,9 +96,12 @@
 
 static int nfs_readlink(struct inode *inode, char *buffer, int buflen)
 {
-	int error, *mem;
+	int error;
 	unsigned int len;
 	char *res;
+	void *mem;
+
+	dfprintk(VFS, "nfs: readlink(%x/%ld)\n", inode->i_dev, inode->i_ino);
 
 	if (!S_ISLNK(inode->i_mode)) {
 		iput(inode);
@@ -108,12 +112,10 @@
 	error = nfs_proc_readlink(NFS_SERVER(inode), NFS_FH(inode), &mem,
 		&res, &len, buflen);
 	iput(inode);
-	if (!error) {
-		error = copy_to_user(buffer, res, len);
-		if (!error)
-			error = put_user('\0', buffer + len);
-		if (!error)
-			error = len;
+	if (! error) {
+		copy_to_user(buffer, res, len);
+		put_user('\0', buffer + len);
+		error = len;
 	}
 	kfree(mem);
 	return error;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov