*/
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
mark_inode_dirty(dir);
- memcpy((*de)->name,name,MSDOS_NAME);
+
+ memcpy((*de)->name, name, MSDOS_NAME);
(*de)->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
if (is_hid)
(*de)->attr |= ATTR_HIDDEN;
(*de)->start = 0;
(*de)->starthi = 0;
- fat_date_unix2dos(dir->i_mtime.tv_sec,&(*de)->time,&(*de)->date);
+ fat_date_unix2dos(dir->i_mtime.tv_sec, &(*de)->time, &(*de)->date);
(*de)->size = 0;
mark_buffer_dirty(*bh);
return 0;
return res;
mkdir_error:
- printk(KERN_WARNING "msdos_mkdir: error=%d, attempting cleanup\n", res);
inode->i_nlink = 0;
inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
dir->i_nlink--;
if (error)
goto out;
}
- error = fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh,
- &dotdot_de, &dotdot_i_pos);
- if (error < 0) {
- printk(KERN_WARNING
- "MSDOS: %s/%s, get dotdot failed, ret=%d\n",
- old_dentry->d_parent->d_name.name,
- old_dentry->d_name.name, error);
+ if (fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh,
+ &dotdot_de, &dotdot_i_pos) < 0) {
+ error = -EIO;
goto out;
}
}
#include <linux/buffer_head.h>
#include <linux/namei.h>
-#define DEBUG_LEVEL 0
-#if (DEBUG_LEVEL >= 1)
-# define PRINTK1(x) printk x
-#else
-# define PRINTK1(x)
-#endif
-#if (DEBUG_LEVEL >= 2)
-# define PRINTK2(x) printk x
-#else
-# define PRINTK2(x)
-#endif
-#if (DEBUG_LEVEL >= 3)
-# define PRINTK3(x) printk x
-#else
-# define PRINTK3(x)
-#endif
-
static int vfat_hashi(struct dentry *parent, struct qstr *qstr);
static int vfat_hash(struct dentry *parent, struct qstr *qstr);
static int vfat_cmpi(struct dentry *dentry, struct qstr *a, struct qstr *b);
for (cksum = i = 0; i < 11; i++) {
cksum = (((cksum&1)<<7)|((cksum&0xfe)>>1)) + msdos_name[i];
}
- PRINTK3(("vfat_fill_slots 3: slots=%d\n",*slots));
for (ps = ds, slot = *slots; slot > 0; slot--, ps++) {
ps->id = slot;
de = (struct msdos_dir_entry *) ps;
shortname:
- PRINTK3(("vfat_fill_slots 9\n"));
/* build the entry of 8.3 alias name */
(*slots)++;
memcpy(de->name, msdos_name, MSDOS_NAME);
struct msdos_dir_entry *de;
int table;
- PRINTK2(("vfat_lookup: name=%s, len=%d\n",
- dentry->d_name.name, dentry->d_name.len));
-
lock_kernel();
table = (MSDOS_SB(dir->i_sb)->options.name_check == 's') ? 2 : 0;
dentry->d_op = &vfat_dentry_ops[table];
struct buffer_head *bh = NULL;
struct msdos_dir_entry *de;
- PRINTK1(("vfat_unlink: %s\n", dentry->d_name.name));
lock_kernel();
res = vfat_find(dir,&dentry->d_name,&sinfo,&bh,&de);
if (res < 0) {
new_inode = new_dentry->d_inode;
lock_kernel();
res = vfat_find(old_dir,&old_dentry->d_name,&old_sinfo,&old_bh,&old_de);
- PRINTK3(("vfat_rename 2\n"));
- if (res < 0) goto rename_done;
+ if (res < 0)
+ goto rename_done;
is_dir = S_ISDIR(old_inode->i_mode);
- if (is_dir && (res = fat_scan(old_inode,MSDOS_DOTDOT,&dotdot_bh,
- &dotdot_de,&dotdot_i_pos)) < 0)
- goto rename_done;
+ if (is_dir) {
+ if (fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh,
+ &dotdot_de, &dotdot_i_pos) < 0) {
+ res = -EIO;
+ goto rename_done;
+ }
+ }
if (new_dentry->d_inode) {
res = vfat_find(new_dir,&new_dentry->d_name,&sinfo,&new_bh,