RCSID
("$Header$");
+#define __NO_VERSION__ /* don't define kernel_version in module.h */
+#include <linux/module.h> /* early to avoid printf->printk mapping */
#include "afs/sysincludes.h"
#include "afsincludes.h"
#include "afs/afs_stats.h"
#include "h/smp_lock.h"
#endif
-#define __NO_VERSION__ /* don't define kernel_version in module.h */
-#include <linux/module.h>
-
struct vcache *afs_globalVp = 0;
struct vfs *afs_globalVFS = 0;
#if defined(AFS_LINUX24_ENV)
-struct nameidata afs_cacheNd;
+struct vfsmount *afs_cacheMnt;
#endif
int afs_was_mounted = 0; /* Used to force reload if mount/unmount/mount */
struct super_block *afs_read_super(struct super_block *sb, void *data, int silent);
int afs_fill_super(struct super_block *sb, void *data, int silent);
static struct super_block *afs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data);
-void put_inode_on_dummy_list(struct inode *ip);
/* afs_file_system
* VFS entry for Linux - installed in init_module
sb->s_maxbytes = MAX_NON_LFS;
#endif
code = afs_root(sb);
- if (code)
+ if (code) {
+ afs_globalVFS = NULL;
#if defined(AFS_LINUX26_ENV)
- module_put(THIS_MODULE);
+ module_put(THIS_MODULE);
#else
- MOD_DEC_USE_COUNT;
+ MOD_DEC_USE_COUNT;
#endif
+ }
#if !defined(AFS_LINUX24_ENV)
unlock_super(sb);
* has synced some pages of a file to disk.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#ifdef WRITE_INODE_NOT_VOID
+static int
+#else
static void
+#endif
afs_write_inode(struct inode *ip, int unused)
#else
static void
/* for now we don't actually update the metadata during msync. This
* is just to keep linux happy. */
+#ifdef WRITE_INODE_NOT_VOID
+ return 0;
+#endif
}
-
static void
afs_destroy_inode(struct inode *ip)
{
+ cred_t *credp = crref();
+
+ /* locked by clear_inode() */
+ put_inode_on_dummy_list(ip);
ip->i_state = 0;
+ afs_InactiveVCache(ITOAFS(ip), credp); /* afs_FlushVCache()? */
+ AFS_GUNLOCK();
+ crfree(credp);
}
* That will trigger the call to delete routine.
*/
+#if defined(AFS_LINUX24_ENV)
+static void
+afs_clear_inode(struct inode *ip)
+{
+ AFS_GLOCK(); /* unlocked by destroy_inode() */
+}
+#else
static void
afs_delete_inode(struct inode *ip)
{
- struct vcache *vp = ITOAFS(ip);
-
-#ifdef AFS_LINUX26_ENV
- put_inode_on_dummy_list(ip);
-#endif
-
- AFS_GLOCK();
+ AFS_GLOCK(); /* after spin_unlock(inode_lock) */
osi_clear_inode(ip);
AFS_GUNLOCK();
}
-
+#endif
/* afs_put_super
* Called from unmount to release super_block. */
static void
afs_put_super(struct super_block *sbp)
{
- extern int afs_afs_cold_shutdown;
int code = 0;
- int fv_slept;
AFS_GLOCK();
AFS_STATCNT(afs_unmount);
afs_globalVp = 0;
afs_shutdown();
#if defined(AFS_LINUX24_ENV)
- path_release(&afs_cacheNd);
+ mntput(afs_cacheMnt);
#endif
osi_linux_verify_alloced_memory();
- done:
AFS_GUNLOCK();
if (!code) {
#endif
{
#if !defined(AFS_LINUX24_ENV)
- struct statfs stat;
+ struct statfs stat, *statp;
if (size < sizeof(struct statfs))
return;
}
struct super_operations afs_sops = {
-#if defined(AFS_LINUX26_ENV)
- .drop_inode = generic_delete_inode,
+#if defined(AFS_LINUX24_ENV)
.destroy_inode = afs_destroy_inode,
+ .clear_inode = afs_clear_inode,
+#else
+ .delete_inode = afs_delete_inode,
#endif
- .delete_inode = afs_delete_inode,
.write_inode = afs_write_inode,
.put_super = afs_put_super,
.statfs = afs_statfs,