diff options
Diffstat (limited to 'vserver-sources/old/2.1.1_rc18-r1/4419_vs2.1.1-rc18-dent-feat02.patch')
-rw-r--r-- | vserver-sources/old/2.1.1_rc18-r1/4419_vs2.1.1-rc18-dent-feat02.patch | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/vserver-sources/old/2.1.1_rc18-r1/4419_vs2.1.1-rc18-dent-feat02.patch b/vserver-sources/old/2.1.1_rc18-r1/4419_vs2.1.1-rc18-dent-feat02.patch new file mode 100644 index 0000000..8dbf4d4 --- /dev/null +++ b/vserver-sources/old/2.1.1_rc18-r1/4419_vs2.1.1-rc18-dent-feat02.patch @@ -0,0 +1,150 @@ +Index: vserver-sources-2.6.16_2.1.1/fs/dcache.c +=================================================================== +--- vserver-sources-2.6.16_2.1.1.orig/fs/dcache.c ++++ vserver-sources-2.6.16_2.1.1/fs/dcache.c +@@ -33,6 +33,7 @@ + #include <linux/seqlock.h> + #include <linux/swap.h> + #include <linux/bootmem.h> ++#include <linux/vs_limit.h> + + /* #define DCACHE_DEBUG 1 */ + +@@ -161,6 +162,8 @@ repeat: + return; + } + ++ vx_dentry_dec(dentry); ++ + /* + * AV: ->d_delete() is _NOT_ allowed to block now. + */ +@@ -271,6 +274,7 @@ static inline struct dentry * __dget_loc + if (!list_empty(&dentry->d_lru)) { + dentry_stat.nr_unused--; + list_del_init(&dentry->d_lru); ++ vx_dentry_inc(dentry); + } + return dentry; + } +@@ -714,6 +718,9 @@ struct dentry *d_alloc(struct dentry * p + struct dentry *dentry; + char *dname; + ++ if (!vx_dentry_avail(1)) ++ return NULL; ++ + dentry = kmem_cache_alloc(dentry_cache, GFP_KERNEL); + if (!dentry) + return NULL; +@@ -762,6 +769,7 @@ struct dentry *d_alloc(struct dentry * p + if (parent) + list_add(&dentry->d_u.d_child, &parent->d_subdirs); + dentry_stat.nr_dentry++; ++ vx_dentry_inc(dentry); + spin_unlock(&dcache_lock); + + return dentry; +@@ -1089,6 +1097,7 @@ struct dentry * __d_lookup(struct dentry + + if (!d_unhashed(dentry)) { + atomic_inc(&dentry->d_count); ++ vx_dentry_inc(dentry); + found = dentry; + } + spin_unlock(&dentry->d_lock); +Index: vserver-sources-2.6.16_2.1.1/include/linux/vs_limit.h +=================================================================== +--- vserver-sources-2.6.16_2.1.1.orig/include/linux/vs_limit.h ++++ vserver-sources-2.6.16_2.1.1/include/linux/vs_limit.h +@@ -50,6 +50,7 @@ + #define vx_openfd_dec(f) \ + vx_acc_cres(current->vx_info,-1, (void *)(long)(f), VLIMIT_OPENFD) + ++ + #define vx_cres_avail(v,n,r) \ + __vx_cres_avail(v, r, n, __FILE__, __LINE__) + +@@ -67,6 +68,22 @@ + vx_cres_avail(current->vx_info, n, VLIMIT_OPENFD) + + ++/* dentry limits */ ++ ++#define vx_dentry_inc(d) do { \ ++ if (atomic_read(&d->d_count) == 1) \ ++ vx_acc_cres(current->vx_info, 1, d, VLIMIT_DENTRY); \ ++ } while (0) ++ ++#define vx_dentry_dec(d) do { \ ++ if (atomic_read(&d->d_count) == 0) \ ++ vx_acc_cres(current->vx_info,-1, d, VLIMIT_DENTRY); \ ++ } while (0) ++ ++#define vx_dentry_avail(n) \ ++ vx_cres_avail(current->vx_info, n, VLIMIT_DENTRY) ++ ++ + /* socket limits */ + + #define vx_sock_inc(s) \ +Index: vserver-sources-2.6.16_2.1.1/include/linux/vserver/limit.h +=================================================================== +--- vserver-sources-2.6.16_2.1.1.orig/include/linux/vserver/limit.h ++++ vserver-sources-2.6.16_2.1.1/include/linux/vserver/limit.h +@@ -8,6 +8,7 @@ + #define VLIMIT_SHMEM 19 + #define VLIMIT_SEMARY 20 + #define VLIMIT_NSEMS 21 ++#define VLIMIT_DENTRY 22 + + #ifdef __KERNEL__ + +Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/limit.c +=================================================================== +--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/limit.c ++++ vserver-sources-2.6.16_2.1.1/kernel/vserver/limit.c +@@ -35,6 +35,7 @@ const char *vlimit_name[NUM_LIMITS] = { + [VLIMIT_OPENFD] = "OPENFD", + [VLIMIT_ANON] = "ANON", + [VLIMIT_SHMEM] = "SHMEM", ++ [VLIMIT_DENTRY] = "DENTRY", + }; + + EXPORT_SYMBOL_GPL(vlimit_name); +@@ -57,6 +58,7 @@ static int is_valid_rlimit(int id) + case VLIMIT_OPENFD: + case VLIMIT_ANON: + case VLIMIT_SHMEM: ++ case VLIMIT_DENTRY: + valid = 1; + break; + } +@@ -206,6 +208,7 @@ int vc_get_rlimit_mask(uint32_t id, void + (1 << RLIMIT_LOCKS) | + (1 << RLIMIT_AS) | + (1 << VLIMIT_ANON) | ++ (1 << VLIMIT_DENTRY) | + 0 + }; + +Index: vserver-sources-2.6.16_2.1.1/kernel/vserver/limit_proc.h +=================================================================== +--- vserver-sources-2.6.16_2.1.1.orig/kernel/vserver/limit_proc.h ++++ vserver-sources-2.6.16_2.1.1/kernel/vserver/limit_proc.h +@@ -48,6 +48,7 @@ static inline int vx_info_proc_limit(str + "SHM" VX_LIMIT_FMT + "SEMA" VX_LIMIT_FMT + "SEMS" VX_LIMIT_FMT ++ "DENT" VX_LIMIT_FMT + VX_LIMIT_ARG(RLIMIT_NPROC) + VX_LIMIT_ARG(RLIMIT_AS) + VX_LIMIT_ARG(RLIMIT_MEMLOCK) +@@ -61,6 +62,7 @@ static inline int vx_info_proc_limit(str + VX_LIMIT_ARG(VLIMIT_SHMEM) + VX_LIMIT_ARG(VLIMIT_SEMARY) + VX_LIMIT_ARG(VLIMIT_NSEMS) ++ VX_LIMIT_ARG(VLIMIT_DENTRY) + ); + } + |