linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Add extended attributes to ext2/3
@ 2002-10-15  3:33 tytso
  2002-10-15  4:46 ` Andrew Morton
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: tytso @ 2002-10-15  3:33 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Linus,

	Enclosed please find patches to add extended attribute support
to the ext2 and ext3 filesystems.  It is a port of Andreas Gruenbacher's
patches, which have been quite well tested at this point.  Full support
for extended attributes have been in e2fsprogs for quite some time.  In
addition, if CONFIG_EXT[23]_FS_ATTR is not enabled, the code path
changes are quite minimal, and hence this should be a very low-risk
patch.  Please apply.

These patches are a prerequisite for the port of Andreas Gruenbacher's
ACL patches, which will follow shortly.

This first patch creates a generic interface for registering caches with
the VM subsystem so that they can react appropriately to memory
pressure.

						- Ted


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
#
# cache_def.h               |   15 +++++++++++++++
# include/linux/cache_def.h |   15 +++++++++++++++
# kernel/ksyms.c            |    3 +++
# mm/vmscan.c               |   35 +++++++++++++++++++++++++++++++++++
# 4 files changed, 68 insertions(+)
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/14	tytso@snap.thunk.org	1.783
# Port of (updated) 0.8.50 cache-def patch.  (Fixed to take the BKL where necessary)
# 
# --------------------------------------------
#
diff -Nru a/cache_def.h b/cache_def.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/cache_def.h	Mon Oct 14 23:20:54 2002
@@ -0,0 +1,15 @@
+/*
+ * linux/cache_def.h
+ * Handling of caches defined in drivers, filesystems, ...
+ *
+ * Copyright (C) 2002 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
+ */
+
+struct cache_definition {
+	const char *name;
+	void (*shrink)(int, unsigned int);
+	struct list_head link;
+};
+
+extern void register_cache(struct cache_definition *);
+extern void unregister_cache(struct cache_definition *);
diff -Nru a/include/linux/cache_def.h b/include/linux/cache_def.h
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ b/include/linux/cache_def.h	Mon Oct 14 23:20:54 2002
@@ -0,0 +1,15 @@
+/*
+ * linux/cache_def.h
+ * Handling of caches defined in drivers, filesystems, ...
+ *
+ * Copyright (C) 2002 by Andreas Gruenbacher, <a.gruenbacher@computer.org>
+ */
+
+struct cache_definition {
+	const char *name;
+	void (*shrink)(int, unsigned int);
+	struct list_head link;
+};
+
+extern void register_cache(struct cache_definition *);
+extern void unregister_cache(struct cache_definition *);
diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c
--- a/kernel/ksyms.c	Mon Oct 14 23:20:54 2002
+++ b/kernel/ksyms.c	Mon Oct 14 23:20:54 2002
@@ -31,6 +31,7 @@
 #include <linux/genhd.h>
 #include <linux/blkpg.h>
 #include <linux/swap.h>
+#include <linux/cache_def.h>
 #include <linux/ctype.h>
 #include <linux/file.h>
 #include <linux/iobuf.h>
@@ -103,6 +104,8 @@
 EXPORT_SYMBOL(kmem_cache_alloc);
 EXPORT_SYMBOL(kmem_cache_free);
 EXPORT_SYMBOL(kmem_cache_size);
+EXPORT_SYMBOL(register_cache);
+EXPORT_SYMBOL(unregister_cache);
 EXPORT_SYMBOL(kmalloc);
 EXPORT_SYMBOL(kfree);
 EXPORT_SYMBOL(vfree);
diff -Nru a/mm/vmscan.c b/mm/vmscan.c
--- a/mm/vmscan.c	Mon Oct 14 23:20:54 2002
+++ b/mm/vmscan.c	Mon Oct 14 23:20:54 2002
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/kernel_stat.h>
 #include <linux/swap.h>
+#include <linux/cache_def.h>
 #include <linux/pagemap.h>
 #include <linux/init.h>
 #include <linux/highmem.h>
@@ -76,6 +77,39 @@
 #define shrink_dqcache_memory(ratio, gfp_mask) do { } while (0)
 #endif
 
+static DECLARE_MUTEX(other_caches_sem);
+static LIST_HEAD(cache_definitions);
+
+void register_cache(struct cache_definition *cache)
+{
+	down(&other_caches_sem);
+	list_add(&cache->link, &cache_definitions);
+	up(&other_caches_sem);
+}
+
+void unregister_cache(struct cache_definition *cache)
+{
+	down(&other_caches_sem);
+	list_del(&cache->link);
+	up(&other_caches_sem);
+}
+
+static void shrink_other_caches(int ratio, int gfp_mask)
+{
+	struct list_head *p;
+
+	down(&other_caches_sem);
+	p = cache_definitions.prev;
+	while (p != &cache_definitions) {
+		struct cache_definition *cache =
+			list_entry(p, struct cache_definition, link);
+
+		cache->shrink(ratio, gfp_mask);
+		p = p->prev;
+	}
+	up(&other_caches_sem);
+}
+
 /* Must be called with page's pte_chain_lock held. */
 static inline int page_mapping_inuse(struct page * page)
 {
@@ -594,6 +628,7 @@
 	shrink_dcache_memory(shrink_ratio, gfp_mask);
 	shrink_icache_memory(shrink_ratio, gfp_mask);
 	shrink_dqcache_memory(shrink_ratio, gfp_mask);
+	shrink_other_caches(shrink_ratio, gfp_mask);
 }
 
 /*

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2002-10-15 16:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-15  3:33 [PATCH 1/4] Add extended attributes to ext2/3 tytso
2002-10-15  4:46 ` Andrew Morton
2002-10-15  5:04   ` Theodore Ts'o
2002-10-15  5:31   ` Andreas Dilger
2002-10-15 13:05     ` Theodore Ts'o
2002-10-15 10:26 ` Olaf Dietsche
2002-10-15 11:58 ` Christoph Hellwig
2002-10-15 13:15   ` Theodore Ts'o
2002-10-15 15:25     ` Christoph Hellwig
2002-10-15 15:31     ` Christoph Hellwig
2002-10-15 16:04       ` Andreas Dilger
2002-10-15 16:16         ` Christoph Hellwig
2002-10-15 16:21           ` Andreas Dilger
2002-10-15 16:43             ` Andreas Gruenbacher
2002-10-15 16:41       ` Theodore Ts'o
2002-10-15 16:59         ` Christoph Hellwig
2002-10-15 15:33     ` Christoph Hellwig
2002-10-15 15:34     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).