patch-2.3.26 linux/fs/ncpfs/inode.c

Next file: linux/fs/ncpfs/mmap.c
Previous file: linux/fs/lockd/mon.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.25/linux/fs/ncpfs/inode.c linux/fs/ncpfs/inode.c
@@ -122,12 +122,8 @@
 		}
 		if (nwi->attributes & aRONLY) inode->i_mode &= ~0222;
 	}
-	inode->i_blocks = 0;
-	if ((inode->i_size)&&(inode->i_blksize)) {
-		inode->i_blocks = (inode->i_size-1)/(inode->i_blksize)+1;
-	}
+	inode->i_blocks = (inode->i_size + NCP_BLOCK_SIZE - 1) >> NCP_BLOCK_SHIFT;
 
-	/* TODO: times? I'm not sure... */
 	inode->i_mtime = ncp_date_dos2unix(le16_to_cpu(nwinfo->i.modifyTime),
 			  		   le16_to_cpu(nwinfo->i.modifyDate));
 	inode->i_ctime = ncp_date_dos2unix(le16_to_cpu(nwinfo->i.creationTime),
@@ -192,14 +188,10 @@
 	inode->i_nlink = 1;
 	inode->i_uid = server->m.uid;
 	inode->i_gid = server->m.gid;
-	inode->i_blksize = NCP_BLOCK_SIZE;
 	inode->i_rdev = 0;
+	inode->i_blksize = NCP_BLOCK_SIZE;
 
-	inode->i_blocks = 0;
-	if ((inode->i_blksize != 0) && (inode->i_size != 0)) {
-		inode->i_blocks =
-		    (inode->i_size - 1) / inode->i_blksize + 1;
-	}
+	inode->i_blocks = (inode->i_size + NCP_BLOCK_SIZE - 1) >> NCP_BLOCK_SHIFT;
 
 	inode->i_mtime = ncp_date_dos2unix(le16_to_cpu(nwi->modifyTime),
 			  		   le16_to_cpu(nwi->modifyDate));

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