SOURCES: kernel-lustre.config (NEW), kernel-lustre_version.patch (...

matkor matkor at pld-linux.org
Mon Dec 31 16:23:48 CET 2007


Author: matkor                       Date: Mon Dec 31 15:23:48 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- Sources and config for lustre.

---- Files affected:
SOURCES:
   kernel-lustre.config (NONE -> 1.1)  (NEW), kernel-lustre_version.patch (NONE -> 1.1)  (NEW), kernel-vfs_races-2.6.20-vanilla.patch (NONE -> 1.1)  (NEW), kernel-i_filter_data.patch (NONE -> 1.1)  (NEW), kernel-jbd-jcberr-2.6.18-vanilla.patch (NONE -> 1.1)  (NEW), kernel-iopen-misc-2.6.20-vanilla.patch (NONE -> 1.1)  (NEW), kernel-export-truncate-2.6.18-vanilla.patch (NONE -> 1.1)  (NEW), kernel-export_symbols-2.6.20-vanilla.patch (NONE -> 1.1)  (NEW), kernel-dev_read_only-2.6.20-vanilla.patch (NONE -> 1.1)  (NEW), kernel-export-2.6.18-vanilla.patch (NONE -> 1.1)  (NEW), kernel-8kstack-2.6.12.patch (NONE -> 1.1)  (NEW), kernel-export-show_task-2.6.18-vanilla.patch (NONE -> 1.1)  (NEW), kernel-sd_iostats-2.6.22.patch (NONE -> 1.1)  (NEW), kernel-LDISKFS_SUPER_MAGIC-2.6.20.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/kernel-lustre.config
diff -u /dev/null SOURCES/kernel-lustre.config:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-lustre.config	Mon Dec 31 16:23:42 2007
@@ -0,0 +1,6 @@
+#
+# lustre support
+#
+# CONFIG_SCSI_SCAN_ASYNC=y
+CONFIG_SD_IOSTATS=y
+

================================================================
Index: SOURCES/kernel-lustre_version.patch
diff -u /dev/null SOURCES/kernel-lustre_version.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-lustre_version.patch	Mon Dec 31 16:23:42 2007
@@ -0,0 +1,26 @@
+Version 47: allow the ext3_map_inode_page() created param to be NULL
+Version 46: Separate ->fs_private in struct file
+Version 45: more robust and general dev_read_only for failover (b=4834)  
+Version 44: fix link_path_walk_it() oops creating .foo in deleted "." (b=5548)
+Version 43: fix remove_suid to not crash 2.6, and do anything on 2.4 (b=5695)
+Version 42: export show_task()
+Version 41: revalidate should check working dir is a directory (b=4134)
+Version 40: >32000 subdirectories support for ext3 (b=3244)
+Version 39: add EXPORT_SYMBOL(smp_num_siblings) to vanilla-2.4.24 (b=3966)
+            eebperf (unfragmented 1MB write/read support)
+            48-bit physical block support for extents
+Version 38: drop dentry ref in ext3_add_link from open_connect_dentry (b=3266)
+Version 37: fix htree rename-within-same-dir (b=3417), endianness (b=2447)
+Version 36: don't dput dentry after error (b=2350), zero page->private (3119)
+Version 35: pass intent to real_lookup after revalidate failure (b=3285)
+Version 34: ext3 iopen assertion (b=2517), operations on deleted "." (b=2399)
+
+ include/linux/lustre_version.h |    1 +
+ 1 files changed, 1 insertion(+)
+
+--- /dev/null	Fri Aug 30 17:31:37 2002
++++ linux-2.4.18-18.8.0-l12-braam/include/linux/lustre_version.h	Thu Feb 13 07:58:33 2003
+@@ -0,0 +1 @@
++#define LUSTRE_KERNEL_VERSION 47
+
+_

================================================================
Index: SOURCES/kernel-vfs_races-2.6.20-vanilla.patch
diff -u /dev/null SOURCES/kernel-vfs_races-2.6.20-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-vfs_races-2.6.20-vanilla.patch	Mon Dec 31 16:23:42 2007
@@ -0,0 +1,57 @@
+Index: linux-2.6.20.3/fs/dcache.c
+===================================================================
+--- linux-2.6.20.3.orig/fs/dcache.c	2007-08-14 18:10:44.000000000 +0200
++++ linux-2.6.20.3/fs/dcache.c	2007-08-14 18:17:16.000000000 +0200
+@@ -235,6 +235,13 @@
+ 		spin_unlock(&dcache_lock);
+ 		return 0;
+ 	}
++
++	/* network invalidation by Lustre */
++	if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
++		spin_unlock(&dcache_lock);
++		return 0;
++	}
++
+ 	/*
+ 	 * Check whether to do a partial shrink_dcache
+ 	 * to get rid of unused child entries.
+@@ -1412,13 +1419,22 @@
+  * Adds a dentry to the hash according to its name.
+  */
+  
+-void d_rehash(struct dentry * entry)
++void d_rehash_cond(struct dentry * entry, int lock)
+ {
+-	spin_lock(&dcache_lock);
++	if (lock)
++		spin_lock(&dcache_lock);
+ 	spin_lock(&entry->d_lock);
+ 	_d_rehash(entry);
+ 	spin_unlock(&entry->d_lock);
+-	spin_unlock(&dcache_lock);
++	if (lock)
++		spin_unlock(&dcache_lock);
++}
++
++EXPORT_SYMBOL(d_rehash_cond);
++
++void d_rehash(struct dentry * entry)
++{
++	d_rehash_cond(entry, 1);
+ }
+ 
+ #define do_switch(x,y) do { \
+Index: linux-2.6.20.3/include/linux/dcache.h
+===================================================================
+--- linux-2.6.20.3.orig/include/linux/dcache.h	2007-08-14 18:10:44.000000000 +0200
++++ linux-2.6.20.3/include/linux/dcache.h	2007-08-14 18:17:16.000000000 +0200
+@@ -173,6 +173,8 @@
+ 
+ #define DCACHE_REFERENCED	0x0008  /* Recently used, don't discard. */
+ #define DCACHE_UNHASHED		0x0010	
++#define DCACHE_LUSTRE_INVALID     0x0040  /* Lustre invalidated */
++
+ 
+ #define DCACHE_INOTIFY_PARENT_WATCHED	0x0020 /* Parent inode is watched */
+ 

