summaryrefslogtreecommitdiffstats
path: root/fs/umsdos
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-05-07 02:55:41 +0000
commitdcec8a13bf565e47942a1751a9cec21bec5648fe (patch)
tree548b69625b18cc2e88c3e68d0923be546c9ebb03 /fs/umsdos
parent2e0f55e79c49509b7ff70ff1a10e1e9e90a3dfd4 (diff)
o Merge with Linux 2.1.99.
o Fix ancient bug in the ELF loader making ldd crash. o Fix ancient bug in the keyboard code for SGI, SNI and Jazz.
Diffstat (limited to 'fs/umsdos')
-rw-r--r--fs/umsdos/README-WIP.txt87
-rw-r--r--fs/umsdos/dir.c44
-rw-r--r--fs/umsdos/emd.c68
-rw-r--r--fs/umsdos/file.c35
-rw-r--r--fs/umsdos/inode.c48
-rw-r--r--fs/umsdos/ioctl.c25
-rw-r--r--fs/umsdos/namei.c113
-rw-r--r--fs/umsdos/rdir.c10
8 files changed, 280 insertions, 150 deletions
diff --git a/fs/umsdos/README-WIP.txt b/fs/umsdos/README-WIP.txt
index ddc2911fc..1357fdd69 100644
--- a/fs/umsdos/README-WIP.txt
+++ b/fs/umsdos/README-WIP.txt
@@ -8,7 +8,7 @@ UMSDOS FILESYSTEM, AND MAYBE EVEN OTHER FILESYSTEMS IN USE.
YOU'VE BEEN WARNED.
--------- WARNING --------- WARNING --------- WARNING -----------
-Current status (980220) - UMSDOS dentry-WIP-Beta 0.82-1:
+Current status (980220) - UMSDOS dentry-WIP-Beta 0.82-3:
(1) pure MSDOS (no --linux-.--- EMD file):
@@ -19,7 +19,7 @@ Current status (980220) - UMSDOS dentry-WIP-Beta 0.82-1:
- creat file - works
- write file - works
- mkdir - works
-- rmdir - questionable. probable problem on non-empty dirs.
+- rmdir - QUESTIONABLE. probable problem on non-empty dirs.
Notes: possible very minor problems with dentry/inode/... kernel structures (very rare)
@@ -42,28 +42,29 @@ Notes: possible very minor problems with dentry/inode/... kernel structures (ver
- other ioctls - MOSTLY UNTESTED
- dangling symlink - UNTESTED !
-- create symlink - works on short names, but fails (gets
- truncated on long ones) (also
- due to some dentries problems, it may not
- be visible right away always - eg. before
- umount/mount)
+- create symlink - seems to work both on short & long names now !
- create hardlink - WARNING: NOT FIXED YET!
-- create file - creates short names, but probs with long ones ?
-- create special file - seems to work on short names.
-- write to file - seems to work on short names.
+- create file - seems to work both on short & long names now !
+- create special file - seems to work both on short & long names now !
+- write to file - seems to work both on short & long names now !
- rename file (same dir) - WARNING: NOT FIXED YET!
- rename file (dif. dir) - WARNING: NOT FIXED YET!
- rename dir (same dir) - WARNING: NOT FIXED YET!
- rename dir (dif. dir) - WARNING: NOT FIXED YET!
-- delete file - WARNING: NOT FIXED YET!
+- delete file - seems to work fully now!
- notify_change (chown,perms) - seems to work!
- delete hardlink - WARNING: NOT FIXED YET!
-- mkdir - seems to work, even with long names ! (but
- due to some dentries problems, it may not
- be visible right away always - eg. before
- umount/mount)
+- mkdir - seems to work both on short & long names now !
- rmdir - WARNING: NOT FIXED YET!
-- umssyncing - does something :-), but NEEDS EXTENSIVE TESTING
+- umssyncing - seems to work, but NEEDS EXTENSIVE TESTING
+
+- CVF-FAT stuff (compressed DOS filesystem) - there is some support from
+ Frank Gockel <gockel@sent13.uni-duisburg.de> to use it even under
+ umsdosfs. But I have no way of testing it -- please let me know if there
+ are problems that are specific to umsdos (eg. it works under msdosfs, but
+ not under umsdosfs)
+
+
Notes: moderate dentry/inode kernel structures trashing. Probably some other
kernel structures compromised. Have SysRq support compiled in, and use
@@ -77,16 +78,18 @@ Notes3: Notes2 is probably somewhat outdated now that hardlink/symlink stuff
is supposed to be fixed enough to work, but I haven't got the time to test
it.
-Note4: on failure of creating of long filenames: MSDOS filename gets
-created, and EMD entry gets created. Check: either they mismatch, or EMD
-entry contains some wrong flags.
+Note5: rmdir(2) fails with EBUSY - sdir->i_count > 1 (like 7 ??). It must be
+some error with dir->i_count++, or something related to iput() ? See if
+number changes if we access the dir in different ways..
-Note5: rmdir(2) probably fails because do_rmdir calls lock_parent, which
-uses dentry->d_parent, which we neglect to set, so it returns -ENOENT.
-Probably same problem on unlink(2) ? What to do ? How to set
-dentry->d_parent to something useful ?? Must I recurse down whole pathname
-and set one by one all directory components ?! or only last one is really
-needed ? help !
+Note6: there is problem with unmounting umsdosfs, it seems to stay
+registered or something. Remounting same device on any mount point with
+different fstype (like msdos or vfat) ignores fstype and umsdosfs kicks back
+in.
+
+Note7: also we screwed umount(2)-ing the fs at times (EBUSY), by removing
+all those iput/dput's. When rest of code is fixed, we'll put them back at
+(hopefully) correct places.
------------------------------------------------------------------------------
@@ -110,10 +113,10 @@ should we destroy temp dentries ? using d_invalidate ? using d_drop ? just
dput them ?
I'm unfortunatelly somewhat out of time to read linux-kernel, but I do check
-for any messages having UMSDOS in subject, and read them. I should reply to
-any direct Email in few days. If I don't - probably I never got your
-message. You can try mnalis@open.hr or mnalis@voyager.hr; however
-mnalis@jagor.srce.hr is preferable one.
+for any messages having UMSDOS in subject, and read them. I might miss it in
+all that volume, though. I should reply to any direct Email in few days. If
+I don't - probably I never got your message. You can try mnalis@open.hr or
+mnalis@voyager.hr; however mnalis@jagor.srce.hr is preferable one.
------------------------------------------------------------------------------
@@ -122,7 +125,7 @@ some of my notes for myself /mn/:
+ hardlinks/symlinks. test with files in not_the_same_dir
- also test not_the_same_dir for other file operations like rename etc.
- iput: device 00:00 inode 318 still has aliases! problem. Check in iput()
- for device 0,0. Probably null pointer passed arount when it shouldn't be ?
+ for device 0,0. Probably null pointer passed around when it shouldn't be ?
- dput/iput problem...
- what about .dotfiles ? working ? multiple dots ? etc....
- fix stuff like dir->i_count++ to atomic_inc(&dir->i_count) and simular?
@@ -133,11 +136,23 @@ some of my notes for myself /mn/:
- when should dput()/iput() be used ?!!
-- probably problem with filename mangling somewhere, since both create and
- write to file work on short filenames, but fail on long ones. Path
- components may be of any size (eg. mkfifo /mnt/Very_long_dir2/blah1 will
- succeed, but mkfifo /mnt/very_long_filename.txt won't)
-
-
- what is dir->i_count++ ? locking directory ? should this be lock_parent or
something ?
+
+- i_binary=2 is for CVF (compressed filesystem).
+
+- SECURITY WARNING: short dentries should be invalidated, or they could be
+ accessed instead of proper long names.
+
+- as for iput() : (my only pointer so far. anyone else ?)
+
+>development I only know about iput. All functions that get an inode as
+>argument and don't return it have to call iput on it before exit, i.e. when
+>it is no longer needed and the code returns to vfs layer. The rest is quite
+>new to me, but it might be similar for dput. Typical side effect of a
+>missing iput was a memory runout (but no crash). You also couldn't unmount
+>the filesystem later though no process was using it. On the other hand, one
+>iput too much lead to serious pointer corruption and crashed the system
+>very soon. I used to look at the FAT filesystem and copy those pieces of
+>
+> Frank
diff --git a/fs/umsdos/dir.c b/fs/umsdos/dir.c
index 52a72367e..288c77d45 100644
--- a/fs/umsdos/dir.c
+++ b/fs/umsdos/dir.c
@@ -36,7 +36,7 @@ int compat_umsdos_real_lookup (struct inode *dir,const char *name,int len, struc
int rv;
struct dentry *dentry;
- dentry = creat_dentry (name, len, NULL);
+ dentry = creat_dentry (name, len, NULL, NULL);
rv = umsdos_real_lookup(dir,dentry);
if (inode) *inode = dentry->d_inode;
kill_dentry (dentry);
@@ -50,7 +50,7 @@ int compat_msdos_create(struct inode *dir,const char *name,int len, int mode, st
int rv;
struct dentry *dentry;
- dentry = creat_dentry (name, len, NULL);
+ dentry = creat_dentry (name, len, NULL, NULL);
rv = msdos_create(dir,dentry,mode);
if(inode != NULL) *inode = dentry->d_inode;
@@ -270,10 +270,10 @@ static int umsdos_readdir_x(
}
Printk (("Trouve ino %ld ",inode->i_ino));
if (u_entry != NULL) *u_entry = entry;
- iput (inode);
+ /* iput (inode); FIXME */
break;
}
- iput (inode);
+ /* iput (inode); FIXME */
}else{
/* #Specification: umsdos / readdir / not in MSDOS
During a readdir operation, if the file is not
@@ -295,7 +295,7 @@ static int umsdos_readdir_x(
the special offset.
*/
if (filp->f_pos == 0) filp->f_pos = start_fpos;
- iput(emd_dir);
+ /* iput(emd_dir); FIXME */
}
}
umsdos_endlookup(dir);
@@ -530,7 +530,7 @@ int umsdos_inode2entry (
ret = 0;
}else{
struct inode *emddir = umsdos_emd_dir_lookup(dir,0);
- iput (emddir);
+ /* iput (emddir); FIXME */
if (emddir == NULL){
/* This is a DOS directory */
struct UMSDOS_DIR_SEARCH bufk;
@@ -639,7 +639,7 @@ int umsdos_locate_path (
while (dir != root_inode){
struct inode *adir;
ret = umsdos_locate_ancestor (dir,&adir,&entry);
- iput (dir);
+ /* iput (dir); FIXME */
dir = NULL;
Printk (("ancestor %d ",ret));
if (ret == 0){
@@ -657,7 +657,7 @@ int umsdos_locate_path (
kfree (bpath);
}
Printk (("\n"));
- iput (dir);
+ /* iput (dir); FIXME */
return ret;
}
@@ -697,12 +697,16 @@ int umsdos_lookup_x (
struct inode *pseudo_root_inode=NULL;
int len = dentry->d_name.len;
const char *name = dentry->d_name.name;
+
+ Printk ((KERN_DEBUG "umsdos_lookup_x: /mn/ name=%.*s, dir=%lu, d_parent=%p\n", (int) dentry->d_name.len, dentry->d_name.name, dir->i_ino, dentry->d_parent)); /* FIXME /mn/ debug only */
+ if (dentry->d_parent) Printk ((KERN_DEBUG " d_parent is %.*s\n", (int) dentry->d_parent->d_name.len, dentry->d_parent->d_name.name)); /* FIXME : delme /mn/ */
+
root_inode = iget(dir->i_sb,UMSDOS_ROOT_INO);
/* pseudo_root_inode = iget( ... ) ? */
dentry->d_inode = NULL;
- umsdos_startlookup(dir);
+ umsdos_startlookup(dir);
if (len == 1 && name[0] == '.'){
- dentry->d_inode = dir;
+ d_add (dentry, dir);
dir->i_count++;
ret = 0;
}else if (len == 2 && name[0] == '.' && name[1] == '.'){
@@ -713,7 +717,7 @@ int umsdos_lookup_x (
pseudo root is returned.
*/
ret = 0;
- dentry->d_inode = pseudo_root;
+ d_add (dentry, pseudo_root);
pseudo_root->i_count++;
}else{
/* #Specification: locating .. / strategy
@@ -735,7 +739,7 @@ int umsdos_lookup_x (
struct inode *aadir;
struct umsdos_dirent entry;
ret = umsdos_locate_ancestor (dentry->d_inode,&aadir,&entry);
- iput (aadir);
+ /* iput (aadir); FIXME */
}
}
}else if (umsdos_is_pseudodos(dir,dentry)){
@@ -743,7 +747,7 @@ int umsdos_lookup_x (
A lookup of DOS in the pseudo root will always succeed
and return the inode of the real root.
*/
- dentry->d_inode = root_inode;
+ d_add (dentry, root_inode);
(dentry->d_inode)->i_count++;
ret = 0;
}else{
@@ -776,7 +780,7 @@ int umsdos_lookup_x (
Printk ((KERN_DEBUG "umsdos_lookup_x /mn/ debug: ino=%li\n", inode->i_ino));
/* we've found it. now get inode and put it in dentry. Is this ok /mn/ ? */
- dentry->d_inode = iget(dir->i_sb, inode->i_ino);
+ d_add (dentry, iget(dir->i_sb, inode->i_ino));
umsdos_lookup_patch (dir,inode,&info.entry,info.f_pos);
Printk (("lookup ino %ld flags %d\n",inode->i_ino
@@ -796,7 +800,7 @@ int umsdos_lookup_x (
mode.
*/
Printk ((KERN_ERR "umsdos_lookup_x: warning: untested /mn/ Pseudo_root thingy\n"));
- iput (pseudo_root);
+ /* iput (pseudo_root); FIXME */
dentry->d_inode = NULL;
ret = -ENOENT;
}
@@ -804,7 +808,7 @@ int umsdos_lookup_x (
}
}
umsdos_endlookup(dir);
- iput (dir);
+ /* iput (dir); FIXME */
Printk ((KERN_DEBUG "umsdos_lookup_x: returning %d\n", ret));
return ret;
}
@@ -858,7 +862,7 @@ int umsdos_hlink2inode (struct inode *hlink, struct inode **result)
*result = NULL;
if (path == NULL){
ret = -ENOMEM;
- iput (hlink);
+ /* iput (hlink); FIXME */
}else{
struct file filp;
loff_t offs = 0;
@@ -866,7 +870,7 @@ int umsdos_hlink2inode (struct inode *hlink, struct inode **result)
fill_new_filp (&filp, NULL);
- dentry_src = creat_dentry ("hlink-mn", 8, hlink);
+ dentry_src = creat_dentry ("hlink-mn", 8, hlink, NULL);
memset (&filp, 0, sizeof (filp));
@@ -894,7 +898,7 @@ int umsdos_hlink2inode (struct inode *hlink, struct inode **result)
if (*pt == '/') *pt++ = '\0';
/* FIXME. /mn/ fixed ? */
- dentry_dst = creat_dentry (start, len, NULL);
+ dentry_dst = creat_dentry (start, len, NULL, NULL);
if (dir->u.umsdos_i.i_emd_dir == 0){
/* This is a DOS directory */
@@ -917,7 +921,7 @@ int umsdos_hlink2inode (struct inode *hlink, struct inode **result)
}
}else{
Printk (("umsdos_hlink2inode: all those iput's() frighten me /mn/. Whatabout dput() ? FIXME!\n"));
- iput (hlink); /* FIXME */
+ /* iput (hlink); / * FIXME */
}
Printk (("hlink2inode ret = %d %p -> %p\n", ret, hlink, *result));
kfree (path);
diff --git a/fs/umsdos/emd.c b/fs/umsdos/emd.c
index 8ba6571eb..6cb630b1c 100644
--- a/fs/umsdos/emd.c
+++ b/fs/umsdos/emd.c
@@ -52,9 +52,11 @@ void fill_new_filp (struct file *filp, struct dentry *dentry)
*
*/
-struct dentry *creat_dentry (const char *name, const int len, struct inode *inode)
+struct dentry *creat_dentry (const char *name, const int len, struct inode *inode, struct dentry *parent)
{
- struct dentry *ret, *parent=NULL; /* FIXME /mn/: whatis parent ?? */
+/* FIXME /mn/: parent is not passed many times... if it is not, dentry should be destroyed before someone else gets to use it */
+
+ struct dentry *ret;
struct qstr qname;
if (inode)
@@ -71,10 +73,10 @@ struct dentry *creat_dentry (const char *name, const int len, struct inode *inod
if (inode) d_add (ret, inode);
-/* ret->d_inode = inode; /mn/ FIXME this was old, replaced by d_add, delete this ! */
return ret;
}
+
/*
* removes temporary dentry created by creat_dentry
*
@@ -123,7 +125,7 @@ ssize_t umsdos_file_read_kmem (struct inode *emd_dir,
set_fs (KERNEL_DS);
old_dentry=filp->f_dentry; /* save it */
- filp->f_dentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, emd_dir);
+ filp->f_dentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, emd_dir, NULL);
*offs = filp->f_pos;
PRINTK ((KERN_DEBUG "umsdos_file_read_kmem /mn/: Checkin: filp=%p, buf=%p, size=%d, offs=%p\n", filp, buf, count, offs));
@@ -138,6 +140,7 @@ ssize_t umsdos_file_read_kmem (struct inode *emd_dir,
PRINTK ((KERN_DEBUG " f_version=%ld\n", filp->f_version));
PRINTK ((KERN_DEBUG " f_reada=%ld, f_ramax=%ld, f_raend=%ld, f_ralen=%ld, f_rawin=%ld\n", filp->f_reada, filp->f_ramax, filp->f_raend, filp->f_ralen, filp->f_rawin));
+ MSDOS_I(filp->f_dentry->d_inode)->i_binary=2;
ret = fat_file_read(filp,buf,count,offs);
PRINTK ((KERN_DEBUG "fat_file_read returned with %d!\n", ret));
@@ -195,21 +198,28 @@ ssize_t umsdos_file_write_kmem_real (struct file *filp,
set_fs (KERNEL_DS);
- Printk ((KERN_ERR "umsdos_file_write_kmem /mn/: Checkin: filp=%p, buf=%p, size=%d, offs=%p\n", filp, buf, count, offs));
- Printk ((KERN_ERR " struct dentry=%p\n", filp->f_dentry));
- Printk ((KERN_ERR " struct inode=%p\n", filp->f_dentry->d_inode));
- Printk ((KERN_ERR " inode=%lu, i_size=%lu\n", filp->f_dentry->d_inode->i_ino, filp->f_dentry->d_inode->i_size));
- Printk ((KERN_ERR " ofs=%ld\n",(unsigned long) *offs));
- Printk ((KERN_ERR " f_pos=%Lu\n", filp->f_pos));
- Printk ((KERN_ERR " name=%.*s\n", (int) filp->f_dentry->d_name.len, filp->f_dentry->d_name.name));
- Printk ((KERN_ERR " i_binary(sb)=%d\n", MSDOS_I(filp->f_dentry->d_inode)->i_binary ));
- Printk ((KERN_ERR " f_count=%d, f_flags=%d\n", filp->f_count, filp->f_flags));
- Printk ((KERN_ERR " f_owner=%d\n", filp->f_owner.uid));
- Printk ((KERN_ERR " f_version=%ld\n", filp->f_version));
- Printk ((KERN_ERR " f_reada=%ld, f_ramax=%ld, f_raend=%ld, f_ralen=%ld, f_rawin=%ld\n", filp->f_reada, filp->f_ramax, filp->f_raend, filp->f_ralen, filp->f_rawin));
-
+ Printk ((KERN_DEBUG "umsdos_file_write_kmem /mn/: Checkin: filp=%p, buf=%p, size=%d, offs=%p\n", filp, buf, count, offs));
+ Printk ((KERN_DEBUG " struct dentry=%p\n", filp->f_dentry));
+ Printk ((KERN_DEBUG " struct inode=%p\n", filp->f_dentry->d_inode));
+ Printk ((KERN_DEBUG " inode=%lu, i_size=%lu\n", filp->f_dentry->d_inode->i_ino, filp->f_dentry->d_inode->i_size));
+ Printk ((KERN_DEBUG " ofs=%ld\n",(unsigned long) *offs));
+ Printk ((KERN_DEBUG " f_pos=%Lu\n", filp->f_pos));
+ Printk ((KERN_DEBUG " name=%.*s\n", (int) filp->f_dentry->d_name.len, filp->f_dentry->d_name.name));
+ Printk ((KERN_DEBUG " i_binary(sb)=%d\n", MSDOS_I(filp->f_dentry->d_inode)->i_binary ));
+ Printk ((KERN_DEBUG " f_count=%d, f_flags=%d\n", filp->f_count, filp->f_flags));
+ Printk ((KERN_DEBUG " f_owner=%d\n", filp->f_owner.uid));
+ Printk ((KERN_DEBUG " f_version=%ld\n", filp->f_version));
+ Printk ((KERN_DEBUG " f_reada=%ld, f_ramax=%ld, f_raend=%ld, f_ralen=%ld, f_rawin=%ld\n", filp->f_reada, filp->f_ramax, filp->f_raend, filp->f_ralen, filp->f_rawin));
+
+ /* note: i_binary=2 is for CVF-FAT. We put it here, instead of
+ umsdos_file_write_kmem, since it is also wise not to compress symlinks
+ (in unlikely event that they are > 512 bytes and can be compressed
+ FIXME: should we set it when reading symlink too ? */
+
+ MSDOS_I(filp->f_dentry->d_inode)->i_binary=2;
+
ret = fat_file_write (filp, buf, count, offs);
- PRINTK ((KERN_ERR "fat_file_write returned with %ld!\n", ret));
+ PRINTK ((KERN_DEBUG "fat_file_write returned with %ld!\n", ret));
set_fs (old_fs);
return ret;
@@ -231,11 +241,11 @@ ssize_t umsdos_file_write_kmem (struct inode *emd_dir,
struct dentry *old_dentry;
- Printk ((KERN_ERR " STARTED WRITE_KMEM /mn/\n"));
- Printk ((KERN_ERR " using emd=%ld\n", emd_dir->i_ino));
+ Printk ((KERN_DEBUG " STARTED WRITE_KMEM /mn/\n"));
+ Printk ((KERN_DEBUG " using emd=%ld\n", emd_dir->i_ino));
old_dentry=filp->f_dentry; /* save it */
- filp->f_dentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, emd_dir);
+ filp->f_dentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, emd_dir, NULL);
*offs = filp->f_pos; /* FIXME, in read_kmem also: offs is not used so why pass it ?!!! /mn/ */
@@ -500,7 +510,7 @@ int umsdos_writeentry (
fill_new_filp (&filp, NULL);
Printk (("umsdos_writeentry /mn/: entering...\n"));
- emd_dentry=creat_dentry ("wremd_mn", 8, emd_dir);
+ emd_dentry=creat_dentry ("wremd_mn", 8, emd_dir, NULL);
if (free_entry){
/* #Specification: EMD file / empty entries
@@ -650,7 +660,7 @@ static int umsdos_find (
memset (&buf.filp, 0, sizeof (buf.filp));
- dentry = creat_dentry ("umsfind-mn", 10, emd_dir);
+ dentry = creat_dentry ("umsfind-mn", 10, emd_dir, NULL);
fill_new_filp (&buf.filp, dentry);
@@ -743,7 +753,7 @@ int umsdos_newentry (
ret = umsdos_writeentry(dir,emd_dir,info,0);
Printk (("umsdos_newentry EMD ret = %d\n",ret));
}
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
return ret;
}
@@ -760,7 +770,7 @@ int umsdos_newhidden (
umsdos_parse ("..LINK",6,info);
info->entry.name_len = 0;
ret = umsdos_find (dir,info,&emd_dir);
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
if (ret == -ENOENT || ret == 0){
/* #Specification: hard link / hidden name
When a hard link is created, the original file is renamed
@@ -799,7 +809,7 @@ int umsdos_delentry (
}
}
}
- iput(emd_dir);
+ /* iput(emd_dir); FIXME */
return ret;
}
@@ -824,7 +834,7 @@ int umsdos_isempty (struct inode *dir)
/* Find an empty slot */
memset (&filp, 0, sizeof (filp));
- dentry = creat_dentry ("isempty-mn", 10, dir);
+ dentry = creat_dentry ("isempty-mn", 10, dir, NULL);
filp.f_pos = 0;
filp.f_reada = 1;
@@ -843,7 +853,7 @@ int umsdos_isempty (struct inode *dir)
break;
}
}
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
}
return ret;
}
@@ -870,7 +880,7 @@ int umsdos_findentry (
}
}
}
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
Printk (("umsdos_findentry: returning %d\n", ret));
return ret;
}
diff --git a/fs/umsdos/file.c b/fs/umsdos/file.c
index 04a3320ec..b7f58a2b9 100644
--- a/fs/umsdos/file.c
+++ b/fs/umsdos/file.c
@@ -144,3 +144,38 @@ struct inode_operations umsdos_file_inode_operations_no_bmap = {
NULL, /* smap */
};
+/* For other with larger and unaligned file system with readpage */
+struct file_operations umsdos_file_operations_readpage = {
+ NULL, /* lseek - default */
+ UMSDOS_file_read, /* read */
+ UMSDOS_file_write, /* write */
+ NULL, /* readdir - bad */
+ NULL, /* poll - default */
+ NULL, /* ioctl - default */
+ generic_file_mmap, /* mmap */
+ NULL, /* no special open is needed */
+ NULL, /* release */
+ file_fsync /* fsync */
+};
+
+struct inode_operations umsdos_file_inode_operations_readpage = {
+ &umsdos_file_operations_readpage, /* default file operations */
+ NULL, /* create */
+ NULL, /* lookup */
+ NULL, /* link */
+ NULL, /* unlink */
+ NULL, /* symlink */
+ NULL, /* mkdir */
+ NULL, /* rmdir */
+ NULL, /* mknod */
+ NULL, /* rename */
+ NULL, /* readlink */
+ NULL, /* follow link */
+ fat_readpage, /* readpage */
+ NULL, /* writepage */
+ NULL, /* bmap */
+ UMSDOS_truncate, /* truncate */
+ NULL, /* permission */
+ NULL, /* smap */
+};
+
diff --git a/fs/umsdos/inode.c b/fs/umsdos/inode.c
index e8b65558c..0238a5bd1 100644
--- a/fs/umsdos/inode.c
+++ b/fs/umsdos/inode.c
@@ -125,7 +125,7 @@ void umsdos_set_dirinfo(
Printk (("umsdos_set_dirinfo: emd_owner is %lu for dir %lu\n", emd_owner->i_ino, dir->i_ino));
inode->u.umsdos_i.i_dir_owner = dir->i_ino;
inode->u.umsdos_i.i_emd_owner = emd_owner->i_ino;
- iput (emd_owner);
+ /* iput (emd_owner); FIXME */
inode->u.umsdos_i.pos = f_pos;
}
@@ -176,12 +176,22 @@ void umsdos_patch_inode (
if (!umsdos_isinit(inode)){
inode->u.umsdos_i.i_emd_dir = 0;
if (S_ISREG(inode->i_mode)){
- if (inode->i_op->bmap != NULL){
- Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations\n"));
- inode->i_op = &umsdos_file_inode_operations;
- }else{
- Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations_no_bmap\n"));
- inode->i_op = &umsdos_file_inode_operations_no_bmap;
+ if (MSDOS_SB(inode->i_sb)->cvf_format){
+ if (MSDOS_SB(inode->i_sb)->cvf_format->flags&CVF_USE_READPAGE){
+ Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations_readpage\n"));
+ inode->i_op = &umsdos_file_inode_operations_readpage;
+ }else{
+ Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations_no_bmap\n"));
+ inode->i_op = &umsdos_file_inode_operations_no_bmap;
+ }
+ }else{
+ if (inode->i_op->bmap != NULL){
+ Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations\n"));
+ inode->i_op = &umsdos_file_inode_operations;
+ }else{
+ Printk ((KERN_DEBUG "umsdos_patch_inode /mn/: seting i_op = umsdos_file_inode_operations_no_bmap\n"));
+ inode->i_op = &umsdos_file_inode_operations_no_bmap;
+ }
}
}else if (S_ISDIR(inode->i_mode)){
if (dir != NULL){
@@ -223,7 +233,7 @@ void umsdos_patch_inode (
struct inode *emd_owner;
Printk ((KERN_WARNING "umsdos_patch_inode: /mn/ Warning: untested emd_owner thingy...\n"));
emd_owner = umsdos_emd_dir_lookup(dir,1);
- iput (emd_owner);
+ /* iput (emd_owner); FIXME */
if (emd_owner->i_ino != inode->u.umsdos_i.i_emd_owner){
printk ("UMSDOS: *** EMD_OWNER ??? *** ino = %ld %ld <> %ld "
,inode->i_ino,emd_owner->i_ino,inode->u.umsdos_i.i_emd_owner);
@@ -323,7 +333,7 @@ int internal_notify_change(struct inode *inode, struct iattr *attr)
{
int ret = 0;
- Printk ((KERN_ERR "UMSDOS_notify_change: /mn/ completly untested\n"));
+ PRINTK ((KERN_DEBUG "UMSDOS_notify_change: entering\n"));
if ((ret = inode_change_ok(inode, attr)) != 0)
return ret;
@@ -366,7 +376,7 @@ int internal_notify_change(struct inode *inode, struct iattr *attr)
struct dentry *emd_dentry;
loff_t offs;
- emd_dentry = creat_dentry ("notify_emd", 10, emd_owner);
+ emd_dentry = creat_dentry ("notify_emd", 10, emd_owner, NULL);
fill_new_filp (&filp, emd_dentry);
filp.f_pos = inode->u.umsdos_i.pos;
@@ -403,7 +413,7 @@ int internal_notify_change(struct inode *inode, struct iattr *attr)
EMD file. The msdos fs is not even called.
*/
}
- iput (emd_owner);
+ /* iput (emd_owner); FIXME */
}
Printk (("\n"));
}
@@ -472,7 +482,7 @@ struct super_block *UMSDOS_read_super(
PRINTK ((KERN_DEBUG "UMSDOS /mn/: sb = %p\n",sb));
res = msdos_read_super(sb,data,silent);
PRINTK ((KERN_DEBUG "UMSDOS /mn/: res = %p\n",res));
- printk (KERN_INFO "UMSDOS dentry-WIP-Beta 0.82-2 (compatibility level %d.%d, fast msdos)\n", UMSDOS_VERSION, UMSDOS_RELEASE);
+ printk (KERN_INFO "UMSDOS dentry-WIP-Beta 0.82-3 (compatibility level %d.%d, fast msdos)\n", UMSDOS_VERSION, UMSDOS_RELEASE);
if (res == NULL) { MOD_DEC_USE_COUNT; return NULL; }
@@ -480,7 +490,7 @@ struct super_block *UMSDOS_read_super(
res->s_op = &umsdos_sops;
Printk ((KERN_DEBUG "umsdos /mn/: here goes the iget ROOT_INO\n"));
- pseudo = iget(res,UMSDOS_ROOT_INO);
+ pseudo = iget(res,UMSDOS_ROOT_INO);
Printk ((KERN_DEBUG "umsdos_read_super %p\n",pseudo));
umsdos_setup_dir_inode (pseudo);
@@ -521,8 +531,8 @@ struct super_block *UMSDOS_read_super(
*/
struct dentry *root, *etc, *etc_rc, *init, *sbin;
- root = creat_dentry (UMSDOS_PSDROOT_NAME, strlen(UMSDOS_PSDROOT_NAME), NULL);
- sbin = creat_dentry ("sbin", 4, NULL);
+ root = creat_dentry (UMSDOS_PSDROOT_NAME, strlen(UMSDOS_PSDROOT_NAME), NULL, NULL);
+ sbin = creat_dentry ("sbin", 4, NULL, NULL);
Printk ((KERN_DEBUG "Mounting root\n"));
if (umsdos_real_lookup (pseudo,root)==0
@@ -531,7 +541,7 @@ struct super_block *UMSDOS_read_super(
int pseudo_ok = 0;
Printk ((KERN_DEBUG "/%s is there\n",UMSDOS_PSDROOT_NAME));
- etc = creat_dentry ("etc", 3, NULL);
+ etc = creat_dentry ("etc", 3, NULL, NULL);
/* if (umsdos_real_lookup (pseudo,"etc",3,etc)==0 */
@@ -540,8 +550,8 @@ struct super_block *UMSDOS_read_super(
Printk ((KERN_DEBUG "/%s/etc is there\n",UMSDOS_PSDROOT_NAME));
- init = creat_dentry ("init", 4, NULL);
- etc_rc = creat_dentry ("rc", 2, NULL);
+ init = creat_dentry ("init", 4, NULL, NULL);
+ etc_rc = creat_dentry ("rc", 2, NULL, NULL);
/* if ((umsdos_real_lookup (etc,"init",4,init)==0*/
if((umsdos_real_lookup(pseudo, init) == 0
@@ -585,7 +595,7 @@ struct super_block *UMSDOS_read_super(
Printk ((KERN_WARNING "umsdos_read_super /mn/: Pseudo should be iput-ed here...\n"));
- iput (pseudo); /* FIXME */
+ /* iput (pseudo); / * FIXME */
}
#endif /* disabled */
diff --git a/fs/umsdos/ioctl.c b/fs/umsdos/ioctl.c
index 7b92c49a4..b3f11ee32 100644
--- a/fs/umsdos/ioctl.c
+++ b/fs/umsdos/ioctl.c
@@ -60,6 +60,21 @@ int UMSDOS_ioctl_dir (
{
int ret = -EPERM;
int err;
+
+ /* forward non-umsdos ioctls - this hopefully doesn't cause conflicts */
+ if(cmd!=UMSDOS_GETVERSION
+ &&cmd!=UMSDOS_READDIR_DOS
+ &&cmd!=UMSDOS_READDIR_EMD
+ &&cmd!=UMSDOS_INIT_EMD
+ &&cmd!=UMSDOS_CREAT_EMD
+ &&cmd!=UMSDOS_RENAME_DOS
+ &&cmd!=UMSDOS_UNLINK_EMD
+ &&cmd!=UMSDOS_UNLINK_DOS
+ &&cmd!=UMSDOS_RMDIR_DOS
+ &&cmd!=UMSDOS_STAT_DOS
+ &&cmd!=UMSDOS_DOS_SETUP)
+ return fat_dir_ioctl(dir,filp,cmd,data);
+
/* #Specification: ioctl / acces
Only root (effective id) is allowed to do IOCTL on directory
in UMSDOS. EPERM is returned for other user.
@@ -162,7 +177,7 @@ int UMSDOS_ioctl_dir (
}
}
}
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
}else{
/* The absence of the EMD is simply seen as an EOF */
ret = 0;
@@ -182,7 +197,7 @@ int UMSDOS_ioctl_dir (
extern struct inode_operations umsdos_rdir_inode_operations;
struct inode *emd_dir = umsdos_emd_dir_lookup (dir,1);
ret = emd_dir != NULL;
- iput (emd_dir);
+ /* iput (emd_dir); FIXME */
dir->i_op = ret
? &umsdos_dir_inode_operations
@@ -225,8 +240,8 @@ int UMSDOS_ioctl_dir (
,dir
,data.umsdos_dirent.name,data.umsdos_dirent.name_len);
*/
- old_dentry = creat_dentry (data.dos_dirent.d_name, data.dos_dirent.d_reclen, NULL);
- new_dentry = creat_dentry (data.umsdos_dirent.name, data.umsdos_dirent.name_len, NULL);
+ old_dentry = creat_dentry (data.dos_dirent.d_name, data.dos_dirent.d_reclen, NULL, NULL); /* FIXME: prolly should fill inode part */
+ new_dentry = creat_dentry (data.umsdos_dirent.name, data.umsdos_dirent.name_len, NULL, NULL);
ret = msdos_rename(dir,old_dentry,dir,new_dentry);
}else if (cmd == UMSDOS_UNLINK_EMD){
/* #Specification: ioctl / UMSDOS_UNLINK_EMD
@@ -297,7 +312,7 @@ int UMSDOS_ioctl_dir (
data.stat.st_ctime = inode->i_ctime;
data.stat.st_mtime = inode->i_mtime;
copy_to_user (&idata->stat,&data.stat,sizeof(data.stat));
- iput (inode);
+ /* iput (inode); FIXME */
}
}else if (cmd == UMSDOS_DOS_SETUP){
/* #Specification: ioctl / UMSDOS_DOS_SETUP
diff --git a/fs/umsdos/namei.c b/fs/umsdos/namei.c
index dcea137fe..be72a9cb4 100644
--- a/fs/umsdos/namei.c
+++ b/fs/umsdos/namei.c
@@ -216,6 +216,7 @@ static int umsdos_create_any (
{
int ret;
+ struct dentry *fake;
Printk (("umsdos_create_any /mn/: create %.*s in dir=%lu - nevercreat=/", (int) dentry->d_name.len, dentry->d_name.name, dir->i_ino));
ret = umsdos_nevercreat(dir,dentry,-EEXIST);
@@ -238,17 +239,16 @@ static int umsdos_create_any (
ret = umsdos_newentry (dir,&info);
if (ret == 0){
dir->i_count++;
- /* FIXME
- ret = msdos_create (dir,info.fake.fname,info.fake.len
- ,S_IFREG|0777,result);
- */
- ret =msdos_create(dir,dentry,S_IFREG|0777);
+ fake = creat_dentry (info.fake.fname, info.fake.len, NULL, dentry->d_parent); /* create short name dentry */
+ ret = msdos_create (dir, fake, S_IFREG|0777);
if (ret == 0){
- struct inode *inode = dentry->d_inode;
+ struct inode *inode = fake->d_inode;
umsdos_lookup_patch (dir,inode,&info.entry,info.f_pos);
Printk (("inode %p[%lu], count=%d ",inode, inode->i_ino, inode->i_count));
Printk (("Creation OK: [dir %lu] %.*s pid=%d pos %ld\n", dir->i_ino,
info.fake.len, info.fake.fname, current->pid, info.f_pos));
+
+ d_instantiate(dentry, inode); /* long name also gets inode info */
}else{
/* #Specification: create / file exist in DOS
Here is a situation. Trying to create a file with
@@ -367,8 +367,8 @@ static int umsdos_rename_f(
PRINTK (("ret %d %d ",ret,new_info.fake.len));
if (ret == 0){
struct dentry *old, *new;
- old = creat_dentry (old_info.fake.fname, old_info.fake.len, NULL);
- new = creat_dentry (new_info.fake.fname, new_info.fake.len, NULL);
+ old = creat_dentry (old_info.fake.fname, old_info.fake.len, NULL, NULL);
+ new = creat_dentry (new_info.fake.fname, new_info.fake.len, NULL, NULL);
PRINTK (("msdos_rename "));
old_dir->i_count++;
@@ -471,7 +471,7 @@ static int umsdos_symlink_x(
fill_new_filp (&filp, dentry);
/* Make the inode acceptable to MSDOS FIXME */
- Printk ((KERN_ERR "umsdos_symlink_x: FIXME /mn/ Here goes the crash.. known wrong code...\n"));
+ Printk ((KERN_WARNING "umsdos_symlink_x: /mn/ Is this ok?\n"));
Printk ((KERN_WARNING " symname=%s ; dentry name=%.*s (ino=%lu)\n", symname, (int) dentry->d_name.len, dentry->d_name.name, dentry->d_inode->i_ino));
ret = umsdos_file_write_kmem_real (&filp, symname, len, &myofs);
/* dput(dentry); ?? where did this come from FIXME */
@@ -489,7 +489,7 @@ static int umsdos_symlink_x(
dir = NULL;
}
}
- d_instantiate(dentry,dir);
+ /* d_instantiate(dentry,dir); //already done in umsdos_create_any */
Printk (("\n"));
return ret;
}
@@ -634,7 +634,7 @@ int UMSDOS_link (
ret = -ENOMEM;
}else{
struct dentry *temp;
- temp = creat_dentry (entry.name, entry.name_len, NULL);
+ temp = creat_dentry (entry.name, entry.name_len, NULL, NULL);
Printk (("olddir[%d] ",olddir->i_count));
ret = umsdos_locate_path (oldinode,path);
Printk (("olddir[%d] ",olddir->i_count));
@@ -673,7 +673,7 @@ int UMSDOS_link (
umsdos_unlockcreate(olddir);
umsdos_unlockcreate(dir);
}
- iput (olddir);
+ /* iput (olddir); FIXME */
}
if (ret == 0){
struct iattr newattrs;
@@ -681,8 +681,10 @@ int UMSDOS_link (
newattrs.ia_valid = 0;
ret = UMSDOS_notify_change(olddentry, &newattrs);
}
- dput (olddentry);
- dput (dentry);
+
+/* dput (olddentry);
+ dput (dentry); FIXME.... */
+
Printk (("umsdos_link %d\n",ret));
return ret;
}
@@ -735,10 +737,12 @@ int UMSDOS_mkdir(
ret = umsdos_newentry (dir,&info);
Printk (("newentry %d ",ret));
if (ret == 0){
- struct dentry *temp;
- temp = creat_dentry (info.fake.fname, info.fake.len, NULL);
+ struct dentry *temp, *tdir;
+ tdir = creat_dentry ("mkd-dir", 7, dir, NULL);
+ temp = creat_dentry (info.fake.fname, info.fake.len, NULL, tdir);
dir->i_count++;
ret = msdos_mkdir (dir, temp, mode);
+
if (ret != 0){
umsdos_delentry (dir,&info,1);
/* #Specification: mkdir / Directory already exist in DOS
@@ -756,17 +760,22 @@ int UMSDOS_mkdir(
ret = compat_umsdos_real_lookup (dir,info.fake.fname,
info.fake.len,&subdir);
if (ret == 0){
-/* struct inode *result; FIXME /mn/ hmmm what is this supposed to be ? */
- struct dentry *tdentry;
- tdentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL);
-
- ret = msdos_create (subdir, tdentry,S_IFREG|0777);
+ struct dentry *tdentry, *tdsub;
+ tdsub = creat_dentry ("mkd-emd", 7, subdir, NULL);
+ tdentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL, tdsub);
+ ret = msdos_create (subdir, tdentry, S_IFREG|0777);
+ kill_dentry (tdentry); /* we don't want empty EMD file to be visible ! too bad kill_dentry does nothing at the moment :-) FIXME */
+ kill_dentry (tdsub);
+ umsdos_setup_dir_inode (subdir); /* this should setup dir so it is promoted to EMD, and EMD file is not visible inside it */
subdir = NULL;
+ d_instantiate(dentry, temp->d_inode);
/* iput (result); FIXME */
}
if (ret < 0){
printk ("UMSDOS: Can't create empty --linux-.---\n");
}
+
+
/* iput (subdir); FIXME */
}
}
@@ -774,7 +783,7 @@ int UMSDOS_mkdir(
}
}
Printk (("umsdos_mkdir %d\n",ret));
-/* dput (dentry); FIXME /mn/ */
+ /* dput (dentry); / * FIXME /mn/ */
return ret;
}
@@ -803,7 +812,7 @@ int UMSDOS_mknod(
*/
int ret = umsdos_create_any (dir,dentry,mode,rdev,0);
-/* dput(dentry); /mn/ FIXME! */
+ /* dput(dentry); / * /mn/ FIXME! */
return ret;
}
@@ -902,7 +911,9 @@ int UMSDOS_rmdir(
as possible.
*/
- int ret = umsdos_nevercreat(dir,dentry,-EPERM);
+ int ret;
+
+ ret = umsdos_nevercreat(dir,dentry,-EPERM);
if (ret == 0){
volatile struct inode *sdir;
dir->i_count++;
@@ -913,18 +924,22 @@ int UMSDOS_rmdir(
int empty;
umsdos_lockcreate(dir);
if (sdir->i_count > 1){
+ Printk ((" /mn/ rmdir: FIXME EBUSY: hmmm, i_count is %d > 1\n", sdir->i_count));
ret = -EBUSY;
}else if ((empty = umsdos_isempty (sdir)) != 0){
- struct dentry *tdentry;
- tdentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL);
+ struct dentry *tdentry, *tedir;
+ tedir = creat_dentry ("emd-rmd", 7, dir, NULL);
+ tdentry = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL, tedir);
+ umsdos_real_lookup (dir, tdentry); /* fill inode part */
Printk (("isempty %d i_count %d ",empty,sdir->i_count));
/* check sticky bit */
if ( !(dir->i_mode & S_ISVTX) || fsuser() ||
current->fsuid == sdir->i_uid ||
current->fsuid == dir->i_uid ) {
if (empty == 1){
- /* We have to removed the EMD file */
+ /* We have to remove the EMD file */
ret = msdos_unlink (sdir, tdentry);
+ Printk (("UMSDOS_rmdir: unlinking empty EMD ret=%d", ret));
sdir = NULL;
}
/* sdir must be free before msdos_rmdir() */
@@ -933,17 +948,34 @@ int UMSDOS_rmdir(
Printk (("isempty ret %d nlink %d ",ret,dir->i_nlink));
if (ret == 0){
struct umsdos_info info;
- struct dentry *temp;
+ struct dentry *temp, *tdir;
dir->i_count++;
umsdos_parse (dentry->d_name.name,dentry->d_name.len,&info);
/* The findentry is there only to complete */
/* the mangling */
umsdos_findentry (dir,&info,2);
- temp = creat_dentry (info.fake.fname, info.fake.len, NULL);
-
+
+ tdir = creat_dentry ("dir-rmd", 7, dir, NULL);
+ temp = creat_dentry (info.fake.fname, info.fake.len, NULL, tdir);
+ umsdos_real_lookup (dir, temp); /* fill inode part */
+
+ Printk ((KERN_ERR " rmdir start dir=%lu, dir->sb=%p\n", dir->i_ino, dir->i_sb)); /* FIXME: /mn/ debug only */
+ Printk ((KERN_ERR " dentry=%.*s d_count=%d ino=%lu\n", (int) temp->d_name.len, temp->d_name.name, temp->d_count, temp->d_inode->i_ino));
+ Printk ((KERN_ERR " d_parent=%.*s d_count=%d ino=%lu\n", (int) temp->d_parent->d_name.len, temp->d_parent->d_name.name, temp->d_parent->d_count, temp->d_parent->d_inode->i_ino));
+
ret = msdos_rmdir (dir, temp);
+
+ Printk ((KERN_ERR " rmdir passed %d\n", ret)); /* FIXME: /mn/ debug only */
+ Printk ((KERN_ERR " rmdir end dir=%lu, dir->sb=%p\n", dir->i_ino, dir->i_sb));
+ Printk ((KERN_ERR " dentry=%.*s d_count=%d ino=%p\n", (int) temp->d_name.len, temp->d_name.name, temp->d_count, temp->d_inode));
+ Printk ((KERN_ERR " d_parent=%.*s d_count=%d ino=%lu\n", (int) temp->d_parent->d_name.len, temp->d_parent->d_name.name, temp->d_parent->d_count, temp->d_parent->d_inode->i_ino));
+
+ kill_dentry (tdir);
+ kill_dentry (temp);
+
if (ret == 0){
ret = umsdos_delentry (dir,&info,1);
+ d_delete (dentry);
}
}
}else{
@@ -961,7 +993,7 @@ int UMSDOS_rmdir(
umsdos_unlockcreate(dir);
}
}
- dput(dentry);
+ /* dput(dentry); FIXME /mn/ */
Printk (("umsdos_rmdir %d\n",ret));
return ret;
}
@@ -1036,13 +1068,21 @@ int UMSDOS_unlink (
if (ret == 0){
ret = umsdos_delentry (dir,&info,0);
if (ret == 0){
- struct dentry *temp;
+ struct dentry *temp, *tdir;
Printk (("Avant msdos_unlink %.*s ",info.fake.len,info.fake.fname));
- dir->i_count++;
- temp = creat_dentry (info.fake.fname, info.fake.len, NULL);
+ dir->i_count++; /* FIXME /mn/ is this needed anymore now that msdos_unlink locks dir using d_parent ? */
+ tdir = creat_dentry ("dir-del", 7, dir, NULL); /* FIXME /mn/: do we need iget(dir->i_ino) or would dir itself suffice ? */
+ temp = creat_dentry (info.fake.fname, info.fake.len, NULL, tdir);
+ umsdos_real_lookup (dir, temp); /* fill inode part */
+
ret = msdos_unlink_umsdos (dir, temp);
Printk (("msdos_unlink %.*s %o ret %d ",info.fake.len,info.fake.fname
,info.entry.mode,ret));
+
+ d_delete (dentry);
+
+ kill_dentry (tdir);
+ kill_dentry (temp);
}
}
}else{
@@ -1054,7 +1094,7 @@ int UMSDOS_unlink (
umsdos_unlockcreate(dir);
}
}
- dput(dentry);
+ /* dput(dentry); FIXME: shouldn't this be done in msdos_unlink ? */
Printk (("umsdos_unlink %d\n",ret));
return ret;
}
@@ -1140,8 +1180,9 @@ int UMSDOS_rename(
}
}
}
+ /*
dput (new_dentry);
- dput (old_dentry);
+ dput (old_dentry); FIXME /mn/ */
return ret;
}
diff --git a/fs/umsdos/rdir.c b/fs/umsdos/rdir.c
index 7cd50e133..612002c3b 100644
--- a/fs/umsdos/rdir.c
+++ b/fs/umsdos/rdir.c
@@ -135,7 +135,7 @@ int umsdos_rlookup_x(
*/
Printk ((KERN_WARNING "umsdos_rlookup_x: do the pseudo-thingy...\n"));
ret = -ENOENT;
- iput (pseudo_root);
+ /* iput (pseudo_root); FIXME */
}else if (S_ISDIR(inode->i_mode)){
/* We must place the proper function table */
@@ -145,7 +145,7 @@ int umsdos_rlookup_x(
}
}
}
- iput (dir);
+ /* iput (dir); FIXME */
PRINTK ((KERN_DEBUG "umsdos_rlookup_x: returning %d\n", ret));
return ret;
}
@@ -215,7 +215,7 @@ static int UMSDOS_rrmdir (
}else if (empty == 1){
/* We have to removed the EMD file */
struct dentry *temp;
- temp = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL);
+ temp = creat_dentry (UMSDOS_EMD_FILE, UMSDOS_EMD_NAMELEN, NULL, NULL); /* FIXME: prolly should fill inode part ? */
ret = msdos_unlink(sdir, temp);
sdir = NULL;
if (ret == 0){
@@ -226,12 +226,12 @@ static int UMSDOS_rrmdir (
}else{
ret = -ENOTEMPTY;
}
- iput (sdir);
+ /* iput (sdir); FIXME */
}
}
umsdos_unlockcreate (dir);
}
- iput (dir);
+ /* iput (dir); FIXME */
return ret;
}