Re: [PATCH] VFAT fixes.

Alexander Viro (viro@math.psu.edu)
Fri, 15 Jan 1999 03:17:02 -0500 (EST)


On Thu, 14 Jan 1999, Linus Torvalds wrote:

> I've put a pre-8 in "testing" on ftp.kernel.org if you'd care to look: it
> does "lock_parent()" differently, and while I applied your vfat-specific
> parts I didn't apply the other parts because they should be a non-issue
> with pre-8 anyway (but you should verify your use of "d_move()", ok?)

Gee, first time in several weeks I *could* get to ftp.kernel.org ;-)
OK, here it comes. I've turned d_add into d_rehash, moved d_add into
dcache.h and added the call into vfat_rename().
ObChanges in lock_parent(): we'ld better move the calls of
check_parent() into vfs_* ones; otherwise we are breaking knfsd.
I didn't fix the bug related to 0xe5 and friends (one that I
missed and Albert spotted). Question: WTF DOS does with the names
starting from 0xf6? Somebody? BTW, looks like we have some mess in
fat_readdirx() related to that.
Cheers,
Al

--- linux/fs/vfat/namei.c.old Fri Jan 15 02:46:34 1999
+++ linux/fs/vfat/namei.c Fri Jan 15 03:02:38 1999
@@ -1726,6 +1726,13 @@
}

if (res >= 0) {
+ if (new_inode) {
+ /* probably we should do it only for directories,
+ * but that would require lambda-expanding the
+ * call of vfat_unlink(). FIXME.
+ */
+ d_rehash(new_dentry);
+ }
d_move(old_dentry, new_dentry);
res = 0;
}
--- linux/fs/dcache.c.old Fri Jan 15 02:52:32 1999
+++ linux/fs/dcache.c Fri Jan 15 02:54:07 1999
@@ -677,12 +677,11 @@
d_drop(dentry);
}

-void d_add(struct dentry * entry, struct inode * inode)
+void d_rehash(struct dentry * entry)
{
struct dentry * parent = entry->d_parent;

list_add(&entry->d_hash, d_hash(parent, entry->d_name.hash));
- d_instantiate(entry, inode);
}

#define do_switch(x,y) do { \
--- linux/kernel/ksyms.c.old Fri Jan 15 02:54:45 1999
+++ linux/kernel/ksyms.c Fri Jan 15 02:55:00 1999
@@ -121,7 +121,7 @@
EXPORT_SYMBOL(d_alloc_root);
EXPORT_SYMBOL(d_delete);
EXPORT_SYMBOL(d_validate);
-EXPORT_SYMBOL(d_add);
+EXPORT_SYMBOL(d_rehash);
EXPORT_SYMBOL(d_move);
EXPORT_SYMBOL(d_instantiate);
EXPORT_SYMBOL(d_alloc);
--- linux/include/linux/dcache.h.old Fri Jan 15 02:55:11 1999
+++ linux/include/linux/dcache.h Fri Jan 15 02:58:05 1999
@@ -150,10 +150,18 @@
extern int is_root_busy(struct dentry *);

/*
+ * This adds the entry to the hash queues.
+ */
+extern void d_rehash(struct dentry * entry);
+/*
* This adds the entry to the hash queues and initializes "d_inode".
* The entry was actually filled in earlier during "d_alloc()"
*/
-extern void d_add(struct dentry * entry, struct inode * inode);
+static __inline__ d_add(struct dentry * entry, struct inode * inode);
+{
+ d_rehash(entry);
+ d_instantiate(entry, inode);
+}

/* used for rename() and baskets */
extern void d_move(struct dentry * entry, struct dentry * newdentry);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/