struct file *filp;
path.mnt = mnt;
path.dentry = dp;
+ /* note that dentry_open will path_get for us */
filp = dentry_open(&path, flags, creds);
return filp;
#else
- return dentry_open(dp, mnt, flags, creds);
+ return dentry_open(dget(dp), mntget(mnt), flags, creds);
#endif
}
#endif
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
/* Use stashed credentials - prevent selinux/apparmor problems */
- filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
+ filp = afs_dentry_open(dp, afs_cacheMnt, O_RDWR, cache_creds);
if (IS_ERR(filp))
- filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());
+ filp = afs_dentry_open(dp, afs_cacheMnt, O_RDWR, current_cred());
#else
- filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
+ filp = dentry_open(dget(dp), mntget(afs_cacheMnt), O_RDWR);
#endif
if (IS_ERR(filp))
osi_Panic("Can't open file: %d\n", (int) PTR_ERR(filp));
+
+ dput(dp);
+
return filp;
}