Messages in this thread Patch in this message | | | Date | Tue, 6 Jan 1998 13:35:48 -0800 (PST) | From | Trevor Johnson <> | Subject | Re: patch against 2.1.78-pre3: HFS, Minix, sound, and SMP warnings and, compilation errors |
| |
a sun: > /usr/sys/linux/include/linux/hfs_fs.h: In function `hfs_drop_special': > In file included from filesystems.c:28: > /usr/sys/linux/include/linux/hfs_fs.h:345: dereferencing pointer to > incomplete type > /usr/sys/linux/include/linux/hfs_fs.h:345: dereferencing pointer to > incomplete type > > erk. that's what i get for not realizing that hfs_fs.h can get > referenced without including hfs.h. in any case, you can move all of > those inline hfs_drop_*'s into hfs.h instead, and it should fix your > problem.
I tried following your suggestion but still got some errors (below). After I moved the hfs_lookup_dentry stuff too, they went away. I haven't tested this yet, because it hasn't finished compiling. I've attached a patch.
hfs.h: In function `hfs_drop_special': In file included from dir_cap.c:25: hfs.h:497: warning: implicit declaration of function `hfs_lookup_dentry' hfs.h:497: warning: assignment makes pointer from integer without a cast hfs.h:500: warning: assignment makes pointer from integer without a cast /usr/sys/linux/include/linux/hfs_fs.h: At top level: In file included from dir_cap.c:28: /usr/sys/linux/include/linux/hfs_fs.h:328: warning: type mismatch with previous implicit declaration hfs.h:497: warning: previous implicit declaration of `hfs_lookup_dentry' /usr/sys/linux/include/linux/hfs_fs.h:328: warning: `hfs_lookup_dentry' was previously implicitly declared to return `int' /usr/sys/linux/include/linux/hfs_fs.h:328: warning: `hfs_lookup_dentry' was declared implicitly `extern' and later `static' hfs.h: In function `hfs_cap_drop_dentry': hfs.h:497: conflicting types for `hfs_lookup_dentry' /usr/sys/linux/include/linux/hfs_fs.h:328: previous declaration of `hfs_lookup_dentry' dir_cap.c:382: warning: assignment makes pointer from integer without a cast ___ Trevor Johnson diff -ru linux-2.1.78-dist/fs/hfs/hfs.h linux/fs/hfs/hfs.h --- linux-2.1.78-dist/fs/hfs/hfs.h Tue Jan 6 13:28:10 1998 +++ linux/fs/hfs/hfs.h Tue Jan 6 13:13:42 1998 @@ -487,4 +487,38 @@ /* sysdep.c */ extern int hfs_prune_entry(struct hfs_cat_entry *); +static __inline__ struct dentry +*hfs_lookup_dentry(const char *name, const int len, + struct dentry *base) +{ + struct qstr this; + + this.name = name; + this.len = len; + this.hash = full_name_hash(name, len); + + return d_lookup(base, &this); +} + +/* drop a dentry for one of the special subdirectories */ +static __inline__ void hfs_drop_special(const struct hfs_name *name, + struct dentry *base, + struct dentry *dentry) +{ + struct dentry *dparent, *de; + + dparent = hfs_lookup_dentry(name->Name, name->Len, base); + if (dparent) { + de = hfs_lookup_dentry(dentry->d_name.name, dentry->d_name.len, + dparent); + dput(dparent); + + if (de) { + if (!de->d_inode) + d_drop(de); + dput(de); + } + } +} + #endif --- linux-2.1.78-dist/include/linux/hfs_fs.h Tue Jan 6 13:28:27 1998 +++ linux/include/linux/hfs_fs.h Tue Jan 6 13:13:51 1998 @@ -322,41 +322,6 @@ return len; } -static __inline__ struct dentry -*hfs_lookup_dentry(const char *name, const int len, - struct dentry *base) -{ - struct qstr this; - - this.name = name; - this.len = len; - this.hash = full_name_hash(name, len); - - return d_lookup(base, &this); -} - -/* drop a dentry for one of the special subdirectories */ -static __inline__ void hfs_drop_special(const struct hfs_name *name, - struct dentry *base, - struct dentry *dentry) -{ - struct dentry *dparent, *de; - - dparent = hfs_lookup_dentry(name->Name, name->Len, base); - if (dparent) { - de = hfs_lookup_dentry(dentry->d_name.name, dentry->d_name.len, - dparent); - dput(dparent); - - if (de) { - if (!de->d_inode) - d_drop(de); - dput(de); - } - } -} - #endif #endif /* __KERNEL__ */ - #endif | |