#include "osi_compat.h"
#ifndef CURRENT_TIME
-#define CURRENT_TIME (current_kernel_time())
+# if defined(HAVE_LINUX_KTIME_GET_COARSE_REAL_TS64)
+# define AFS_CURRENT_TIME(x) (ktime_get_coarse_real_ts64((x)))
+# else
+# ifdef IATTR_TAKES_64BIT_TIME
+# define AFS_CURRENT_TIME(x) do {*(x) = current_kernel_time64();} while (0)
+# else
+# define AFS_CURRENT_TIME(x) do {*(x) = current_kernel_time();} while (0)
+# endif
+# endif
+#else
+# define AFS_CURRENT_TIME(x) do {*(x) = CURRENT_TIME;} while(0)
#endif
int cache_fh_type = -1;
int cache_fh_len = -1;
-afs_lock_t afs_xosi; /* lock is for tvattr */
extern struct osi_dev cacheDev;
extern struct vfsmount *afs_cacheMnt;
extern struct super_block *afs_cacheSBp;
osi_Panic("UFSOpen called for non-UFS cache\n");
}
if (!afs_osicred_initialized) {
- /* valid for alpha_osf, SunOS, Ultrix */
+ /* valid for SunOS, Ultrix */
memset(&afs_osi_cred, 0, sizeof(afs_ucred_t));
crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */
afs_osicred_initialized = 1;
afs_osi_Stat(struct osi_file *afile, struct osi_stat *astat)
{
AFS_STATCNT(osi_Stat);
- ObtainWriteLock(&afs_xosi, 320);
astat->size = i_size_read(OSIFILE_INODE(afile));
astat->mtime = OSIFILE_INODE(afile)->i_mtime.tv_sec;
astat->atime = OSIFILE_INODE(afile)->i_atime.tv_sec;
- ReleaseWriteLock(&afs_xosi);
return 0;
}
code = afs_osi_Stat(afile, &tstat);
if (code || tstat.size <= asize)
return code;
- ObtainWriteLock(&afs_xosi, 321);
AFS_GUNLOCK();
afs_linux_lock_inode(inode);
#ifdef STRUCT_INODE_HAS_I_ALLOC_SEM
#endif
newattrs.ia_size = asize;
newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
- newattrs.ia_ctime = CURRENT_TIME;
+ AFS_CURRENT_TIME(&newattrs.ia_ctime);
/* avoid notify_change() since it wants to update dentry->d_parent */
#ifdef HAVE_LINUX_SETATTR_PREPARE
#endif
afs_linux_unlock_inode(inode);
AFS_GLOCK();
- ReleaseWriteLock(&afs_xosi);
return code;
}
afile->offset += code;
} else {
if (code == ENOSPC)
- afs_warnuser
- ("\n\n\n*** Cache partition is FULL - Decrease cachesize!!! ***\n\n");
+ afs_WarnENOSPC();
if (code > 0) {
code = -code;
}