char *crash_addr = 0; /* Induce an oops by writing here. */
+#if defined(AFS_LINUX24_ENV)
/* Lookup name and return vnode for same. */
-int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
- vnode_t **dirvpp, struct dentry **dpp)
+int osi_lookupname_internal(char *aname, uio_seg_t seg, int followlink,
+ vnode_t **dirvpp, struct dentry **dpp,
+ struct nameidata *nd)
{
-#if defined(AFS_LINUX24_ENV)
- struct nameidata nd;
-#else
- struct dentry *dp = NULL;
-#endif
int code;
code = ENOENT;
-#if defined(AFS_LINUX24_ENV)
if (seg == AFS_UIOUSER) {
code = followlink ?
- user_path_walk(aname, &nd) : user_path_walk_link(aname, &nd);
+ user_path_walk(aname, nd) : user_path_walk_link(aname, nd);
}
else {
- if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, &nd))
- code = path_walk(aname, &nd);
+ if (path_init(aname, followlink ? LOOKUP_FOLLOW : 0, nd))
+ code = path_walk(aname, nd);
}
if (!code) {
- if (nd.dentry->d_inode) {
- *dpp = dget(nd.dentry);
+ if (nd->dentry->d_inode) {
+ *dpp = dget(nd->dentry);
code = 0;
- } else
+ } else {
code = ENOENT;
- path_release(&nd);
+ path_release(nd);
+ }
}
+ return code;
+}
+#endif
+
+int osi_lookupname(char *aname, uio_seg_t seg, int followlink,
+ vnode_t **dirvpp, struct dentry **dpp)
+{
+#if defined(AFS_LINUX24_ENV)
+ struct nameidata nd;
+ int code = osi_lookupname_internal(aname, seg, followlink, dirvpp, dpp,
+ &nd);
+ if (!code)
+ path_release(&nd);
+
+ return (code);
#else
+ struct dentry *dp = NULL;
+ int code;
+
+ code = ENOENT;
if (seg == AFS_UIOUSER) {
dp = followlink ? namei(aname) : lnamei(aname);
}
else
dput(dp);
}
-#endif
return code;
+#endif
}
/* Intialize cache device info and fragment size for disk cache partition. */
extern struct osi_dev cacheDev;
extern afs_int32 afs_fsfragsize;
extern struct super_block *afs_cacheSBp;
+ extern struct nameidata afs_cacheNd;
- code = osi_lookupname(aname, AFS_UIOSYS, 1, NULL, &dp);
+ code = osi_lookupname_internal(aname, AFS_UIOSYS, 1, NULL, &dp,
+ &afs_cacheNd);
if (code) return ENOENT;
cacheInode = dp->d_inode->i_ino;
struct vcache *afs_globalVp = 0;
struct vfs *afs_globalVFS = 0;
+struct nameidata afs_cacheNd;
int afs_was_mounted = 0; /* Used to force reload if mount/unmount/mount */
extern struct super_operations afs_sops;
afs_globalVFS = 0;
afs_globalVp = 0;
afs_shutdown();
+ path_release(&afs_cacheNd);
osi_linux_verify_alloced_memory();
done:
void
afs_umount_begin(struct super_block *sbp)
{
- afs_put_super(sbp);
afs_shuttingdown=1;
- afs_was_mounted=0;
}
#if defined(AFS_LINUX24_ENV)
delete_inode: afs_delete_inode,
put_super: afs_put_super,
statfs: afs_statfs,
- umount_begin: NULL /* afs_umount_begin */
+ umount_begin: afs_umount_begin
};
#else
struct super_operations afs_sops = {
afs_statfs,
NULL, /* afs_remount_fs - see doc above */
NULL, /* afs_clear_inode */
- NULL /* afs_umount_begin */
+ afs_umount_begin
};
#endif