patch-2.4.25 linux-2.4.25/fs/fat/dir.c
Next file: linux-2.4.25/fs/fat/inode.c
Previous file: linux-2.4.25/fs/ext3/super.c
Back to the patch index
Back to the overall index
- Lines: 108
- Date:
2004-02-18 05:36:31.000000000 -0800
- Orig file:
linux-2.4.24/fs/fat/dir.c
- Orig date:
2001-10-12 13:48:42.000000000 -0700
diff -urN linux-2.4.24/fs/fat/dir.c linux-2.4.25/fs/fat/dir.c
@@ -198,11 +198,11 @@
int uni_xlate = MSDOS_SB(sb)->options.unicode_xlate;
int utf8 = MSDOS_SB(sb)->options.utf8;
unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname;
- int ino, chl, i, j, last_u, res = 0;
- loff_t cpos = 0;
+ int chl, i, j, last_u, res = 0;
+ loff_t i_pos, cpos = 0;
while(1) {
- if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1)
+ if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1)
goto EODir;
parse_record:
long_slots = 0;
@@ -253,7 +253,7 @@
if (ds->id & 0x40) {
unicode[offset + 13] = 0;
}
- if (fat_get_entry(inode,&cpos,&bh,&de,&ino)<0)
+ if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos)<0)
goto EODir;
if (slot == 0)
break;
@@ -368,8 +368,9 @@
int utf8 = MSDOS_SB(sb)->options.utf8;
int nocase = MSDOS_SB(sb)->options.nocase;
unsigned short opt_shortname = MSDOS_SB(sb)->options.shortname;
- int ino, inum, chi, chl, i, i2, j, last, last_u, dotoffset = 0;
- loff_t cpos;
+ unsigned long inum;
+ int chi, chl, i, i2, j, last, last_u, dotoffset = 0;
+ loff_t i_pos, cpos;
cpos = filp->f_pos;
/* Fake . and .. for the root directory. */
@@ -392,7 +393,7 @@
bh = NULL;
GetNew:
long_slots = 0;
- if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1)
+ if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1)
goto EODir;
/* Check for long filename entry */
if (isvfat) {
@@ -449,7 +450,7 @@
if (ds->id & 0x40) {
unicode[offset + 13] = 0;
}
- if (fat_get_entry(inode,&cpos,&bh,&de,&ino) == -1)
+ if (fat_get_entry(inode,&cpos,&bh,&de,&i_pos) == -1)
goto EODir;
if (slot == 0)
break;
@@ -541,7 +542,7 @@
/* inum = fat_parent_ino(inode,0); */
inum = filp->f_dentry->d_parent->d_inode->i_ino;
} else {
- struct inode *tmp = fat_iget(sb, ino);
+ struct inode *tmp = fat_iget(sb, i_pos);
if (tmp) {
inum = tmp->i_ino;
iput(tmp);
@@ -690,14 +691,14 @@
/***** See if directory is empty */
int fat_dir_empty(struct inode *dir)
{
- loff_t pos;
+ loff_t pos, i_pos;
struct buffer_head *bh;
struct msdos_dir_entry *de;
- int ino,result = 0;
+ int result = 0;
pos = 0;
bh = NULL;
- while (fat_get_entry(dir,&pos,&bh,&de,&ino) > -1) {
+ while (fat_get_entry(dir,&pos,&bh,&de,&i_pos) > -1) {
/* Ignore vfat longname entries */
if (de->attr == ATTR_EXT)
continue;
@@ -717,7 +718,7 @@
/* This assumes that size of cluster is above the 32*slots */
int fat_add_entries(struct inode *dir,int slots, struct buffer_head **bh,
- struct msdos_dir_entry **de, int *ino)
+ struct msdos_dir_entry **de, loff_t *i_pos)
{
struct super_block *sb = dir->i_sb;
loff_t offset, curr;
@@ -727,7 +728,7 @@
offset = curr = 0;
*bh = NULL;
row = 0;
- while (fat_get_entry(dir,&curr,bh,de,ino) > -1) {
+ while (fat_get_entry(dir,&curr,bh,de,i_pos) > -1) {
if (IS_FREE((*de)->name)) {
if (++row == slots)
return offset;
@@ -742,7 +743,7 @@
if (!new_bh)
return -ENOSPC;
fat_brelse(sb, new_bh);
- do fat_get_entry(dir,&curr,bh,de,ino); while (++row<slots);
+ do fat_get_entry(dir,&curr,bh,de,i_pos); while (++row<slots);
return offset;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)