#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
/* Use stashed credentials - prevent selinux/apparmor problems */
- filp = 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 = 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;
}
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
}
- afile = (struct osi_file *)osi_AllocLargeSpace(sizeof(struct osi_file));
AFS_GUNLOCK();
+ afile = kmalloc(sizeof(struct osi_file), GFP_NOFS);
if (!afile) {
osi_Panic("osi_UFSOpen: Failed to allocate %d bytes for osi_file.\n",
(int)sizeof(struct osi_file));
filp_close(afile->filp, NULL);
}
}
-
- osi_FreeLargeSpace(afile);
+ kfree(afile);
return 0;
}
if (!afs_shuttingdown)
osi_Panic("osi_Read called with null param");
else
- return EIO;
+ return -EIO;
}
if (offset != -1)
} else {
afs_Trace2(afs_iclSetp, CM_TRACE_READFAILED, ICL_TYPE_INT32, auio.uio_resid,
ICL_TYPE_INT32, code);
- code = -1;
+ if (code > 0) {
+ code = -code;
+ }
}
return code;
}
if (!afs_shuttingdown)
osi_Panic("afs_osi_Write called with null param");
else
- return EIO;
+ return -EIO;
}
if (offset != -1)
if (code == ENOSPC)
afs_warnuser
("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
- code = -1;
+ if (code > 0) {
+ code = -code;
+ }
}
if (afile->proc)