================================================================
Index: SOURCES/kernel-i_filter_data.patch
diff -u /dev/null SOURCES/kernel-i_filter_data.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-i_filter_data.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,12 @@
+Index: linux-2.6.18.8/include/linux/fs.h
+===================================================================
+--- linux-2.6.18.8.orig/include/linux/fs.h	2007-06-05 12:55:19.000000000 +0200
++++ linux-2.6.18.8/include/linux/fs.h	2007-06-05 12:55:44.000000000 +0200
+@@ -533,6 +533,7 @@ struct inode {
+ 	struct block_device	*i_bdev;
+ 	struct cdev		*i_cdev;
+ 	int			i_cindex;
++	void                    *i_filterdata;
+ 
+ 	__u32			i_generation;
+ 

================================================================
Index: SOURCES/kernel-jbd-jcberr-2.6.18-vanilla.patch
diff -u /dev/null SOURCES/kernel-jbd-jcberr-2.6.18-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-jbd-jcberr-2.6.18-vanilla.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,228 @@
+Index: linux-2.6/include/linux/jbd.h
+===================================================================
+--- linux-2.6.orig/include/linux/jbd.h	2006-07-15 16:08:35.000000000 +0800
++++ linux-2.6/include/linux/jbd.h	2006-07-15 16:13:01.000000000 +0800
+@@ -356,6 +356,27 @@ static inline void jbd_unlock_bh_journal
+ 	bit_spin_unlock(BH_JournalHead, &bh->b_state);
+ }
+ 
++#define HAVE_JOURNAL_CALLBACK_STATUS
++/**
++ *   struct journal_callback - Base structure for callback information.
++ *   @jcb_list: list information for other callbacks attached to the same handle.
++ *   @jcb_func: Function to call with this callback structure. 
++ *
++ *   This struct is a 'seed' structure for a using with your own callback
++ *   structs. If you are using callbacks you must allocate one of these
++ *   or another struct of your own definition which has this struct 
++ *   as it's first element and pass it to journal_callback_set().
++ *
++ *   This is used internally by jbd to maintain callback information.
++ *
++ *   See journal_callback_set for more information.
++ **/
++struct journal_callback {
++	struct list_head jcb_list;		/* t_jcb_lock */
++	void (*jcb_func)(struct journal_callback *jcb, int error);
++	/* user data goes here */
++};
++
+ struct jbd_revoke_table_s;
+ 
+ /**
+@@ -364,6 +385,7 @@ struct jbd_revoke_table_s;
+  * @h_transaction: Which compound transaction is this update a part of?
+  * @h_buffer_credits: Number of remaining buffers we are allowed to dirty.
+  * @h_ref: Reference count on this handle
++ * @h_jcb: List of application registered callbacks for this handle.
+  * @h_err: Field for caller's use to track errors through large fs operations
+  * @h_sync: flag for sync-on-close
+  * @h_jdata: flag to force data journaling
+@@ -389,6 +411,13 @@ struct handle_s 
+ 	/* operations */
+ 	int			h_err;
+ 
++	/*
++	 * List of application registered callbacks for this handle. The
++	 * function(s) will be called after the transaction that this handle is
++	 * part of has been committed to disk. [t_jcb_lock]
++	 */
++	struct list_head	h_jcb;
++
+ 	/* Flags [no locking] */
+ 	unsigned int	h_sync:		1;	/* sync-on-close */
+ 	unsigned int	h_jdata:	1;	/* force data journaling */
+@@ -430,6 +459,8 @@ struct handle_s 
+  *    j_state_lock
+  *    ->j_list_lock			(journal_unmap_buffer)
+  *
++ *    t_handle_lock
++ *    ->t_jcb_lock
+  */
+ 
+ struct transaction_s 
+@@ -559,6 +590,15 @@ struct transaction_s 
+ 	 */
+ 	int t_handle_count;
+ 
++	/*
++	 * Protects the callback list
++	 */
++	spinlock_t		t_jcb_lock;
++	/*
++	 * List of registered callback functions for this transaction.
++	 * Called when the transaction is committed. [t_jcb_lock]
++	 */
++	struct list_head	t_jcb;
+ };
+ 
+ /**
+@@ -906,6 +946,10 @@ extern void	 journal_invalidatepage(jour
+ extern int	 journal_try_to_free_buffers(journal_t *, struct page *, gfp_t);
+ extern int	 journal_stop(handle_t *);
+ extern int	 journal_flush (journal_t *);
++extern void	 journal_callback_set(handle_t *handle,
++				      void (*fn)(struct journal_callback *,int),
++				      struct journal_callback *jcb);
++
+ extern void	 journal_lock_updates (journal_t *);
+ extern void	 journal_unlock_updates (journal_t *);
+ 
+Index: linux-2.6/fs/jbd/checkpoint.c
+===================================================================
+--- linux-2.6.orig/fs/jbd/checkpoint.c	2006-07-15 16:08:36.000000000 +0800
++++ linux-2.6/fs/jbd/checkpoint.c	2006-07-15 16:13:01.000000000 +0800
+@@ -688,6 +688,7 @@ void __journal_drop_transaction(journal_
+ 	J_ASSERT(transaction->t_checkpoint_list == NULL);
+ 	J_ASSERT(transaction->t_checkpoint_io_list == NULL);
+ 	J_ASSERT(transaction->t_updates == 0);
++	J_ASSERT(list_empty(&transaction->t_jcb));
+ 	J_ASSERT(journal->j_committing_transaction != transaction);
+ 	J_ASSERT(journal->j_running_transaction != transaction);
+ 
+Index: linux-2.6/fs/jbd/commit.c
+===================================================================
+--- linux-2.6.orig/fs/jbd/commit.c	2006-07-15 16:08:36.000000000 +0800
++++ linux-2.6/fs/jbd/commit.c	2006-07-15 16:13:01.000000000 +0800
+@@ -708,6 +708,30 @@ wait_for_iobuf:
+            transaction can be removed from any checkpoint list it was on
+            before. */
+ 
++	/*
++	 * Call any callbacks that had been registered for handles in this
++	 * transaction.  It is up to the callback to free any allocated
++	 * memory.
++	 *
++	 * The spinlocking (t_jcb_lock) here is surely unnecessary...
++	 */
++	spin_lock(&commit_transaction->t_jcb_lock);
++	if (!list_empty(&commit_transaction->t_jcb)) {
++		struct list_head *p, *n;
++		int error = is_journal_aborted(journal);
++
++		list_for_each_safe(p, n, &commit_transaction->t_jcb) {
++			struct journal_callback *jcb;
++
++			jcb = list_entry(p, struct journal_callback, jcb_list);
++			list_del(p);
++			spin_unlock(&commit_transaction->t_jcb_lock);
++			jcb->jcb_func(jcb, error);
++			spin_lock(&commit_transaction->t_jcb_lock);
++		}
++	}
++	spin_unlock(&commit_transaction->t_jcb_lock);
++
+ 	jbd_debug(3, "JBD: commit phase 7\n");
+ 
+ 	J_ASSERT(commit_transaction->t_sync_datalist == NULL);
+Index: linux-2.6/fs/jbd/journal.c
+===================================================================
+--- linux-2.6.orig/fs/jbd/journal.c	2006-07-15 16:08:36.000000000 +0800
++++ linux-2.6/fs/jbd/journal.c	2006-07-15 16:13:01.000000000 +0800
+@@ -58,6 +58,7 @@ EXPORT_SYMBOL(journal_sync_buffer);
+ #endif
+ EXPORT_SYMBOL(journal_flush);
+ EXPORT_SYMBOL(journal_revoke);
++EXPORT_SYMBOL(journal_callback_set);
+ 
+ EXPORT_SYMBOL(journal_init_dev);
+ EXPORT_SYMBOL(journal_init_inode);
+@@ -80,6 +81,7 @@ EXPORT_SYMBOL(journal_wipe);
+ EXPORT_SYMBOL(journal_blocks_per_page);
+ EXPORT_SYMBOL(journal_invalidatepage);
+ EXPORT_SYMBOL(journal_try_to_free_buffers);
++EXPORT_SYMBOL(journal_bmap);
+ EXPORT_SYMBOL(journal_force_commit);
+ 
+ static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *);
+Index: linux-2.6/fs/jbd/transaction.c
+===================================================================
+--- linux-2.6.orig/fs/jbd/transaction.c	2006-07-15 16:08:35.000000000 +0800
++++ linux-2.6/fs/jbd/transaction.c	2006-07-15 16:13:01.000000000 +0800
+@@ -50,7 +50,9 @@ get_transaction(journal_t *journal, tran
+ 	transaction->t_state = T_RUNNING;
+ 	transaction->t_tid = journal->j_transaction_sequence++;
+ 	transaction->t_expires = jiffies + journal->j_commit_interval;
++	INIT_LIST_HEAD(&transaction->t_jcb);
+ 	spin_lock_init(&transaction->t_handle_lock);
++	spin_lock_init(&transaction->t_jcb_lock);
+ 
+ 	/* Set up the commit timer for the new transaction. */
+ 	journal->j_commit_timer.expires = transaction->t_expires;
+@@ -241,6 +243,7 @@ static handle_t *new_handle(int nblocks)
+ 	memset(handle, 0, sizeof(*handle));
+ 	handle->h_buffer_credits = nblocks;
+ 	handle->h_ref = 1;
++	INIT_LIST_HEAD(&handle->h_jcb);
+ 
+ 	return handle;
+ }
+@@ -1291,6 +1294,36 @@ drop:
+ }
+ 
+ /**
++ * void journal_callback_set() -  Register a callback function for this handle.
++ * @handle: handle to attach the callback to.
++ * @func: function to callback.
++ * @jcb:  structure with additional information required by func() , and
++ *        some space for jbd internal information.
++ * 
++ * The function will be
++ * called when the transaction that this handle is part of has been
++ * committed to disk with the original callback data struct and the
++ * error status of the journal as parameters.  There is no guarantee of
++ * ordering between handles within a single transaction, nor between
++ * callbacks registered on the same handle.
++ *
++ * The caller is responsible for allocating the journal_callback struct.
++ * This is to allow the caller to add as much extra data to the callback
++ * as needed, but reduce the overhead of multiple allocations.  The caller
++ * allocated struct must start with a struct journal_callback at offset 0,
++ * and has the caller-specific data afterwards.
++ */
++void journal_callback_set(handle_t *handle,
++			void (*func)(struct journal_callback *jcb, int error),
++			struct journal_callback *jcb)
++{
++	spin_lock(&handle->h_transaction->t_jcb_lock);
++	list_add_tail(&jcb->jcb_list, &handle->h_jcb);
++	spin_unlock(&handle->h_transaction->t_jcb_lock);
++	jcb->jcb_func = func;
++}
++
++/**
+  * int journal_stop() - complete a transaction
+  * @handle: tranaction to complete.
+  * 
+@@ -1363,6 +1396,11 @@ int journal_stop(handle_t *handle)
+ 			wake_up(&journal->j_wait_transaction_locked);
+ 	}
+ 
++	/* Move callbacks from the handle to the transaction. */
++	spin_lock(&transaction->t_jcb_lock);
++	list_splice(&handle->h_jcb, &transaction->t_jcb);
++	spin_unlock(&transaction->t_jcb_lock);
++
+ 	/*
+ 	 * If the handle is marked SYNC, we need to set another commit
+ 	 * going!  We also want to force a commit if the current

================================================================
Index: SOURCES/kernel-iopen-misc-2.6.20-vanilla.patch
diff -u /dev/null SOURCES/kernel-iopen-misc-2.6.20-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-iopen-misc-2.6.20-vanilla.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,47 @@
+Index: linux-2.6.20.3/Documentation/filesystems/ext2.txt
+===================================================================
+--- linux-2.6.20.3.orig/Documentation/filesystems/ext2.txt	2007-08-14 18:31:47.000000000 +0200
++++ linux-2.6.20.3/Documentation/filesystems/ext2.txt	2007-08-14 18:37:41.000000000 +0200
+@@ -58,6 +58,22 @@
+ 
+ xip				Use execute in place (no caching) if possible
+ 
++iopen				Makes an invisible pseudo-directory called
++				__iopen__ available in the root directory
++				of the filesystem.  Allows open-by-inode-
++				number.  i.e., inode 3145 can be accessed
++				via /mntpt/__iopen__/3145
++
++iopen_nopriv			This option makes the iopen directory be
++				world-readable.  This may be safer since it
++				allows daemons to run as an unprivileged user,
++				however it significantly changes the security
++				model of a Unix filesystem, since previously
++				all files under a mode 700 directory were not
++				generally avilable even if the
++				permissions on the file itself is
++				world-readable.
++
+ grpquota,noquota,quota,usrquota	Quota options are silently ignored by ext2.
+ 
+ 
+Index: linux-2.6.20.3/include/linux/dcache.h
+===================================================================
+--- linux-2.6.20.3.orig/include/linux/dcache.h	2007-08-14 18:31:47.000000000 +0200
++++ linux-2.6.20.3/include/linux/dcache.h	2007-08-14 18:37:41.000000000 +0200
+@@ -251,6 +251,7 @@
+  * This adds the entry to the hash queues.
+  */
+ extern void d_rehash(struct dentry *);
++extern void d_rehash_cond(struct dentry *, int lock);
+ 
+ /**
+  * d_add - add dentry to hash queues
+@@ -286,6 +287,7 @@
+ 
+ /* used for rename() and baskets */
+ extern void d_move(struct dentry *, struct dentry *);
++extern void d_move_locked(struct dentry *, struct dentry *);
+ 
+ /* appendix may either be NULL or be used for transname suffixes */
+ extern struct dentry * d_lookup(struct dentry *, struct qstr *);

