X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2F9p%2Fvfs_dentry.c;h=d93960429c09e042ff512535b4ebe9006804d9a6;hb=ecd27b92fbb41f779d857632a69bd45dbaf0f915;hp=0cf2b840219dbed7872307aea90712ec9a3645d7;hpb=5174fdab9f58181249debab6e959ae4fd4abd0ed;p=linux-2.6 diff --git a/fs/9p/vfs_dentry.c b/fs/9p/vfs_dentry.c index 0cf2b84021..d93960429c 100644 --- a/fs/9p/vfs_dentry.c +++ b/fs/9p/vfs_dentry.c @@ -7,9 +7,8 @@ * Copyright (C) 2002 by Ron Minnich * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2 + * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -31,10 +30,10 @@ #include #include #include -#include #include #include #include +#include #include "debug.h" #include "v9fs.h" @@ -54,9 +53,30 @@ static int v9fs_dentry_delete(struct dentry *dentry) { dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry); + return 1; } +/** + * v9fs_cached_dentry_delete - called when dentry refcount equals 0 + * @dentry: dentry in question + * + * Only return 1 if our inode is invalid. Only non-synthetic files + * (ones without mtime == 0) should be calling this function. + * + */ + +static int v9fs_cached_dentry_delete(struct dentry *dentry) +{ + struct inode *inode = dentry->d_inode; + dprintk(DEBUG_VFS, " dentry: %s (%p)\n", dentry->d_iname, dentry); + + if(!inode) + return 1; + + return 0; +} + /** * v9fs_dentry_release - called when dentry is going to be freed * @dentry: dentry that is being release @@ -88,6 +108,11 @@ void v9fs_dentry_release(struct dentry *dentry) } } +struct dentry_operations v9fs_cached_dentry_operations = { + .d_delete = v9fs_cached_dentry_delete, + .d_release = v9fs_dentry_release, +}; + struct dentry_operations v9fs_dentry_operations = { .d_delete = v9fs_dentry_delete, .d_release = v9fs_dentry_release,