patch-2.4.25 linux-2.4.25/fs/msdos/namei.c
Next file: linux-2.4.25/fs/namespace.c
Previous file: linux-2.4.25/fs/locks.c
Back to the patch index
Back to the overall index
- Lines: 240
- Date:
2004-02-18 05:36:31.000000000 -0800
- Orig file:
linux-2.4.24/fs/msdos/namei.c
- Orig date:
2002-08-02 17:39:45.000000000 -0700
diff -urN linux-2.4.24/fs/msdos/namei.c linux-2.4.25/fs/msdos/namei.c
@@ -127,8 +127,9 @@
}
/***** Locates a directory entry. Uses unformatted name. */
-static int msdos_find(struct inode *dir,const char *name,int len,
- struct buffer_head **bh,struct msdos_dir_entry **de,int *ino)
+static int msdos_find(struct inode *dir, const char *name, int len,
+ struct buffer_head **bh, struct msdos_dir_entry **de,
+ loff_t *i_pos)
{
int res;
char dotsOK;
@@ -138,7 +139,7 @@
res = msdos_format_name(name,len, msdos_name,&MSDOS_SB(dir->i_sb)->options);
if (res < 0)
return -ENOENT;
- res = fat_scan(dir,msdos_name,bh,de,ino);
+ res = fat_scan(dir, msdos_name, bh, de, i_pos);
if (!res && dotsOK) {
if (name[0]=='.') {
if (!((*de)->attr & ATTR_HIDDEN))
@@ -149,7 +150,6 @@
}
}
return res;
-
}
/*
@@ -214,20 +214,20 @@
struct inode *inode = NULL;
struct msdos_dir_entry *de;
struct buffer_head *bh = NULL;
- int ino,res;
+ loff_t i_pos;
+ int res;
PRINTK (("msdos_lookup\n"));
dentry->d_op = &msdos_dentry_operations;
res = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &bh,
- &de, &ino);
-
+ &de, &i_pos);
if (res == -ENOENT)
goto add;
if (res < 0)
goto out;
- inode = fat_build_inode(sb, de, ino, &res);
+ inode = fat_build_inode(sb, de, i_pos, &res);
if (res)
goto out;
add:
@@ -243,13 +243,13 @@
static int msdos_add_entry(struct inode *dir, const char *name,
struct buffer_head **bh,
struct msdos_dir_entry **de,
- int *ino,
- int is_dir, int is_hid)
+ loff_t *i_pos, int is_dir, int is_hid)
{
struct super_block *sb = dir->i_sb;
int res;
- if ((res = fat_add_entries(dir, 1, bh, de, ino))<0)
+ res = fat_add_entries(dir, 1, bh, de, i_pos);
+ if (res < 0)
return res;
/*
* XXX all times should be set by caller upon successful completion.
@@ -279,7 +279,8 @@
struct buffer_head *bh;
struct msdos_dir_entry *de;
struct inode *inode;
- int ino,res,is_hid;
+ loff_t i_pos;
+ int res, is_hid;
char msdos_name[MSDOS_NAME];
res = msdos_format_name(dentry->d_name.name,dentry->d_name.len,
@@ -288,15 +289,15 @@
return res;
is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
/* Have to do it due to foo vs. .foo conflicts */
- if (fat_scan(dir,msdos_name,&bh,&de,&ino) >= 0) {
+ if (fat_scan(dir, msdos_name, &bh, &de, &i_pos) >= 0) {
fat_brelse(sb, bh);
return -EINVAL;
}
inode = NULL;
- res = msdos_add_entry(dir, msdos_name, &bh, &de, &ino, 0, is_hid);
+ res = msdos_add_entry(dir, msdos_name, &bh, &de, &i_pos, 0, is_hid);
if (res)
return res;
- inode = fat_build_inode(dir->i_sb, de, ino, &res);
+ inode = fat_build_inode(dir->i_sb, de, i_pos, &res);
fat_brelse(sb, bh);
if (!inode)
return res;
@@ -311,13 +312,14 @@
{
struct super_block *sb = dir->i_sb;
struct inode *inode = dentry->d_inode;
- int res,ino;
+ loff_t i_pos;
+ int res;
struct buffer_head *bh;
struct msdos_dir_entry *de;
bh = NULL;
res = msdos_find(dir, dentry->d_name.name, dentry->d_name.len,
- &bh, &de, &ino);
+ &bh, &de, &i_pos);
if (res < 0)
goto rmdir_done;
/*
@@ -352,7 +354,7 @@
struct inode *inode;
int res,is_hid;
char msdos_name[MSDOS_NAME];
- int ino;
+ loff_t i_pos;
res = msdos_format_name(dentry->d_name.name,dentry->d_name.len,
msdos_name, &MSDOS_SB(sb)->options);
@@ -360,13 +362,13 @@
return res;
is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
/* foo vs .foo situation */
- if (fat_scan(dir,msdos_name,&bh,&de,&ino) >= 0)
+ if (fat_scan(dir, msdos_name, &bh, &de, &i_pos) >= 0)
goto out_exist;
- res = msdos_add_entry(dir, msdos_name, &bh, &de, &ino, 1, is_hid);
+ res = msdos_add_entry(dir, msdos_name, &bh, &de, &i_pos, 1, is_hid);
if (res)
goto out_unlock;
- inode = fat_build_inode(dir->i_sb, de, ino, &res);
+ inode = fat_build_inode(dir->i_sb, de, i_pos, &res);
if (!inode) {
fat_brelse(sb, bh);
goto out_unlock;
@@ -412,13 +414,14 @@
{
struct super_block *sb = dir->i_sb;
struct inode *inode = dentry->d_inode;
- int res,ino;
+ loff_t i_pos;
+ int res;
struct buffer_head *bh;
struct msdos_dir_entry *de;
bh = NULL;
res = msdos_find(dir, dentry->d_name.name, dentry->d_name.len,
- &bh, &de, &ino);
+ &bh, &de, &i_pos);
if (res < 0)
goto unlink_done;
@@ -439,13 +442,13 @@
struct dentry *old_dentry,
struct inode *new_dir,char *new_name, struct dentry *new_dentry,
struct buffer_head *old_bh,
- struct msdos_dir_entry *old_de, int old_ino, int is_hid)
+ struct msdos_dir_entry *old_de, loff_t old_i_pos, int is_hid)
{
struct super_block *sb = old_dir->i_sb;
struct buffer_head *new_bh=NULL,*dotdot_bh=NULL;
struct msdos_dir_entry *new_de,*dotdot_de;
struct inode *old_inode,*new_inode;
- int new_ino,dotdot_ino;
+ loff_t new_i_pos, dotdot_i_pos;
int error;
int is_dir;
@@ -453,7 +456,8 @@
new_inode = new_dentry->d_inode;
is_dir = S_ISDIR(old_inode->i_mode);
- if (fat_scan(new_dir,new_name,&new_bh,&new_de,&new_ino)>=0 &&!new_inode)
+ if (fat_scan(new_dir, new_name, &new_bh, &new_de, &new_i_pos) >= 0
+ && !new_inode)
goto degenerate_case;
if (is_dir) {
if (new_inode) {
@@ -462,7 +466,7 @@
goto out;
}
error = fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh,
- &dotdot_de, &dotdot_ino);
+ &dotdot_de, &dotdot_i_pos);
if (error < 0) {
printk(KERN_WARNING
"MSDOS: %s/%s, get dotdot failed, ret=%d\n",
@@ -473,7 +477,7 @@
}
if (!new_bh) {
error = msdos_add_entry(new_dir, new_name, &new_bh, &new_de,
- &new_ino, is_dir, is_hid);
+ &new_i_pos, is_dir, is_hid);
if (error)
goto out;
}
@@ -486,7 +490,7 @@
old_de->name[0] = DELETED_FLAG;
fat_mark_buffer_dirty(sb, old_bh);
fat_detach(old_inode);
- fat_attach(old_inode, new_ino);
+ fat_attach(old_inode, new_i_pos);
if (is_hid)
MSDOS_I(old_inode)->i_attrs |= ATTR_HIDDEN;
else
@@ -542,8 +546,8 @@
struct super_block *sb = old_dir->i_sb;
struct buffer_head *old_bh;
struct msdos_dir_entry *old_de;
- int old_ino, error;
- int is_hid,old_hid; /* if new file and old file are hidden */
+ loff_t old_i_pos;
+ int error, is_hid, old_hid; /* if new file and old file are hidden */
char old_msdos_name[MSDOS_NAME], new_msdos_name[MSDOS_NAME];
error = msdos_format_name(old_dentry->d_name.name,
@@ -559,13 +563,13 @@
is_hid = (new_dentry->d_name.name[0]=='.') && (new_msdos_name[0]!='.');
old_hid = (old_dentry->d_name.name[0]=='.') && (old_msdos_name[0]!='.');
- error = fat_scan(old_dir, old_msdos_name, &old_bh, &old_de, &old_ino);
+ error = fat_scan(old_dir, old_msdos_name, &old_bh, &old_de, &old_i_pos);
if (error < 0)
goto rename_done;
error = do_msdos_rename(old_dir, old_msdos_name, old_dentry,
new_dir, new_msdos_name, new_dentry,
- old_bh, old_de, (ino_t)old_ino, is_hid);
+ old_bh, old_de, old_i_pos, is_hid);
fat_brelse(sb, old_bh);
rename_done:
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)