linux-2.5.18: fs/hfs/inode.c: PATCH to fix compilation error

linux-2.5.18: fs/hfs/inode.c: PATCH to fix compilation error

Post by Steven Augar » Fri, 31 May 2002 10:40:08

Subject: Patch to fix compilation error in linux-2.5.18/fs/hfs/inode.c

This patch fixes a compilation error in linux-2.5.18/fs/hfs/inode.c,
where gcc 2.95.3 complains that it does not have a complete definition
for `struct page' in hfs_prepare_write().   The exact error message
given is:

  inode.c: In function `hfs_prepare_write':
  inode.c:242: dereferencing pointer to incomplete type

To give credit where due, after I fixed this bug I found that
suggested fixes have also been sent in by

The compilation problem has already been reported by Brad Littlejohn

Steven Augart

diff -ur linux-2.5.18/fs/hfs/inode.c linux-2.5.18+/fs/hfs/inode.c
--- linux-2.5.18/fs/hfs/inode.c Thu May  9 15:24:20 2002

 #include <linux/hfs_fs_i.h>
 #include <linux/hfs_fs.h>
 #include <linux/smp_lock.h>
+#include <linux/mm.h>          /* for struct page */

 /*================ Variable-like macros ================*/

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at
Please read the FAQ at


1. fs/inode.c sync fix and fs/ext2/inode.c tidy

These patches can be pulled from bk://
First one: in fs/ext2/inode.c merge ext2_fsync_inode into ext2_sync_file
as that's the only place it can be called from.

Second one only touches fs/inode.c:sync_one to replace the if I_LOCK
check with a while.  Basically, the inode sync could end up deferring
to writeback if the inode is already locked.  This breaks things like
O_SYNC which assume the inode sync is synchronous and only returns
when the data is safely on disk.  This patch will need to go into 2.4
after a bit of testing for unexpected interactions.

Patches are included below for reading.

"A man with a bass just walked in,
 and he's putting it down
 on the floor."

diff -Nru a/fs/ext2/ext2.h b/fs/ext2/ext2.h
--- a/fs/ext2/ext2.h    Thu Mar  7 16:02:59 2002

 /* fsync.c */
 extern int ext2_sync_file (struct file *, struct dentry *, int);
-extern int ext2_fsync_inode (struct inode *, int);

 /* ialloc.c */
 extern struct inode * ext2_new_inode (struct inode *, int);
diff -Nru a/fs/ext2/fsync.c b/fs/ext2/fsync.c
--- a/fs/ext2/fsync.c   Thu Mar  7 16:02:59 2002

 int ext2_sync_file(struct file * file, struct dentry *dentry, int datasync)
        struct inode *inode = dentry->d_inode;
-       return ext2_fsync_inode(inode, datasync);
-int ext2_fsync_inode(struct inode *inode, int datasync)
        int err;

        err  = fsync_inode_buffers(inode);

diff -Nru a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c        Thu Mar  7 16:02:59 2002

 static inline void sync_one(struct inode *inode, int sync)
-       if (inode->i_state & I_LOCK) {
+       while (inode->i_state & I_LOCK) {
-       } else {
-               __sync_one(inode, sync);
+       __sync_one(inode, sync);

 static inline void sync_list(struct list_head *head)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at
Please read the FAQ at

2. Annoying advertising


4. Please Help - Windows XP/Linux

5. linux-2.5.18: DRM + cmpxchg issues

6. D-Link Networkcard DEF 530TX

7. Linux-2.5.18

8. PLIP <-> Winsock Help

9. Fix compile error in fs/cramfs/inode.c in 2.5.66

10. 2.5.44 fix compilation errors in the AFS fs

11. Running out of ptys with Expect 5.18 and Linux 1.2.13

12. Fortran and Linux, gcc-2.7.2 and g77-0.5.18

13. Patch?: linux-2.5.45/net/ipv4/netfilter dst.pmtu compilation fixes