#endif
#include "osi_compat.h"
+#ifndef CURRENT_TIME
+#define CURRENT_TIME (current_kernel_time())
+#endif
+
int cache_fh_type = -1;
int cache_fh_len = -1;
#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;
}
newattrs.ia_ctime = CURRENT_TIME;
/* avoid notify_change() since it wants to update dentry->d_parent */
+#ifdef HAVE_LINUX_SETATTR_PREPARE
+ code = setattr_prepare(file_dentry(afile->filp), &newattrs);
+#else
code = inode_change_ok(inode, &newattrs);
+#endif
if (!code)
code = afs_inode_setattr(afile, &newattrs);
if (!code)
struct iovec iov;
afs_int32 code;
+ memset(&auio, 0, sizeof(auio));
+ memset(&iov, 0, sizeof(iov));
+
AFS_STATCNT(osi_Read);
/*
* down. No point in crashing when we are already shutting down
*/
if (!afile) {
- if (!afs_shuttingdown)
+ if (afs_shuttingdown == AFS_RUNNING)
osi_Panic("osi_Read called with null param");
else
return -EIO;
struct iovec iov;
afs_int32 code;
+ memset(&auio, 0, sizeof(auio));
+ memset(&iov, 0, sizeof(iov));
+
AFS_STATCNT(osi_Write);
if (!afile) {
- if (!afs_shuttingdown)
+ if (afs_shuttingdown == AFS_RUNNING)
osi_Panic("afs_osi_Write called with null param");
else
return -EIO;
pos = uiop->uio_offset;
if (rw == UIO_READ)
- code = filp->f_op->read(filp, iov->iov_base, count, &pos);
+ code = afs_file_read(filp, iov->iov_base, count, &pos);
else
- code = filp->f_op->write(filp, iov->iov_base, count, &pos);
+ code = afs_file_write(filp, iov->iov_base, count, &pos);
if (code < 0) {
code = -code;