================================================================
Index: SOURCES/kernel-export-truncate-2.6.18-vanilla.patch
diff -u /dev/null SOURCES/kernel-export-truncate-2.6.18-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-export-truncate-2.6.18-vanilla.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,39 @@
+ include/linux/mm.h |    2 ++
+ mm/truncate.c      |    4 ++--
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+Index: linux-2.6/include/linux/mm.h
+===================================================================
+--- linux-2.6.orig/include/linux/mm.h	2006-07-06 23:41:48.000000000 +0800
++++ linux-2.6/include/linux/mm.h	2006-07-15 12:55:07.000000000 +0800
+@@ -529,6 +529,8 @@ static __always_inline void *lowmem_page
+ {
+ 	return __va(page_to_pfn(page) << PAGE_SHIFT);
+ }
++/* truncate.c */
++extern void truncate_complete_page(struct address_space *mapping,struct page *);
+ 
+ #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
+ #define HASHED_PAGE_VIRTUAL
+Index: linux-2.6/mm/truncate.c
+===================================================================
+--- linux-2.6.orig/mm/truncate.c	2006-06-24 14:22:39.000000000 +0800
++++ linux-2.6/mm/truncate.c	2006-07-15 12:55:07.000000000 +0800
+@@ -33,7 +33,7 @@ static inline void truncate_partial_page
+  * its lock, b) when a concurrent invalidate_inode_pages got there first and
+  * c) when tmpfs swizzles a page between a tmpfs inode and swapper_space.
+  */
+-static void
++void
+ truncate_complete_page(struct address_space *mapping, struct page *page)
+ {
+ 	if (page->mapping != mapping)
+@@ -48,7 +48,7 @@ truncate_complete_page(struct address_sp
+ 	remove_from_page_cache(page);
+ 	page_cache_release(page);	/* pagecache ref */
+ }
+-
++EXPORT_SYMBOL_GPL(truncate_complete_page);
+ /*
+  * This is for invalidate_inode_pages().  That function can be called at
+  * any time, and is not supposed to throw away dirty pages.  But pages can

================================================================
Index: SOURCES/kernel-export_symbols-2.6.20-vanilla.patch
diff -u /dev/null SOURCES/kernel-export_symbols-2.6.20-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:48 2007
+++ SOURCES/kernel-export_symbols-2.6.20-vanilla.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,69 @@
+Index: linux-2.6.20.3/fs/filesystems.c
+===================================================================
+--- linux-2.6.20.3.orig/fs/filesystems.c	2007-08-15 20:12:11.000000000 +0200
++++ linux-2.6.20.3/fs/filesystems.c	2007-08-15 20:12:26.000000000 +0200
+@@ -29,7 +29,9 @@
+  */
+ 
+ static struct file_system_type *file_systems;
+-static DEFINE_RWLOCK(file_systems_lock);
++DEFINE_RWLOCK(file_systems_lock);
++
++EXPORT_SYMBOL(file_systems_lock);
+ 
+ /* WARNING: This can be used only if we _already_ own a reference */
+ void get_filesystem(struct file_system_type *fs)
+Index: linux-2.6.20.3/include/linux/fs.h
+===================================================================
+--- linux-2.6.20.3.orig/include/linux/fs.h	2007-08-15 20:12:12.000000000 +0200
++++ linux-2.6.20.3/include/linux/fs.h	2007-08-15 20:15:06.000000000 +0200
+@@ -1813,6 +1813,7 @@
+ 
+ extern const struct file_operations generic_ro_fops;
+ 
++extern rwlock_t file_systems_lock;
+ #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
+ 
+ extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
+Index: linux-2.6.20.3/fs/namespace.c
+===================================================================
+--- linux-2.6.20.3.orig/fs/namespace.c	2007-08-15 20:12:12.000000000 +0200
++++ linux-2.6.20.3/fs/namespace.c	2007-08-15 20:12:26.000000000 +0200
+@@ -1627,6 +1627,7 @@
+ 		mntput(old_pwdmnt);
+ 	}
+ }
++EXPORT_SYMBOL(set_fs_pwd);
+ 
+ static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd)
+ {
+Index: linux-2.6.20.3/fs/dcache.c
+===================================================================
+--- linux-2.6.20.3.orig/fs/dcache.c	2007-08-15 20:12:11.000000000 +0200
++++ linux-2.6.20.3/fs/dcache.c	2007-08-15 20:16:42.000000000 +0200
+@@ -1508,7 +1508,7 @@
+  * Update the dcache to reflect the move of a file name. Negative
+  * dcache entries should not be moved in this way.
+  */
+-static void d_move_locked(struct dentry * dentry, struct dentry * target)
++void d_move_locked(struct dentry * dentry, struct dentry * target)
+ {
+ 	struct hlist_head *list;
+ 
+@@ -1567,6 +1567,8 @@
+ 	write_sequnlock(&rename_lock);
+ }
+ 
++EXPORT_SYMBOL(d_move_locked);
++
+ /**
+  * d_move - move a dentry
+  * @dentry: entry to move
+@@ -1966,6 +1968,7 @@
+ 
+ 	return result;
+ }
++EXPORT_SYMBOL(is_subdir);
+ 
+ void d_genocide(struct dentry *root)
+ {

================================================================
Index: SOURCES/kernel-dev_read_only-2.6.20-vanilla.patch
diff -u /dev/null SOURCES/kernel-dev_read_only-2.6.20-vanilla.patch:1.1
--- /dev/null	Mon Dec 31 16:23:49 2007
+++ SOURCES/kernel-dev_read_only-2.6.20-vanilla.patch	Mon Dec 31 16:23:43 2007
@@ -0,0 +1,145 @@
+Index: linux-2.6.20.3/block/ll_rw_blk.c
+===================================================================
+--- linux-2.6.20.3.orig/block/ll_rw_blk.c	2007-03-13 19:27:08.000000000 +0100
++++ linux-2.6.20.3/block/ll_rw_blk.c	2007-08-14 18:43:14.000000000 +0200
+@@ -3090,6 +3090,8 @@
+ 
+ #endif /* CONFIG_FAIL_MAKE_REQUEST */
+ 
++int dev_check_rdonly(struct block_device *bdev);
++
+ /**
+  * generic_make_request: hand a buffer to its device driver for I/O
+  * @bio:  The bio describing the location in memory and on the device.
+@@ -3174,6 +3176,12 @@
+ 
+ 		if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
+ 			goto end_io;
++		/* this is cfs's dev_rdonly check */
++		if (bio->bi_rw == WRITE &&
++				dev_check_rdonly(bio->bi_bdev)) {
++			bio_endio(bio, bio->bi_size, 0);
++			break;
++		}
+ 
+ 		if (should_fail_request(bio))
+ 			goto end_io;
+@@ -3788,6 +3796,91 @@
+ 	*ioc2 = temp;
+ }
+ EXPORT_SYMBOL(swap_io_context);
++ /*
++ * Debug code for turning block devices "read-only" (will discard writes
++ * silently).  This is for filesystem crash/recovery testing.
++ */
++struct deventry {
++	dev_t dev;
++	struct deventry *next;
++};
++
++static struct deventry *devlist = NULL;
++static spinlock_t devlock = SPIN_LOCK_UNLOCKED; 
++
++int dev_check_rdonly(struct block_device *bdev) 
++{
++	struct deventry *cur;
++	if (!bdev) return 0;
++	spin_lock(&devlock);
++	cur = devlist;
++	while(cur) {
++		if (bdev->bd_dev == cur->dev) {
++			spin_unlock(&devlock);
++			return 1;
++	}
++		cur = cur->next;
++	}
++	spin_unlock(&devlock);
++	return 0;
++}
++
<<Diff was trimmed, longer than 597 lines>>


More information about the pld-cvs-commit mailing list