On Mon, Aug 25, 2003 at 11:25:09AM -0500, Russell Cattelan wrote: > On Mon, 2003-08-25 at 10:50, Axel Thimm wrote: > > On Sun, Aug 24, 2003 at 11:27:05AM -0500, Eric Sandeen wrote: > > > On Sun, 24 Aug 2003, Kai Leibrandt wrote: > > > > Also, is there a howto or readme somewhere where I can find > > > > out how to build my own .src.rpm kernel packages from the > > > > redhat errata and the XFS patches? > > > > > > No docs... best documentation is probably the spec file itself. > > > Which xfs patches, and which Red Hat kernel packages, do you > > > want to combine? > > > > I played a bit with rawhide (which is still the same as severn's, > > I think). Other than the _nolock patch the rest looked trivial. I > > haven't got a complete build yet, but it looked quite promising > > (I'm on vacation, so it will take me some time). Whoever cares to > > look at the current bits can contact me in private. > Try using this change from the 2.4.22 tree > http://xfs.org:8090/linux-2.4+xfs/diffs/fs/xfs/linux/xfs_lrw.c@1.167?nav=index.html|src/|src/fs|src/fs/xfs|src/fs/xfs/linux|hist/fs/xfs/linux/xfs_lrw.c Thanks, I'll look into it. > I think the RH beta tree has do_generic_file_write at this point so > you should be able to call it directly and drop the whole _nolock > change all together. The old patch was doing more (or less) than the new do_generic_* stuff, e.g. it also did not call invalidate_inode_pages2. Have a look at the rewritten _nolock patch I ended up for the rawhide kernel & XFS 1.3.0. Is this still needed or not? > You might need to export do_generic_file_write ... can't remember > off hand. They are already exported. :) > > I was told to better skip 1.3.0 and go straight for the CVS bits > > for 2.4.22, but I wouldn't like to desync from the XFS release > > points. -- Axel.Thimm@physik.fu-berlin.de
--- linux-2.4.21/include/linux/fs.h.org 2003-08-22 16:46:25.000000000 +0200
+++ linux-2.4.21/include/linux/fs.h 2003-08-22 16:55:50.000000000 +0200
@@ -1520,6 +1520,7 @@
extern int precheck_file_write(struct file *, struct inode *, size_t *, loff_t *);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t do_generic_file_write(struct file *, const char *, size_t, loff_t *);
+extern ssize_t generic_file_write_nolock(struct file *, const char *, size_t, loff_t *);
extern void do_generic_file_read(struct file *, loff_t *, read_descriptor_t *, read_actor_t);
extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
--- linux-2.4.21/mm/filemap.c.org 2003-08-22 16:46:26.000000000 +0200
+++ linux-2.4.21/mm/filemap.c 2003-08-22 17:26:13.000000000 +0200
@@ -3266,7 +3266,7 @@
}
ssize_t
-do_generic_direct_write(struct file *file,const char *buf,size_t count, loff_t *ppos)
+do_generic_direct_write_noinvalidate(struct file *file,const char *buf,size_t count, loff_t *ppos)
{
struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
struct inode *inode = mapping->host;
@@ -3297,7 +3297,6 @@
mark_inode_dirty(inode);
}
*ppos = end;
- invalidate_inode_pages2(mapping);
}
/*
* Sync the fs metadata but not the minor inode changes and
@@ -3311,6 +3310,19 @@
return err;
}
+ssize_t
+do_generic_direct_write(struct file *file,const char *buf,size_t count, loff_t *ppos)
+{
+ int err;
+
+ err = do_generic_direct_write_noinvalidate(file, buf, count, ppos);
+
+ if (err > 0)
+ invalidate_inode_pages2(file->f_dentry->d_inode->i_mapping);
+
+ return err;
+}
+
static int do_odirect_fallback(struct file *file, struct inode *inode,
const char *buf, size_t count, loff_t *ppos)
{
@@ -3328,6 +3340,23 @@
}
ssize_t
+generic_file_write_nolock(struct file *file,const char *buf,size_t count, loff_t *ppos)
+{
+ struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
+ int err;
+
+ if (file->f_flags & O_DIRECT) {
+ err = do_generic_direct_write_noinvalidate(file, buf, count, ppos);
+ if (unlikely(err == -ENOTBLK))
+ err = do_odirect_fallback(file, inode, buf, count, ppos);
+ } else {
+ err = do_generic_file_write(file, buf, count, ppos);
+ }
+
+ return err;
+}
+
+ssize_t
generic_file_write(struct file *file,const char *buf,size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode->i_mapping->host;
Attachment:
pgp00009.pgp
Description: PGP signature