summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-12-29 23:46:14 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2003-12-29 23:46:14 -0800
commit0a33358cf289e024b7e67436f8539f1348aed238 (patch)
tree28baec0ac2d21f3225e543fcf6dfed492481c63a
parent26b885870f5c67d704cfa40a65a6379db7c2182f (diff)
[PATCH] FAT: Use just printk() instead of unneeded fat_fs_panic()
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> - uses just printk() instead of unneeded fat_fs_panic() - removes the debug printk - less verbose on error path - uses correct a error number on error path
-rw-r--r--fs/fat/inode.c6
-rw-r--r--fs/msdos/namei.c16
-rw-r--r--fs/vfat/namei.c37
3 files changed, 18 insertions, 41 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index 065b12513bf9..e5930b49ec77 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -1226,10 +1226,10 @@ retry:
}
lock_kernel();
if (!(bh = sb_bread(sb, i_pos >> MSDOS_SB(sb)->dir_per_block_bits))) {
- fat_fs_panic(sb, "unable to read i-node block (i_pos %lld)",
- i_pos);
+ printk(KERN_ERR "FAT: unable to read inode block "
+ "for updating (i_pos %lld)", i_pos);
unlock_kernel();
- return;
+ return /* -EIO */;
}
spin_lock(&fat_inode_lock);
if (i_pos != MSDOS_I(inode)->i_pos) {
diff --git a/fs/msdos/namei.c b/fs/msdos/namei.c
index 690fc68b7f6c..62a24f67ae83 100644
--- a/fs/msdos/namei.c
+++ b/fs/msdos/namei.c
@@ -244,13 +244,14 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name,
*/
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;
@@ -393,7 +394,6 @@ out_unlock:
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--;
@@ -468,13 +468,9 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name,
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;
}
}
diff --git a/fs/vfat/namei.c b/fs/vfat/namei.c
index 7085ac36c9d7..e363da852a3e 100644
--- a/fs/vfat/namei.c
+++ b/fs/vfat/namei.c
@@ -25,23 +25,6 @@
#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);
@@ -699,7 +682,6 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name,
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;
@@ -716,7 +698,6 @@ static int vfat_build_slots(struct inode *dir, const unsigned char *name,
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);
@@ -834,9 +815,6 @@ struct dentry *vfat_lookup(struct inode *dir,struct dentry *dentry, struct namei
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];
@@ -969,7 +947,6 @@ int vfat_unlink(struct inode *dir, struct dentry* dentry)
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) {
@@ -1050,14 +1027,18 @@ int vfat_rename(struct inode *old_dir,struct dentry *old_dentry,
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,