patch-2.4.19 linux-2.4.19/fs/udf/dir.c

Next file: linux-2.4.19/fs/udf/directory.c
Previous file: linux-2.4.19/fs/udf/crc.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/fs/udf/dir.c linux-2.4.19/fs/udf/dir.c
@@ -15,14 +15,14 @@
  *		ftp://prep.ai.mit.edu/pub/gnu/GPL
  *	Each contributing author retains all rights to their own work.
  *
- *  (C) 1998-2000 Ben Fennema
+ *  (C) 1998-2001 Ben Fennema
  *
  * HISTORY
  *
  *  10/05/98 dgb  Split directory operations into it's own file
  *                Implemented directory reads via do_udf_readdir
  *  10/06/98      Made directory operations work!
- *  11/17/98      Rewrote directory to support ICB_FLAG_AD_LONG
+ *  11/17/98      Rewrote directory to support ICBTAG_FLAG_AD_LONG
  *  11/25/98 blf  Rewrote directory handling (readdir+lookup) to support reading
  *                across blocks.
  *  12/12/98      Split out the lookup code to namei.c. bulk of directory
@@ -31,16 +31,13 @@
 
 #include "udfdecl.h"
 
-#if defined(__linux__) && defined(__KERNEL__)
-#include <linux/version.h>
-#include "udf_i.h"
-#include "udf_sb.h"
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
-#include <linux/udf_fs.h>
-#endif
+
+#include "udf_i.h"
+#include "udf_sb.h"
 
 /* Prototypes for file operations */
 static int udf_readdir(struct file *, void *, filldir_t);
@@ -102,19 +99,19 @@
 do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *dirent)
 {
 	struct udf_fileident_bh fibh;
-	struct FileIdentDesc *fi=NULL;
-	struct FileIdentDesc cfi;
+	struct fileIdentDesc *fi=NULL;
+	struct fileIdentDesc cfi;
 	int block, iblock;
 	loff_t nf_pos = filp->f_pos - 1;
 	int flen;
 	char fname[255];
 	char *nameptr;
-	Uint16 liu;
-	Uint8 lfi;
+	uint16_t liu;
+	uint8_t lfi;
 	loff_t size = (udf_ext0_offset(dir) + dir->i_size) >> 2;
 	struct buffer_head * bh = NULL, * tmp, * bha[16];
 	lb_addr bloc, eloc;
-	Uint32 extoffset, elen, offset;
+	uint32_t extoffset, elen, offset;
 	int i, num;
 	unsigned int dt_type;
 
@@ -126,15 +123,15 @@
 
 	fibh.soffset = fibh.eoffset = (nf_pos & ((dir->i_sb->s_blocksize - 1) >> 2)) << 2;
 	if (inode_bmap(dir, nf_pos >> (dir->i_sb->s_blocksize_bits - 2),
-		&bloc, &extoffset, &eloc, &elen, &offset, &bh) == EXTENT_RECORDED_ALLOCATED)
+		&bloc, &extoffset, &eloc, &elen, &offset, &bh) == (EXT_RECORDED_ALLOCATED >> 30))
 	{
 		offset >>= dir->i_sb->s_blocksize_bits;
 		block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
 		if ((++offset << dir->i_sb->s_blocksize_bits) < elen)
 		{
-			if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_SHORT)
+			if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_SHORT)
 				extoffset -= sizeof(short_ad);
-			else if (UDF_I_ALLOCTYPE(dir) == ICB_FLAG_AD_LONG)
+			else if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_LONG)
 				extoffset -= sizeof(long_ad);
 		}
 		else
@@ -198,7 +195,7 @@
 		{
 			int poffset;	/* Unpaded ending offset */
 
-			poffset = fibh.soffset + sizeof(struct FileIdentDesc) + liu + lfi;
+			poffset = fibh.soffset + sizeof(struct fileIdentDesc) + liu + lfi;
 
 			if (poffset >= lfi)
 				nameptr = (char *)(fibh.ebh->b_data + poffset - lfi);
@@ -210,19 +207,19 @@
 			}
 		}
 
-		if ( (cfi.fileCharacteristics & FILE_DELETED) != 0 )
+		if ( (cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) != 0 )
 		{
 			if ( !UDF_QUERY_FLAG(dir->i_sb, UDF_FLAG_UNDELETE) )
 				continue;
 		}
 		
-		if ( (cfi.fileCharacteristics & FILE_HIDDEN) != 0 )
+		if ( (cfi.fileCharacteristics & FID_FILE_CHAR_HIDDEN) != 0 )
 		{
 			if ( !UDF_QUERY_FLAG(dir->i_sb, UDF_FLAG_UNHIDE) )
 				continue;
 		}
 
-		if ( cfi.fileCharacteristics & FILE_PARENT )
+		if ( cfi.fileCharacteristics & FID_FILE_CHAR_PARENT )
 		{
 			iblock = udf_get_lb_pblock(dir->i_sb, UDF_I_LOCATION(filp->f_dentry->d_parent->d_inode), 0);
 			flen = 2;

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