patch-2.1.106 linux/fs/devpts/inode.c

Next file: linux/fs/filesystems.c
Previous file: linux/fs/binfmt_aout.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.105/linux/fs/devpts/inode.c linux/fs/devpts/inode.c
@@ -28,15 +28,6 @@
 
 static struct super_block *mounts = NULL;
 
-static void devpts_put_inode(struct inode *inode)
-{
-}
-
-static void devpts_delete_inode(struct inode *inode)
-{
-	inode->i_size = 0;
-}
-
 static void devpts_put_super(struct super_block *sb)
 {
 	struct devpts_sb_info *sbi = SBI(sb);
@@ -48,6 +39,7 @@
 			if ( inode->i_count != 1 )
 				printk("devpts_put_super: badness: entry %d count %d\n",
 				       i, inode->i_count);
+			inode->i_nlink--;
 			iput(inode);
 		}
 	}
@@ -70,8 +62,8 @@
 static struct super_operations devpts_sops = {
 	devpts_read_inode,
 	devpts_write_inode,
-	devpts_put_inode,
-	devpts_delete_inode,
+	NULL,			/* put_inode */
+	NULL,			/* delete_inode */
 	NULL,			/* notify_change */
 	devpts_put_super,
 	NULL,			/* write_super */
@@ -281,8 +273,6 @@
 	if ( ino >= NR_PTYS )
 		return;		/* Bogus */
 	
-	inode->i_nlink = 1;
-
 	inode->i_mode = S_IFCHR;
 	inode->i_rdev = MKDEV(0,0); /* Gets filled in by devpts_pty_new() */
 
@@ -322,6 +312,7 @@
 			inode->i_gid = sbi->setgid ? sbi->gid : current->fsgid;
 			inode->i_mode = sbi->mode | S_IFCHR;
 			inode->i_rdev = device;
+			inode->i_nlink++;
 			sbi->inodes[number] = inode;
 		}
 	}
@@ -340,7 +331,7 @@
 
 		if ( inode ) {
 			sbi->inodes[number] = NULL;
-			inode->i_nlink = 0; /* Is this right? */
+			inode->i_nlink--;
 			iput(inode);
 		}
 	}

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