X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fkernel_patches%2Fpatches%2Fvfs-pdirops-2.4.20-rh.patch;h=d5459885449ad45022f8b1a40f9241faf8bdc0d4;hb=4dfe1cb9250d24497384e84b90771ff18613680d;hp=6ab7a21bdec21404365b0d5e93817a6d52ce0eb7;hpb=c5050e412572b00cbe93d8517d2d1f767bebfa92;p=fs%2Flustre-release.git diff --git a/lustre/kernel_patches/patches/vfs-pdirops-2.4.20-rh.patch b/lustre/kernel_patches/patches/vfs-pdirops-2.4.20-rh.patch index 6ab7a21..d545988 100644 --- a/lustre/kernel_patches/patches/vfs-pdirops-2.4.20-rh.patch +++ b/lustre/kernel_patches/patches/vfs-pdirops-2.4.20-rh.patch @@ -3,15 +3,15 @@ include/linux/fs.h | 11 ++++---- 3 files changed, 54 insertions(+), 24 deletions(-) -Index: linux-2.4.20-rh/fs/namei.c +Index: linux-2.4.24/fs/namei.c =================================================================== ---- linux-2.4.20-rh.orig/fs/namei.c 2003-09-04 20:58:33.000000000 +0800 -+++ linux-2.4.20-rh/fs/namei.c 2003-09-04 21:21:20.000000000 +0800 -@@ -101,6 +101,36 @@ - +--- linux-2.4.24.orig/fs/namei.c 2004-06-24 09:08:27.000000000 +0400 ++++ linux-2.4.24/fs/namei.c 2004-06-27 21:32:00.000000000 +0400 +@@ -103,6 +103,38 @@ } + EXPORT_SYMBOL(intent_release); -+static void *lock_dir(struct inode *dir, struct qstr *name) ++void *lock_dir(struct inode *dir, struct qstr *name) +{ + unsigned long hash; + @@ -31,8 +31,9 @@ Index: linux-2.4.20-rh/fs/namei.c + /* lock this hash */ + return dynlock_lock(&dir->i_dcache_lock, hash, 1, GFP_ATOMIC); +} ++EXPORT_SYMBOL(lock_dir); + -+static void unlock_dir(struct inode *dir, void *lock) ++void unlock_dir(struct inode *dir, void *lock) +{ + if (!IS_PDIROPS(dir)) { + up(&dir->i_sem); @@ -40,11 +41,12 @@ Index: linux-2.4.20-rh/fs/namei.c + } + dynlock_unlock(&dir->i_dcache_lock, lock); +} ++EXPORT_SYMBOL(unlock_dir); + /* In order to reduce some races, while at the same time doing additional * checking and hopefully speeding things up, we copy filenames to the * kernel data space before using them.. -@@ -303,10 +333,11 @@ +@@ -307,10 +339,11 @@ struct dentry * result; struct inode *dir = parent->d_inode; int counter = 0; @@ -57,7 +59,7 @@ Index: linux-2.4.20-rh/fs/namei.c /* * First re-do the cached lookup just in case it was created * while we waited for the directory semaphore.. -@@ -329,7 +359,7 @@ +@@ -334,7 +367,7 @@ else result = dentry; } @@ -66,7 +68,7 @@ Index: linux-2.4.20-rh/fs/namei.c return result; } -@@ -337,7 +367,7 @@ +@@ -342,7 +375,7 @@ * Uhhuh! Nasty case: the cache was re-populated while * we waited on the semaphore. Need to revalidate. */ @@ -75,13 +77,13 @@ Index: linux-2.4.20-rh/fs/namei.c if (result->d_op && result->d_op->d_revalidate) { if (!result->d_op->d_revalidate(result, flags) && !d_invalidate(result)) { dput(result); -@@ -1180,13 +1210,13 @@ +@@ -1174,13 +1207,13 @@ goto exit; dir = nd->dentry; - down(&dir->d_inode->i_sem); + nd->lock = lock_dir(dir->d_inode, &nd->last); - dentry = lookup_hash_it(&nd->last, nd->dentry, it); + dentry = lookup_hash_it(&nd->last, nd->dentry, nd, it); do_last: error = PTR_ERR(dentry); @@ -91,7 +93,7 @@ Index: linux-2.4.20-rh/fs/namei.c goto exit; } -@@ -1195,7 +1225,7 @@ +@@ -1189,7 +1222,7 @@ if (!dentry->d_inode) { error = vfs_create_it(dir->d_inode, dentry, mode & ~current->fs->umask, it); @@ -100,7 +102,7 @@ Index: linux-2.4.20-rh/fs/namei.c dput(nd->dentry); nd->dentry = dentry; if (error) -@@ -1209,7 +1239,7 @@ +@@ -1203,7 +1236,7 @@ /* * It already exists. */ @@ -109,16 +111,16 @@ Index: linux-2.4.20-rh/fs/namei.c error = -EEXIST; if (flag & O_EXCL) -@@ -1362,7 +1392,7 @@ +@@ -1350,7 +1383,7 @@ goto exit; } dir = nd->dentry; - down(&dir->d_inode->i_sem); + nd->lock = lock_dir(dir->d_inode, &nd->last); - dentry = lookup_hash_it(&nd->last, nd->dentry, it); + dentry = lookup_hash_it(&nd->last, nd->dentry, nd, it); putname(nd->last.name); goto do_last; -@@ -1380,7 +1410,7 @@ +@@ -1368,7 +1401,7 @@ { struct dentry *dentry; @@ -127,7 +129,7 @@ Index: linux-2.4.20-rh/fs/namei.c dentry = ERR_PTR(-EEXIST); if (nd->last_type != LAST_NORM) goto fail; -@@ -1469,7 +1499,7 @@ +@@ -1461,7 +1494,7 @@ } dput(dentry); } @@ -136,7 +138,7 @@ Index: linux-2.4.20-rh/fs/namei.c out2: path_release(&nd); out: -@@ -1532,7 +1562,7 @@ +@@ -1528,7 +1561,7 @@ mode & ~current->fs->umask); dput(dentry); } @@ -145,13 +147,13 @@ Index: linux-2.4.20-rh/fs/namei.c out2: path_release(&nd); out: -@@ -1642,14 +1672,14 @@ +@@ -1638,14 +1671,14 @@ if (error != -EOPNOTSUPP) goto exit1; } - down(&nd.dentry->d_inode->i_sem); + nd.lock = lock_dir(nd.dentry->d_inode, &nd.last); - dentry = lookup_hash_it(&nd.last, nd.dentry, NULL); + dentry = lookup_hash_it(&nd.last, nd.dentry, &nd, NULL); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { error = vfs_rmdir(nd.dentry->d_inode, dentry); @@ -162,16 +164,16 @@ Index: linux-2.4.20-rh/fs/namei.c exit1: path_release(&nd); exit: -@@ -1708,7 +1738,7 @@ +@@ -1704,7 +1737,7 @@ if (error != -EOPNOTSUPP) goto exit1; } - down(&nd.dentry->d_inode->i_sem); + nd.lock = lock_dir(nd.dentry->d_inode, &nd.last); - dentry = lookup_hash_it(&nd.last, nd.dentry, NULL); + dentry = lookup_hash_it(&nd.last, nd.dentry, &nd, NULL); error = PTR_ERR(dentry); if (!IS_ERR(dentry)) { -@@ -1719,7 +1749,7 @@ +@@ -1715,7 +1748,7 @@ exit2: dput(dentry); } @@ -180,7 +182,7 @@ Index: linux-2.4.20-rh/fs/namei.c exit1: path_release(&nd); exit: -@@ -1789,7 +1819,7 @@ +@@ -1789,7 +1822,7 @@ error = vfs_symlink(nd.dentry->d_inode, dentry, from); dput(dentry); } @@ -189,7 +191,7 @@ Index: linux-2.4.20-rh/fs/namei.c out2: path_release(&nd); out: -@@ -1881,7 +1911,7 @@ +@@ -1885,7 +1918,7 @@ error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry); dput(new_dentry); } @@ -198,10 +200,22 @@ Index: linux-2.4.20-rh/fs/namei.c out_release: path_release(&nd); out: -Index: linux-2.4.20-rh/include/linux/fs.h +Index: linux-2.4.24/fs/inode.c +=================================================================== +--- linux-2.4.24.orig/fs/inode.c 2004-06-24 09:08:27.000000000 +0400 ++++ linux-2.4.24/fs/inode.c 2004-06-24 09:08:29.000000000 +0400 +@@ -119,6 +119,7 @@ + mapping->host = inode; + mapping->gfp_mask = GFP_HIGHUSER; + inode->i_mapping = mapping; ++ dynlock_init(&inode->i_dcache_lock); + } + return inode; + } +Index: linux-2.4.24/include/linux/fs.h =================================================================== ---- linux-2.4.20-rh.orig/include/linux/fs.h 2003-09-04 20:59:14.000000000 +0800 -+++ linux-2.4.20-rh/include/linux/fs.h 2003-09-04 21:03:46.000000000 +0800 +--- linux-2.4.24.orig/include/linux/fs.h 2004-06-24 09:08:29.000000000 +0400 ++++ linux-2.4.24/include/linux/fs.h 2004-06-24 09:08:29.000000000 +0400 @@ -21,6 +21,7 @@ #include #include @@ -210,7 +224,7 @@ Index: linux-2.4.20-rh/include/linux/fs.h #include #include -@@ -136,6 +137,7 @@ +@@ -139,6 +140,7 @@ #define S_IMMUTABLE 16 /* Immutable file */ #define S_DEAD 32 /* removed, but still open directory */ #define S_NOQUOTA 64 /* Inode is not counted to quota */ @@ -218,7 +232,7 @@ Index: linux-2.4.20-rh/include/linux/fs.h /* * Note that nosuid etc flags are inode-specific: setting some file-system -@@ -162,6 +164,7 @@ +@@ -165,6 +167,7 @@ #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) #define IS_NOATIME(inode) (__IS_FLG(inode, MS_NOATIME) || ((inode)->i_flags & S_NOATIME)) #define IS_NODIRATIME(inode) __IS_FLG(inode, MS_NODIRATIME) @@ -226,7 +240,7 @@ Index: linux-2.4.20-rh/include/linux/fs.h #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) -@@ -489,6 +492,7 @@ +@@ -500,6 +503,7 @@ atomic_t i_writecount; unsigned int i_attr_flags; __u32 i_generation; @@ -234,7 +248,7 @@ Index: linux-2.4.20-rh/include/linux/fs.h union { struct minix_inode_info minix_i; struct ext2_inode_info ext2_i; -@@ -708,6 +712,7 @@ +@@ -714,6 +718,7 @@ unsigned int flags; int last_type; struct lookup_intent *intent; @@ -242,7 +256,7 @@ Index: linux-2.4.20-rh/include/linux/fs.h }; /* -@@ -1621,12 +1626,6 @@ +@@ -1629,12 +1634,6 @@ return dget(dentry->d_parent); } @@ -255,15 +269,3 @@ Index: linux-2.4.20-rh/include/linux/fs.h /* * Whee.. Deadlock country. Happily there are only two VFS * operations that does this.. -Index: linux-2.4.20-rh/fs/inode.c -=================================================================== ---- linux-2.4.20-rh.orig/fs/inode.c 2003-09-04 20:58:35.000000000 +0800 -+++ linux-2.4.20-rh/fs/inode.c 2003-09-04 21:03:46.000000000 +0800 -@@ -121,6 +121,7 @@ - mapping->host = inode; - mapping->gfp_mask = GFP_HIGHUSER; - inode->i_mapping = mapping; -+ dynlock_init(&inode->i_dcache_lock); - } - return inode; - }