Re: 2.6.17-rc4-mm1

Ingo Molnar
2006-05-15T19:28:38Z

* Andrew Morton <akpm@osdl.org> wrote:

> - The cachefs patches are back (local-disk-based caching of network
> filesystem files) (David Howells)

the blind hacks below are needed to make CONFIG_CACHEFILES build.

Ingo

Index: linux/fs/cachefiles/cf-namei.c
===================================================================
--- linux.orig/fs/cachefiles/cf-namei.c
+++ linux/fs/cachefiles/cf-namei.c
@@ -124,31 +124,31 @@ try_again:
}

/* do the multiway lock magic */
- trap = lock_rename(cache->graveyard, dir);
+ trap = lock_rename(cache->graveyard, dir, 0);

/* do some checks before getting the grave dentry */
if (rep->d_parent != dir) {
/* the entry was probably culled when we dropped the parent dir
* lock */
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
_leave(" = 0 [culled?]");
return 0;
}

if (!S_ISDIR(cache->graveyard->d_inode->i_mode)) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
cachefiles_io_error(cache, "Graveyard no longer a directory");
return -EIO;
}

if (trap == rep) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
cachefiles_io_error(cache, "May not make directory loop");
return -EIO;
}

if (d_mountpoint(rep)) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
cachefiles_io_error(cache, "Mountpoint in cache");
return -EIO;
}
@@ -160,7 +160,7 @@ try_again:

grave = d_alloc(cache->graveyard, &name);
if (!grave) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
_leave(" = -ENOMEM");
return -ENOMEM;
}
@@ -168,7 +168,7 @@ try_again:
alt = cache->graveyard->d_inode->i_op->lookup(
cache->graveyard->d_inode, grave, NULL);
if (IS_ERR(alt)) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
dput(grave);

if (PTR_ERR(alt) == -ENOMEM) {
@@ -188,7 +188,7 @@ try_again:
}

if (grave->d_inode) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
dput(grave);
grave = NULL;
cond_resched();
@@ -196,7 +196,7 @@ try_again:
}

if (d_mountpoint(grave)) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
dput(grave);
cachefiles_io_error(cache, "Mountpoint in graveyard");
return -EIO;
@@ -204,7 +204,7 @@ try_again:

/* target should not be an ancestor of source */
if (trap == grave) {
- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
dput(grave);
cachefiles_io_error(cache, "May not make directory loop");
return -EIO;
@@ -231,7 +231,7 @@ try_again:

fsnotify_oldname_free(old_name);

- unlock_rename(cache->graveyard, dir);
+ unlock_rename(cache->graveyard, dir, 0);
dput(grave);
_leave(" = 0");
return 0;