patch-2.3.99-pre7 linux/fs/coda/pioctl.c

Next file: linux/fs/coda/psdev.c
Previous file: linux/fs/buffer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre6/linux/fs/coda/pioctl.c linux/fs/coda/pioctl.c
@@ -73,7 +73,7 @@
 static int coda_pioctl(struct inode * inode, struct file * filp, 
 		       unsigned int cmd, unsigned long user_data)
 {
-        struct dentry *target_de;
+	struct nameidata nd;
         int error;
 	struct PioctlData data;
         struct inode *target_inode = NULL;
@@ -92,16 +92,16 @@
 	CDEBUG(D_PIOCTL, "namei, data.follow = %d\n", 
 	       data.follow);
         if ( data.follow ) {
-                target_de = namei(data.path);
+                error = user_path_walk(data.path, &nd);
 	} else {
-	        target_de = lnamei(data.path);
+	        error = user_path_walk_link(data.path, &nd);
 	}
 		
-	if ( IS_ERR(target_de) ) {
+	if ( error ) {
                 CDEBUG(D_PIOCTL, "error: lookup fails.\n");
-		return PTR_ERR(target_de);
+		return error;
         } else {
-	        target_inode = target_de->d_inode;
+	        target_inode = nd.dentry->d_inode;
 	}
 	
 	CDEBUG(D_PIOCTL, "target ino: 0x%ld, dev: 0x%d\n",
@@ -109,8 +109,7 @@
 
 	/* return if it is not a Coda inode */
 	if ( target_inode->i_sb != inode->i_sb ) {
-  	        if ( target_de )
-		        dput(target_de);
+		path_release(&nd);
 	        return  -EINVAL;
 	}
 
@@ -121,9 +120,8 @@
 
         CDEBUG(D_PIOCTL, "ioctl on inode %ld\n", target_inode->i_ino);
 	CDEBUG(D_DOWNCALL, "dput on ino: %ld, icount %d, dcount %d\n", target_inode->i_ino, 
-	       target_inode->i_count, target_de->d_count);
-        if ( target_de ) 
-	        dput(target_de);
+	       target_inode->i_count, nd.dentry->d_count);
+	path_release(&nd);
         return error;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)