--- /dev/null
+
+ NOTE! This copyright does *not* cover user programs that use kernel
+ services by normal system calls - this is merely considered normal use
+ of the kernel, and does *not* fall under the heading of "derived work".
+ Also note that the GPL below is copyrighted by the Free Software
+ Foundation, but the instance of code that it refers to (the Linux
+ kernel) is copyrighted by me and others who actually wrote it.
+
+ Linus Torvalds
+
+----------------------------------------
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+\f
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+\f
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+\f
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+\f
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
--- /dev/null
+tbd Cluster File Systems, Inc. <info@clusterfs.com>
+ * version 3.0.0
+ * Initial release of ldiskfs as a separate package.
--- /dev/null
+subdir-m += ldiskfs
+
+@INCLUDE_RULES@
--- /dev/null
+SUBDIRS := . ldiskfs
+SOURCES_SUBDIRS := ldiskfs
+DIST_SUBDIRS := ldiskfs
+
+include build/autoMakefile.toplevel.am
+
+EXTRA_DIST += kernel_patches
--- /dev/null
+#!/bin/bash
+exec bash build/autogen.sh $@
--- /dev/null
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT([Lustre ldiskfs], 3.0.0, [https://bugzilla.lustre.org/])
+AC_CONFIG_SRCDIR([lustre-ldiskfs.spec.in])
+
+AC_CANONICAL_SYSTEM
+
+AM_INIT_AUTOMAKE
+
+AC_PROG_CC
+
+LB_CANONICAL_SYSTEM
+LB_INCLUDE_RULES
+LB_PROG_CC
+LB_PROG_LINUX
+LB_CONFIG_HEADERS
+
+# These allow Lustre Makefiles and autoMakefiles to be used unchanged.
+AM_CONDITIONAL(MODULES, true)
+AM_CONDITIONAL(LINUX, true)
+AM_CONDITIONAL(DARWIN, true)
+AM_CONDITIONAL(LINUX25, true)
+
+LDISKFSDIR="$PWD/ldiskfs"
+AC_SUBST(LDISKFSDIR)
+
+AC_MSG_CHECKING([whether to enable quilt for making ldiskfs])
+AC_ARG_ENABLE([quilt],
+ AC_HELP_STRING([--disable-quilt],[disable use of quilt for ldiskfs]),
+ [],[enable_quilt='yes'])
+AC_MSG_RESULT([$enable_quilt])
+
+AC_PATH_PROG(PATCH, patch, [no])
+
+if test x$enable_quilt = xno ; then
+ QUILT="no"
+else
+ AC_PATH_PROG(QUILT, quilt, [no])
+fi
+
+if test x$enable_ldiskfs$PATCH$QUILT = xyesnono ; then
+ AC_MSG_ERROR([Quilt or patch are needed to build the ldiskfs module])
+fi
+
+AM_CONDITIONAL(USE_QUILT, test x$QUILT != xno)
+
+LB_DEFINE_LDISKFS_OPTIONS
+
+AC_MSG_CHECKING([which ldiskfs series to use])
+case $LINUXRELEASE in
+2.6.5*) LDISKFS_SERIES="2.6-suse.series" ;;
+2.6.9*) LDISKFS_SERIES="2.6-rhel4.series" ;;
+2.6.10-ac*) LDISKFS_SERIES="2.6-fc3.series" ;;
+2.6.10*) LDISKFS_SERIES="2.6-rhel4.series" ;;
+2.6.12*) LDISKFS_SERIES="2.6.12-vanilla.series" ;;
+2.6.15*) LDISKFS_SERIES="2.6-fc5.series";;
+2.6.16*) LDISKFS_SERIES="2.6-sles10.series";;
+2.6.18*) LDISKFS_SERIES="2.6.18-vanilla.series";;
+*) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac])
+esac
+AC_MSG_RESULT([$LDISKFS_SERIES])
+AC_SUBST(LDISKFS_SERIES)
+
+AC_SUBST(ac_configure_args)
+
+LB_CONFIG_FILES
+AC_CONFIG_FILES([ldiskfs/autoMakefile ldiskfs/Makefile])
+
+MOSTLYCLEANFILES='.*.cmd .*.flags *.o *.ko *.mod.c .depend .*.1.*'
+AC_SUBST(MOSTLYCLEANFILES)
+
+AC_OUTPUT
-Index: linux-stage/fs/ext3/super.c
+Index: linux-2.6.9-42.0.10.EL_lustre.1.4.10/fs/ext3/super.c
===================================================================
---- linux-stage.orig/fs/ext3/super.c 2005-02-25 14:50:46.077845320 +0200
-+++ linux-stage/fs/ext3/super.c 2005-02-25 14:51:32.241827328 +0200
-@@ -123,6 +123,8 @@
+--- linux-2.6.9-42.0.10.EL_lustre.1.4.10.orig/fs/ext3/super.c 2007-05-16 08:46:24.000000000 +0200
++++ linux-2.6.9-42.0.10.EL_lustre.1.4.10/fs/ext3/super.c 2007-05-16 08:48:58.000000000 +0200
+@@ -123,6 +123,8 @@ void ext3_journal_abort_handle(const cha
journal_abort_handle(handle);
}
/* Deal with the reporting of failure conditions on a filesystem such as
* inconsistencies detected or read IO failures.
*
-@@ -2002,6 +2004,8 @@
+@@ -2064,6 +2066,8 @@ int ext3_force_commit(struct super_block
return ret;
}
/*
* Ext3 always journals updates to the superblock itself, so we don't
* have to propagate any other updates to the superblock on disk at this
-@@ -2433,6 +2437,10 @@
+@@ -2586,6 +2590,12 @@ int ext3_map_inode_page(struct inode *in
unsigned long *blocks, int *created, int create);
EXPORT_SYMBOL(ext3_map_inode_page);
+EXPORT_SYMBOL(ext3_xattr_get);
+EXPORT_SYMBOL(ext3_xattr_set_handle);
+EXPORT_SYMBOL(ext3_bread);
++EXPORT_SYMBOL(ext3_journal_start_sb);
++EXPORT_SYMBOL(__ext3_journal_stop);
+
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
-Index: linux-stage/fs/ext3/super.c
+Index: linux-2.6.5-7.283_lustre-1.4.10.1/fs/ext3/super.c
===================================================================
---- linux-stage.orig/fs/ext3/super.c 2004-04-02 16:40:18.000000000 -0500
-+++ linux-stage/fs/ext3/super.c 2004-04-02 16:40:18.000000000 -0500
-@@ -115,6 +115,8 @@
+--- linux-2.6.5-7.283_lustre-1.4.10.1.orig/fs/ext3/super.c 2007-05-30 08:48:29.000000000 +0200
++++ linux-2.6.5-7.283_lustre-1.4.10.1/fs/ext3/super.c 2007-05-30 08:48:37.000000000 +0200
+@@ -116,6 +116,8 @@ void ext3_journal_abort_handle(const cha
handle->h_err = err;
}
static char error_buf[1024];
/* Deal with the reporting of failure conditions on a filesystem such as
-@@ -1774,6 +1776,8 @@
+@@ -1895,6 +1897,8 @@ int ext3_force_commit(struct super_block
return ret;
}
/*
* Ext3 always journals updates to the superblock itself, so we don't
* have to propagate any other updates to the superblock on disk at this
-@@ -2088,6 +2092,10 @@
+@@ -2334,6 +2338,12 @@ int ext3_map_inode_page(struct inode *in
unsigned long *blocks, int *created, int create);
EXPORT_SYMBOL(ext3_map_inode_page);
+EXPORT_SYMBOL(ext3_xattr_get);
+EXPORT_SYMBOL(ext3_xattr_set_handle);
+EXPORT_SYMBOL(ext3_bread);
++EXPORT_SYMBOL(ext3_journal_start);
++EXPORT_SYMBOL(__ext3_journal_stop);
+
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
MODULE_DESCRIPTION("Second Extended Filesystem with journaling extensions");
===================================================================
--- linux-stage.orig/fs/ext3/extents.c 2005-02-25 15:33:48.890198160 +0200
+++ linux-stage/fs/ext3/extents.c 2005-02-25 15:33:48.917194056 +0200
-@@ -0,0 +1,2359 @@
+@@ -0,0 +1,2360 @@
+/*
+ * Copyright(c) 2003, 2004, 2005, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+static inline void ext3_ext_tree_changed(struct ext3_extents_tree *tree)
+{
+ struct ext3_extent_header *neh = EXT_ROOT_HDR(tree);
-+ neh->eh_generation = ((EXT_FLAGS(neh) & ~EXT_FLAGS_CLR_UNKNOWN) << 24) |
-+ (EXT_HDR_GEN(neh) + 1);
++ neh->eh_generation = ((EXT_FLAGS(neh) & ~EXT_FLAGS_CLR_UNKNOWN) <<
++ EXT_HDR_GEN_BITS) |
++ ((EXT_HDR_GEN(neh) + 1) & EXT_HDR_GEN_MASK);
+}
+
+static inline int ext3_ext_space_block(struct ext3_extents_tree *tree)
+ __u32 ee_block; /* first logical block extent covers */
+ __u16 ee_len; /* number of blocks covered by extent */
+ __u16 ee_start_hi; /* high 16 bits of physical block */
-+ __u32 ee_start; /* low 32 bigs of physical block */
++ __u32 ee_start; /* low 32 bits of physical block */
+};
+
+/*
+ (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->eh_max - 1)
+#define EXT_MAX_INDEX(__hdr__) \
+ (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->eh_max - 1)
-+#define EXT_HDR_GEN(__hdr__) ((__hdr__)->eh_generation & 0x00ffffff)
-+#define EXT_FLAGS(__hdr__) ((__hdr__)->eh_generation >> 24)
++#define EXT_HDR_GEN_BITS 24
++#define EXT_HDR_GEN_MASK ((1 << EXT_HDR_GEN_BITS) - 1)
++#define EXT_HDR_GEN(__hdr__) ((__hdr__)->eh_generation & EXT_HDR_GEN_MASK)
++#define EXT_FLAGS(__hdr__) ((__hdr__)->eh_generation >> EXT_HDR_GEN_BITS)
+#define EXT_FLAGS_CLR_UNKNOWN 0x7 /* Flags cleared on modification */
+
+#define EXT_BLOCK_HDR(__bh__) ((struct ext3_extent_header *)(__bh__)->b_data)
+ if (tree->cex)
+ tree->cex->ec_type = EXT3_EXT_CACHE_NO;
+}
-+
-+
+#endif /* _LINUX_EXT3_EXTENTS */
Index: linux-stage/include/linux/ext3_fs_i.h
===================================================================
/*
* Special inodes numbers
*/
-@@ -383,6 +391,7 @@ struct ext3_inode {
+@@ -383,6 +391,7 @@
#define EXT3_MOUNT_IOPEN_NOPRIV 0x800000/* Make iopen world-readable */
#define EXT3_MOUNT_EXTENTS 0x1000000/* Extents support */
#define EXT3_MOUNT_EXTDEBUG 0x2000000/* Extents debug */
/*
* Maximal mount counts between two filesystem checks
*/
-@@ -744,7 +753,7 @@
+@@ -744,7 +753,9 @@
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
- unsigned long);
+ unsigned long, int);
++extern int ext3_new_block_old(handle_t *handle, struct inode *inode,
++ unsigned long goal, int *errp);
extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
unsigned long, unsigned long, int *);
extern unsigned long ext3_count_free_blocks (struct super_block *);
/*
* third extended-fs super-block data in memory
-@@ -78,6 +84,43 @@ struct ext3_sb_info {
+@@ -78,6 +84,43 @@
char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
int s_jquota_fmt; /* Format of quota to use */
#endif
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/super.c 2006-05-30 22:55:32.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/super.c 2006-05-30 23:02:59.000000000 +0800
-@@ -392,6 +392,7 @@ static void ext3_put_super (struct super
+@@ -392,6 +392,7 @@
struct ext3_super_block *es = sbi->s_es;
int i;
ext3_ext_release(sb);
ext3_xattr_put_super(sb);
journal_destroy(sbi->s_journal);
-@@ -640,6 +641,7 @@ enum {
+@@ -640,6 +641,7 @@
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
Opt_extents, Opt_noextents, Opt_extdebug,
Opt_grpquota
};
-@@ -694,6 +695,9 @@ static match_table_t tokens = {
+@@ -694,6 +695,9 @@
{Opt_extents, "extents"},
{Opt_noextents, "noextents"},
{Opt_extdebug, "extdebug"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
-@@ -1041,6 +1043,19 @@ clear_qf_name:
+@@ -1041,6 +1043,19 @@
case Opt_extdebug:
set_opt (sbi->s_mount_opt, EXTDEBUG);
break;
default:
printk (KERN_ERR
"EXT3-fs: Unrecognized mount option \"%s\" "
-@@ -1766,6 +1771,7 @@ static int ext3_fill_super (struct super
+@@ -1766,6 +1771,7 @@
ext3_count_dirs(sb));
ext3_ext_init(sb);
lock_kernel();
return 0;
-@@ -2699,7 +2705,13 @@ static struct file_system_type ext3_fs_t
+@@ -2699,7 +2705,13 @@
static int __init init_ext3_fs(void)
{
if (err)
return err;
err = init_inodecache();
-@@ -2721,6 +2733,7 @@ static void __exit exit_ext3_fs(void)
+@@ -2721,6 +2733,7 @@
unregister_filesystem(&ext3_fs_type);
destroy_inodecache();
exit_ext3_xattr();
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/extents.c 2006-05-30 22:55:32.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/extents.c 2006-05-30 23:02:59.000000000 +0800
-@@ -771,7 +771,7 @@ cleanup:
+@@ -771,7 +771,7 @@
for (i = 0; i < depth; i++) {
if (!ablocks[i])
continue;
}
}
kfree(ablocks);
-@@ -1428,7 +1428,7 @@ int ext3_ext_rm_idx(handle_t *handle, st
+@@ -1428,7 +1428,7 @@
path->p_idx->ei_leaf);
bh = sb_find_get_block(tree->inode->i_sb, path->p_idx->ei_leaf);
ext3_forget(handle, 1, tree->inode, bh, path->p_idx->ei_leaf);
return err;
}
-@@ -1913,10 +1913,12 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -1913,10 +1913,12 @@
int needed = ext3_remove_blocks_credits(tree, ex, from, to);
handle_t *handle = ext3_journal_start(tree->inode, needed);
struct buffer_head *bh;
if (from >= ex->ee_block && to == ex->ee_block + ex->ee_len - 1) {
/* tail removal */
unsigned long num, start;
-@@ -1928,7 +1930,7 @@ ext3_remove_blocks(struct ext3_extents_t
+@@ -1928,7 +1930,7 @@
bh = sb_find_get_block(tree->inode->i_sb, start + i);
ext3_forget(handle, 0, tree->inode, bh, start + i);
}
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/inode.c 2006-05-30 22:55:32.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/inode.c 2006-05-30 23:02:59.000000000 +0800
-@@ -568,7 +568,7 @@ failed:
+@@ -568,7 +568,7 @@
ext3_journal_forget(handle, branch[i].bh);
}
for (i = 0; i < keys; i++)
return err;
}
-@@ -1862,7 +1862,7 @@ static void ext3_clear_blocks(handle_t *
+@@ -1862,7 +1862,7 @@
}
}
}
/**
-@@ -2035,7 +2035,7 @@ static void ext3_free_branches(handle_t
+@@ -2035,7 +2035,7 @@
ext3_journal_test_restart(handle, inode);
}
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/balloc.c 2006-03-20 13:53:29.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/balloc.c 2006-05-30 23:02:59.000000000 +0800
-@@ -80,7 +80,7 @@ struct ext3_group_desc * ext3_get_group_
+@@ -80,7 +80,7 @@
*
* Return buffer_head on success or NULL in case of failure.
*/
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
struct ext3_group_desc * desc;
-@@ -491,24 +491,6 @@ error_return:
+@@ -491,24 +491,6 @@
return;
}
/*
* For ext3 allocations, we must not reuse any blocks which are
* allocated in the bitmap buffer's "last committed data" copy. This
-@@ -1154,7 +1136,7 @@ out:
+@@ -1154,7 +1136,7 @@
* bitmap, and then for any free bit if that fails.
* This function also updates quota and i_blocks field.
*/
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/xattr.c 2006-03-20 13:53:29.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/xattr.c 2006-05-30 23:02:59.000000000 +0800
-@@ -484,7 +484,7 @@ ext3_xattr_release_block(handle_t *handl
+@@ -484,7 +484,7 @@
ea_bdebug(bh, "refcount now=0; freeing");
if (ce)
mb_cache_entry_free(ce);
get_bh(bh);
ext3_forget(handle, 1, inode, bh, bh->b_blocknr);
} else {
-@@ -804,7 +804,7 @@ inserted:
+@@ -804,7 +804,7 @@
new_bh = sb_getblk(sb, block);
if (!new_bh) {
getblk_failed:
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/mballoc.c 2006-05-31 04:14:15.752410384 +0800
+++ linux-2.6.16.i686/fs/ext3/mballoc.c 2006-05-30 23:03:38.000000000 +0800
-@@ -0,0 +1,2729 @@
+@@ -0,0 +1,2725 @@
+/*
+ * Copyright (c) 2003-2005, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+
+struct ext3_group_info {
+ unsigned long bb_state;
-+ unsigned long bb_tid;
++ unsigned long bb_tid;
+ struct ext3_free_metadata *bb_md_cur;
+ unsigned short bb_first_free;
+ unsigned short bb_free;
+ __u16 ac_found;
+ __u16 ac_tail;
+ __u16 ac_buddy;
-+ __u8 ac_status;
++ __u8 ac_status;
+ __u8 ac_flags; /* allocation hints */
+ __u8 ac_criteria;
+ __u8 ac_repeats;
+
+static struct proc_dir_entry *proc_root_ext3;
+
-+int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
-+struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
-+int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
-+int ext3_mb_reserve_blocks(struct super_block *, int);
-+void ext3_mb_release_blocks(struct super_block *, int);
++struct buffer_head *read_block_bitmap(struct super_block *, unsigned int);
+void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
+void ext3_mb_free_committed_blocks(struct super_block *);
+
+ J_ASSERT(sbi->s_stripe != 0);
+
+ /* find first stripe-aligned block */
-+ i = e3b->bd_group * EXT3_BLOCKS_PER_GROUP(sb) +
-+ le32_to_cpu(sbi->s_es->s_first_data_block);
++ i = e3b->bd_group * EXT3_BLOCKS_PER_GROUP(sb)
++ + le32_to_cpu(sbi->s_es->s_first_data_block);
+ i = ((i + sbi->s_stripe - 1) / sbi->s_stripe) * sbi->s_stripe;
-+ i = (i - le32_to_cpu(sbi->s_es->s_first_data_block)) %
-+ EXT3_BLOCKS_PER_GROUP(sb);
++ i = (i - le32_to_cpu(sbi->s_es->s_first_data_block))
++ % EXT3_BLOCKS_PER_GROUP(sb);
+
+ while (i < sb->s_blocksize * 8) {
+ if (!mb_test_bit(i, bitmap)) {
+ if (value <= 0)
+ return -ERANGE;
+
-+ ext3_mb_max_to_scan = value;
++ ext3_mb_max_to_scan = value;
+
+ return count;
+}
+ if (value <= 0)
+ return -ERANGE;
+
-+ ext3_mb_min_to_scan = value;
++ ext3_mb_min_to_scan = value;
+
+ return count;
+}
+ if (value <= 0)
+ return -ERANGE;
+
-+ ext3_mb_order2_reqs = value;
++ ext3_mb_order2_reqs = value;
+
+ return count;
+}
===================================================================
--- linux-2.6.16.i686.orig/fs/ext3/Makefile 2006-05-30 22:55:32.000000000 +0800
+++ linux-2.6.16.i686/fs/ext3/Makefile 2006-05-30 23:02:59.000000000 +0800
-@@ -6,7 +6,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o
+@@ -6,7 +6,7 @@
ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o \
/*
* Maximal mount counts between two filesystem checks
*/
-@@ -700,7 +717,9 @@ extern int ext3_bg_has_super(struct supe
+@@ -700,7 +717,10 @@ extern int ext3_bg_has_super(struct supe
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
- unsigned long);
+ unsigned long, int);
++extern int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
+extern void ext3_free_blocks_old(handle_t *, struct inode *, unsigned long,
+ unsigned long);
extern unsigned long ext3_count_free_blocks (struct super_block *);
===================================================================
--- linux-2.6.5-7.282-full.orig/fs/ext3/mballoc.c 2006-10-23 18:07:54.821533176 +0400
+++ linux-2.6.5-7.282-full/fs/ext3/mballoc.c 2006-10-24 22:20:45.000000000 +0400
-@@ -0,0 +1,2730 @@
+@@ -0,0 +1,2726 @@
+/*
+ * Copyright (c) 2003-2005, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+
+static struct proc_dir_entry *proc_root_ext3;
+
-+int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
+struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
-+int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
-+int ext3_mb_reserve_blocks(struct super_block *, int);
-+void ext3_mb_release_blocks(struct super_block *, int);
+void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
+void ext3_mb_free_committed_blocks(struct super_block *);
+
/*
* Maximal mount counts between two filesystem checks
*/
-@@ -727,7 +736,7 @@ extern int ext3_bg_has_super(struct supe
+@@ -727,7 +736,8 @@ extern int ext3_bg_has_super(struct supe
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
- unsigned long);
+ unsigned long, int);
++extern int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
unsigned long, unsigned long, int *);
extern unsigned long ext3_count_free_blocks (struct super_block *);
===================================================================
--- linux-2.6.12.6-bull.orig/fs/ext3/mballoc.c 2006-04-22 17:31:47.543334750 +0400
+++ linux-2.6.12.6-bull/fs/ext3/mballoc.c 2006-04-30 01:24:11.000000000 +0400
-@@ -0,0 +1,2729 @@
+@@ -0,0 +1,2725 @@
+/*
+ * Copyright (c) 2003-2005, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+
+static struct proc_dir_entry *proc_root_ext3;
+
-+int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
+struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
-+int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
-+int ext3_mb_reserve_blocks(struct super_block *, int);
-+void ext3_mb_release_blocks(struct super_block *, int);
+void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
+void ext3_mb_free_committed_blocks(struct super_block *);
+
/*
* Maximal mount counts between two filesystem checks
*/
-@@ -726,7 +743,7 @@ extern int ext3_bg_has_super(struct supe
+@@ -726,7 +743,8 @@ extern int ext3_bg_has_super(struct supe
extern unsigned long ext3_bg_num_gdb(struct super_block *sb, int group);
extern int ext3_new_block (handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks (handle_t *, struct inode *, unsigned long,
- unsigned long);
+ unsigned long, int);
++extern int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
extern void ext3_free_blocks_sb (handle_t *, struct super_block *,
unsigned long, unsigned long, int *);
extern unsigned long ext3_count_free_blocks (struct super_block *);
===================================================================
--- linux-2.6.9-full.orig/fs/ext3/mballoc.c 2006-10-23 18:07:54.821533176 +0400
+++ linux-2.6.9-full/fs/ext3/mballoc.c 2006-10-24 13:00:56.000000000 +0400
-@@ -0,0 +1,2729 @@
+@@ -0,0 +1,2725 @@
+/*
+ * Copyright (c) 2003-2005, Cluster File Systems, Inc, info@clusterfs.com
+ * Written by Alex Tomas <alex@clusterfs.com>
+
+static struct proc_dir_entry *proc_root_ext3;
+
-+int ext3_create (struct inode *, struct dentry *, int, struct nameidata *);
+struct buffer_head * read_block_bitmap(struct super_block *, unsigned int);
-+int ext3_new_block_old(handle_t *, struct inode *, unsigned long, int *);
-+int ext3_mb_reserve_blocks(struct super_block *, int);
-+void ext3_mb_release_blocks(struct super_block *, int);
+void ext3_mb_poll_new_transaction(struct super_block *, handle_t *);
+void ext3_mb_free_committed_blocks(struct super_block *);
+
-Index: linux-2.6.9-rhel4/fs/ext3/ialloc.c
+Index: linux-stage/fs/ext3/ialloc.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/ialloc.c
-+++ linux-2.6.9-rhel4/fs/ext3/ialloc.c
-@@ -612,7 +612,8 @@ got:
+--- linux-stage.orig/fs/ext3/ialloc.c
++++ linux-stage/fs/ext3/ialloc.c
+@@ -726,7 +726,8 @@ got:
/* This is the optimal IO size (for stat), not the fs block size */
inode->i_blksize = PAGE_SIZE;
inode->i_blocks = 0;
memset(ei->i_data, 0, sizeof(ei->i_data));
ei->i_next_alloc_block = 0;
-@@ -650,9 +651,8 @@ got:
+@@ -764,9 +765,8 @@ got:
spin_unlock(&sbi->s_next_gen_lock);
ei->i_state = EXT3_STATE_NEW;
ret = inode;
if(DQUOT_ALLOC_INODE(inode)) {
-Index: linux-2.6.9-rhel4/fs/ext3/inode.c
+Index: linux-stage/fs/ext3/inode.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/inode.c
-+++ linux-2.6.9-rhel4/fs/ext3/inode.c
+--- linux-stage.orig/fs/ext3/inode.c
++++ linux-stage/fs/ext3/inode.c
@@ -627,7 +627,7 @@ static int ext3_splice_branch(handle_t *
/* We are done with atomic stuff, now do the rest of housekeeping */
ext3_mark_inode_dirty(handle, inode);
/* had we spliced it onto indirect block? */
-@@ -2227,7 +2227,7 @@ do_indirects:
+@@ -2230,7 +2230,7 @@ do_indirects:
;
}
up(&ei->truncate_sem);
ext3_mark_inode_dirty(handle, inode);
/* In a multi-transaction truncate, we only make the final
-@@ -2454,10 +2454,6 @@ void ext3_read_inode(struct inode * inod
+@@ -2457,10 +2457,6 @@ void ext3_read_inode(struct inode * inod
}
inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
inode->i_size = le32_to_cpu(raw_inode->i_size);
ei->i_state = 0;
ei->i_next_alloc_block = 0;
-@@ -2518,6 +2514,11 @@ void ext3_read_inode(struct inode * inod
+@@ -2521,6 +2517,11 @@ void ext3_read_inode(struct inode * inod
else
ei->i_extra_isize = 0;
if (S_ISREG(inode->i_mode)) {
inode->i_op = &ext3_file_inode_operations;
inode->i_fop = &ext3_file_operations;
-@@ -2598,9 +2599,12 @@ static int ext3_do_update_inode(handle_t
+@@ -2601,9 +2602,12 @@ static int ext3_do_update_inode(handle_t
}
raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
raw_inode->i_size = cpu_to_le32(ei->i_disksize);
raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
raw_inode->i_flags = cpu_to_le32(ei->i_flags);
-Index: linux-2.6.9-rhel4/fs/ext3/ioctl.c
+Index: linux-stage/fs/ext3/ioctl.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/ioctl.c
-+++ linux-2.6.9-rhel4/fs/ext3/ioctl.c
+--- linux-stage.orig/fs/ext3/ioctl.c
++++ linux-stage/fs/ext3/ioctl.c
@@ -112,7 +112,7 @@ int ext3_ioctl (struct inode * inode, st
ei->i_flags = flags;
inode->i_generation = generation;
err = ext3_mark_iloc_dirty(handle, inode, &iloc);
}
-Index: linux-2.6.9-rhel4/fs/ext3/namei.c
+Index: linux-stage/fs/ext3/namei.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/namei.c
-+++ linux-2.6.9-rhel4/fs/ext3/namei.c
+--- linux-stage.orig/fs/ext3/namei.c
++++ linux-stage/fs/ext3/namei.c
@@ -1302,7 +1302,7 @@ static int add_dirent_to_buf(handle_t *h
* happen is that the times are slightly out of date
* and/or different from the directory change time.
ext3_update_dx_flag(old_dir);
if (dir_bh) {
BUFFER_TRACE(dir_bh, "get_write_access");
-Index: linux-2.6.9-rhel4/fs/ext3/super.c
+Index: linux-stage/fs/ext3/super.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/super.c
-+++ linux-2.6.9-rhel4/fs/ext3/super.c
-@@ -1468,6 +1468,8 @@ static int ext3_fill_super (struct super
+--- linux-stage.orig/fs/ext3/super.c
++++ linux-stage/fs/ext3/super.c
+@@ -1573,6 +1573,8 @@ static int ext3_fill_super (struct super
sbi->s_inode_size);
goto failed_mount;
}
}
sbi->s_frag_size = EXT3_MIN_FRAG_SIZE <<
le32_to_cpu(es->s_log_frag_size);
-@@ -1654,6 +1656,32 @@ static int ext3_fill_super (struct super
+@@ -1759,6 +1761,32 @@ static int ext3_fill_super (struct super
}
ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
/*
* akpm: core read_super() calls in here with the superblock locked.
* That deadlocks, because orphan cleanup needs to lock the superblock
-Index: linux-2.6.9-rhel4/fs/ext3/xattr.c
+Index: linux-stage/fs/ext3/xattr.c
===================================================================
---- linux-2.6.9-rhel4.orig/fs/ext3/xattr.c
-+++ linux-2.6.9-rhel4/fs/ext3/xattr.c
+--- linux-stage.orig/fs/ext3/xattr.c
++++ linux-stage/fs/ext3/xattr.c
@@ -1305,7 +1305,7 @@ getblk_failed:
/* Update the inode. */
ext3_mark_inode_dirty(handle, inode);
if (IS_SYNC(inode))
handle->h_sync = 1;
-Index: linux-2.6.9-rhel4/include/linux/ext3_fs.h
+Index: linux-stage/include/linux/ext3_fs.h
===================================================================
---- linux-2.6.9-rhel4.orig/include/linux/ext3_fs.h
-+++ linux-2.6.9-rhel4/include/linux/ext3_fs.h
-@@ -258,7 +258,7 @@ struct ext3_inode {
+--- linux-stage.orig/include/linux/ext3_fs.h
++++ linux-stage/include/linux/ext3_fs.h
+@@ -280,7 +280,7 @@ struct ext3_inode {
__le16 i_uid; /* Low 16 bits of Owner Uid */
__le32 i_size; /* Size in bytes */
__le32 i_atime; /* Access time */
__le32 i_mtime; /* Modification time */
__le32 i_dtime; /* Deletion Time */
__le16 i_gid; /* Low 16 bits of Group Id */
-@@ -307,10 +307,73 @@ struct ext3_inode {
+@@ -329,10 +329,73 @@ struct ext3_inode {
} osd2; /* OS dependent 2 */
__u16 i_extra_isize;
__u16 i_pad1;
#if defined(__KERNEL__) || defined(__linux__)
#define i_reserved1 osd1.linux1.l_i_reserved1
#define i_frag osd2.linux2.l_i_frag
-@@ -485,11 +548,19 @@ struct ext3_super_block {
+@@ -500,11 +563,19 @@ struct ext3_super_block {
__le32 s_last_orphan; /* start of list of inodes to delete */
__le32 s_hash_seed[4]; /* HTREE hash seed */
__u8 s_def_hash_version; /* Default hash version to use */
};
#ifdef __KERNEL__
-@@ -565,6 +630,7 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+@@ -580,6 +651,7 @@ static inline struct ext3_inode_info *EX
#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+ #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
+#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
-@@ -581,6 +647,7 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
+@@ -597,6 +669,7 @@ static inline struct ext3_inode_info *EX
EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
+ EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE| \
EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
/*
-@@ -708,6 +775,12 @@ static inline struct ext3_inode *ext3_ra
+@@ -724,6 +797,12 @@ static inline struct ext3_inode *ext3_ra
return (struct ext3_inode *) (iloc->bh->b_data + iloc->offset);
}
/*
* This structure is stuffed into the struct file's private_data field
* for directories. It is where we put information so that we can do
-Index: linux-2.6.9-rhel4/include/linux/ext3_fs_i.h
+Index: linux-stage/include/linux/ext3_fs_i.h
===================================================================
---- linux-2.6.9-rhel4.orig/include/linux/ext3_fs_i.h
-+++ linux-2.6.9-rhel4/include/linux/ext3_fs_i.h
+--- linux-stage.orig/include/linux/ext3_fs_i.h
++++ linux-stage/include/linux/ext3_fs_i.h
@@ -130,6 +130,7 @@ struct ext3_inode_info {
- struct inode vfs_inode;
- __u32 i_cached_extent[4];
+ /* on-disk additional length */
+ __u16 i_extra_isize;
+ struct timespec i_crtime;
- };
- #endif /* _LINUX_EXT3_FS_I */
-Index: linux-2.6.9-rhel4/include/linux/ext3_fs_sb.h
+ /*
+ * truncate_sem is for serialising ext3_truncate() against
+Index: linux-stage/include/linux/ext3_fs_sb.h
===================================================================
---- linux-2.6.9-rhel4.orig/include/linux/ext3_fs_sb.h
-+++ linux-2.6.9-rhel4/include/linux/ext3_fs_sb.h
-@@ -122,6 +122,8 @@ struct ext3_sb_info {
- spinlock_t s_bal_lock;
- unsigned long s_mb_buddies_generated;
- unsigned long long s_mb_generation_time;
-+
-+ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
- };
+--- linux-stage.orig/include/linux/ext3_fs_sb.h
++++ linux-stage/include/linux/ext3_fs_sb.h
+@@ -71,6 +71,8 @@ struct ext3_sb_info {
+ /* Last group used to allocate inode */
+ int s_last_alloc_group;
- #define EXT3_GROUP_INFO(sb, group) \
++ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
++
+ /* root of the per fs reservation window tree */
+ spinlock_t s_rsv_window_lock;
+ struct rb_root s_rsv_window_root;
#ifdef __KERNEL__
@@ -583,6 +648,8 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+ #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
+#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
+
#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -599,6 +666,7 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
+ EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE| \
EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
===================================================================
--- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs_i.h
+++ linux-2.6.16.27-0.9/include/linux/ext3_fs_i.h
-@@ -135,6 +135,7 @@ struct ext3_inode_info {
- struct inode vfs_inode;
+@@ -130,6 +130,7 @@ struct ext3_inode_info {
- __u32 i_cached_extent[4];
+ /* on-disk additional length */
+ __u16 i_extra_isize;
+ struct timespec i_crtime;
- void *i_filterdata;
- };
+ /*
+ * truncate_sem is for serialising ext3_truncate() against
Index: linux-2.6.16.27-0.9/include/linux/ext3_fs_sb.h
===================================================================
--- linux-2.6.16.27-0.9.orig/include/linux/ext3_fs_sb.h
+++ linux-2.6.16.27-0.9/include/linux/ext3_fs_sb.h
-@@ -119,6 +119,8 @@ struct ext3_sb_info {
- spinlock_t s_bal_lock;
- unsigned long s_mb_buddies_generated;
- unsigned long long s_mb_generation_time;
-+
-+ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
- };
+@@ -71,6 +71,8 @@ struct ext3_sb_info {
+ /* Last group used to allocate inode */
+ int s_last_alloc_group;
- #define EXT3_GROUP_INFO(sb, group) \
++ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
++
+ /* root of the per fs reservation window tree */
+ spinlock_t s_rsv_window_lock;
+ struct rb_root s_rsv_window_root;
#ifdef __KERNEL__
@@ -539,6 +556,7 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+ #define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010
#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
+#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -555,6 +573,7 @@ static inline struct ext3_inode_info *EX
- #define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER| \
EXT3_FEATURE_RO_COMPAT_LARGE_FILE| \
+ EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \
EXT4_FEATURE_RO_COMPAT_DIR_NLINK| \
+ EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE| \
EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
===================================================================
--- linux-2.6.5-7.283.orig/include/linux/ext3_fs_i.h
+++ linux-2.6.5-7.283/include/linux/ext3_fs_i.h
-@@ -131,6 +131,7 @@ struct ext3_inode_info {
- struct inode vfs_inode;
+@@ -130,6 +130,7 @@ struct ext3_inode_info {
- struct ext3_ext_cache i_cached_extent;
+ /* on-disk additional length */
+ __u16 i_extra_isize;
+ struct timespec i_crtime;
- };
- #endif /* _LINUX_EXT3_FS_I */
+ /*
+ * truncate_sem is for serialising ext3_truncate() against
Index: linux-2.6.5-7.283/include/linux/ext3_fs_sb.h
===================================================================
--- linux-2.6.5-7.283.orig/include/linux/ext3_fs_sb.h
+++ linux-2.6.5-7.283/include/linux/ext3_fs_sb.h
-@@ -119,6 +119,8 @@ struct ext3_sb_info {
- spinlock_t s_bal_lock;
- unsigned long s_mb_buddies_generated;
- unsigned long long s_mb_generation_time;
-+
-+ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
- };
+@@ -71,6 +71,8 @@ struct ext3_sb_info {
+ /* Last group used to allocate inode */
+ int s_last_alloc_group;
- #define EXT3_GROUP_INFO(sb, group) \
++ unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
++
+ /* root of the per fs reservation window tree */
+ spinlock_t s_rsv_window_lock;
+ struct rb_root s_rsv_window_root;
ext3-filterdata-2.6.15.patch
ext3-disable-write-bar-by-default-2.6-sles10.patch
ext3-nanosecond-2.6-sles10.patch
+ext3-inode-version-2.6-sles10.patch
ext3-remove-cond_resched-calls-2.6.12.patch
ext3-filterdata-2.6.15.patch
ext3-nanosecond-2.6.18-vanilla.patch
+ext3-inode-version-2.6.18-vanilla.patch
ldiskfs-objs := $(filter %.o,$(ldiskfs_sources:.c=.o))
-EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LUSTRE@ -I@LUSTRE@/ldiskfs
+EXTRA_PRE_CFLAGS := -I@LINUX@/fs -I@LDISKFSDIR@
@INCLUDE_RULES@
-if MODULES
-if LDISKFS
modulefs_DATA = ldiskfs$(KMODEXT)
-endif
-endif
ldiskfs_linux_headers := $(addprefix linux/,$(subst ext3,ldiskfs,$(notdir $(linux_headers))))
linux/ldiskfs%.h: linux-stage/include/linux/ext3%.h
sed $(strip $(ldiskfs_sed_flags)) $< > $@
-#
-# FIXME: we need to grab the series in configure somehow
-# (see bug 1679)
-#
-series := @top_srcdir@/lustre/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
-patches := @top_srcdir@/lustre/kernel_patches/patches
+series := @top_srcdir@/kernel_patches/series/ldiskfs-$(LDISKFS_SERIES)
+patches := @top_srcdir@/kernel_patches/patches
sources: $(ext3_sources) $(ext3_headers) $(linux_headers) $(series)
rm -rf linux-stage linux sources $(ldiskfs_SOURCES)
--- /dev/null
+#!/bin/bash
+
+LC_COLLATE="C"
+progname="${0##*/}"
+
+warn ()
+{
+ [ "$1" ] && echo >&2
+ [ "$1" ] && echo "$progname: $1" >&2
+ [ "$1" ] && echo >&2
+}
+
+fatal ()
+{
+ warn "$2"
+ exit "$1"
+}
+
+usage ()
+{
+ cat <<EOF
+Usage: $progname <tag> <pindate>
+ where <tag> is a tag of the ldiskfs module
+ and <pindate> is an optional quoted timestamp suitable for cvs -D
+EOF
+}
+
+if [ -z "$LDISKFSCVS_UPDATED" ] ; then
+ echo "$progname: updating ldiskfscvs"
+ cvs up -l || fatal 1 "Error updating ldiskfscvs"
+ export LDISKFSCVS_UPDATED=yes
+ exec "$0" "$@"
+fi
+
+[ "$1" = "-r" ] && shift
+
+buildtag="HEAD"
+tag="$1"
+shift
+pindate=$1
+shift
+
+if [ "$*" ] ; then
+ usage >&2
+ exit 1
+fi
+
+case "$tag" in
+ '')
+ warn "a tag is required."
+ usage >&2
+ exit 1
+ ;;
+ --help | -h)
+ usage
+ exit 0
+ ;;
+
+ # this is the branch table
+ # keep this list sorted alphabetically!
+
+ # So far there's just HEAD.
+
+ *)
+ buildtag="HEAD"
+ ;;
+esac
+
+error_modules=
+cvs_cmd ()
+{
+ dir="$1"
+ module="$2"
+ tag="$3"
+ cotag=""
+ update=""
+
+ if [ "$tag" = "HEAD" ] ; then
+ cotag=""
+ uptag="-A"
+ elif [ "$tag" ] ; then
+ cotag="-r $tag"
+ uptag="-r $tag"
+ else
+ # silently skip if no tag was specified
+ return
+ fi
+
+ # create a cvs date format that will survive shell expansion
+ if [ -n "$pindate" ]; then
+ datecmd=$(date -u +%s -d "$pindate")
+ datecmd="-D @$datecmd"
+ else
+ datecmd=""
+ fi
+
+ if [ -d "$dir" ] ; then
+ echo "$progname: Updating $dir to $tag"
+ ( cd "$dir" && cvs up $datecmd -dAP $uptag )
+ else
+ echo "$progname: Checking out $dir from $tag"
+ cvs co $datecmd -P $cotag -d "$dir" "$module"
+ fi
+ if [ $? != 0 ] ; then
+ error_modules="$dir $error_modules"
+ fi
+}
+
+cvs_cmd build lustre-build "$buildtag"
--- /dev/null
+%define version @VERSION@
+%define kversion @LINUXRELEASE@
+
+Summary: ldiskfs backend file system
+Name: lustre-ldiskfs
+Version: %{version}
+Release: @RELEASE@
+License: GPL
+Group: Development/Kernel
+Source: lustre-ldiskfs-%{version}.tar.gz
+URL: http://clusterfs.com/
+BuildRoot: %{_tmppath}/lustre-ldiskfs-%{version}-root
+Requires: modutils >= 2.4.10
+
+%description
+Provides the ldiskfs backend file system kernel module, used by
+servers in the Lustre file system, for Linux %{kversion}.
+
+%prep
+%setup -q
+
+%build
+# if RPM_BUILD_NCPUS unset, set it
+if [ -z "$RPM_BUILD_NCPUS" ] ; then
+ RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat 2>/dev/null || echo 0 :)
+ if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
+ RPM_BUILD_NCPUS=1
+ fi
+ if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
+ RPM_BUILD_NCPUS=8
+ fi
+fi
+
+rm -rf $RPM_BUILD_ROOT
+
+# Set an explicit path to our Linux tree, if we can.
+cd $RPM_BUILD_DIR/lustre-ldiskfs-%{version}
+./configure @ac_configure_args@ %{?configure_flags:configure_flags} \
+ --sysconfdir=%{_sysconfdir} \
+ --mandir=%{_mandir} \
+ --libdir=%{_libdir}
+make -j $RPM_BUILD_NCPUS -s
+
+%install
+make install DESTDIR=$RPM_BUILD_ROOT
+
+%files
+%attr(-, root, root) /lib/modules/%{kversion}/kernel/fs/lustre-ldiskfs
+
+%post
+if [ -f /boot/System.map-%{kversion} ]; then
+ depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
+else
+ depmod -ae %{kversion} || exit 0
+fi
+
+%postun
+if [ -f /boot/System.map-%{kversion} ]; then
+ depmod -ae -F /boot/System.map-%{kversion} %{kversion} || exit 0
+else
+ depmod -ae %{kversion} || exit 0
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT