linux-no-umount-begin-20011012
[openafs.git] / src / afs / LINUX / osi_vfsops.c
index e53c337..6c3f8ce 100644 (file)
  *
  * super_block operations should return negated errno to Linux.
  */
+#include <afsconfig.h>
 #include "../afs/param.h"
+
+RCSID("$Header$");
+
 #include "../afs/sysincludes.h"
 #include "../afs/afsincludes.h"
 #include "../afs/afs_stats.h"
@@ -89,6 +93,9 @@ struct super_block *afs_read_super(struct super_block *sb, void *data,
     sb->s_blocksize_bits = 10;
     sb->s_magic = AFS_VFSMAGIC;
     sb->s_op = &afs_sops;      /* Super block (vfs) ops */
+#if defined(MAX_NON_LFS)
+    sb->s_maxbytes = MAX_NON_LFS;
+#endif
     code = afs_root(sb);
     if (code)
        MOD_DEC_USE_COUNT;
@@ -134,7 +141,7 @@ static int afs_root(struct super_block *afsp)
                /* setup super_block and mount point inode. */
                afs_globalVp = tvp;
 #if defined(AFS_LINUX24_ENV)
-               afsp->s_root = d_alloc_root((struct inode*)tvp);
+               afsp->s_root = d_alloc_root((struct inode*)&tvp->v);
 #else
                afsp->s_root = d_alloc_root((struct inode*)tvp, NULL);
 #endif
@@ -237,9 +244,7 @@ void afs_delete_inode(struct inode *ip)
     struct vcache *vc = (struct vcache*)ip;
 
     AFS_GLOCK();
-    ObtainWriteLock(&vc->lock, 504);
     osi_clear_inode(ip);
-    ReleaseWriteLock(&vc->lock);
     AFS_GUNLOCK();
 }
 
@@ -327,6 +332,14 @@ int afs_statfs(struct super_block *sbp, struct statfs *statp, int size)
 }
 
 
+void 
+afs_umount_begin(struct super_block *sbp)
+{
+    afs_put_super(sbp);      
+    afs_shuttingdown=1;
+    afs_was_mounted=0;
+}
+
 #if defined(AFS_LINUX24_ENV)
 struct super_operations afs_sops = {
     read_inode:        afs_read_inode,
@@ -334,6 +347,7 @@ struct super_operations afs_sops = {
     delete_inode:      afs_delete_inode,
     put_super:         afs_put_super,
     statfs:            afs_statfs,
+    umount_begin:      NULL /* afs_umount_begin */
 };
 #else
 struct super_operations afs_sops = {
@@ -347,7 +361,7 @@ struct super_operations afs_sops = {
     afs_statfs,
     NULL,              /* afs_remount_fs - see doc above */
     NULL,              /* afs_clear_inode */
-    NULL,              /* afs_umount_begin */
+    NULL                /* afs_umount_begin */
 };
 #endif