*/
int osi_VM_FlushVCache(struct vcache *avc, int *slept)
{
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
if (VREFCOUNT(avc) != 0)
return EBUSY;
*/
void osi_VM_TryToSmush(struct vcache *avc, struct AFS_UCRED *acred, int sync)
{
- invalidate_inode_pages(AFSTOV(avc));
+ invalidate_inode_pages(AFSTOI(avc));
}
/* Flush and invalidate pages, for fsync() with INVAL flag
*/
void osi_VM_StoreAllSegments(struct vcache *avc)
{
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,5)
/* filemap_fdatasync() only exported in 2.4.5 and above */
void osi_VM_FlushPages(struct vcache *avc, struct AFS_UCRED *credp)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
truncate_inode_pages(&ip->i_data, 0);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
truncate_inode_pages(ip, 0);
#else
- invalidate_inode_pages(AFSTOV(avc));
+ invalidate_inode_pages(AFSTOI(avc));
#endif
}
void osi_VM_Truncate(struct vcache *avc, int alen, struct AFS_UCRED *acred)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
truncate_inode_pages(&ip->i_data, alen);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,15)
- struct inode *ip = AFSTOV(avc);
+ struct inode *ip = AFSTOI(avc);
truncate_inode_pages(ip, alen);
#else
- invalidate_inode_pages(AFSTOV(avc));
+ invalidate_inode_pages(AFSTOI(avc));
#endif
}
loff_t *offp)
{
ssize_t code;
- struct vcache *vcp = VTOAFS(fp->f_dentry->d_inode);
+ struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
cred_t *credp = crref();
struct vrequest treq;
{
ssize_t code = 0;
int code2;
- struct vcache *vcp = VTOAFS(fp->f_dentry->d_inode);
+ struct vcache *vcp = ITOAFS(fp->f_dentry->d_inode);
struct vrequest treq;
cred_t *credp = crref();
void *dirbuf, filldir_t filldir)
{
extern struct DirEntry * afs_dir_GetBlob();
- struct vcache *avc = VTOAFS(FILE_INODE(fp));
+ struct vcache *avc = ITOAFS(FILE_INODE(fp));
struct vrequest treq;
register struct dcache *tdc;
int code;
if (!vmap->vm_file)
return;
- vcp = VTOAFS(FILE_INODE(vmap->vm_file));
+ vcp = ITOAFS(FILE_INODE(vmap->vm_file));
if (!vcp)
return;
static int afs_linux_mmap(struct file *fp, struct vm_area_struct *vmap)
{
- struct vcache *vcp = VTOAFS(FILE_INODE(fp));
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
cred_t *credp = crref();
struct vrequest treq;
int code;
{
int code = 0;
cred_t *credp = crref();
- struct vcache *vcp = VTOAFS(ip);
+ struct vcache *vcp = ITOAFS(ip);
AFS_GLOCK();
#ifdef AFS_LINUX24_ENV
#ifdef AFS_LINUX24_ENV
lock_kernel();
#endif
- code = afs_fsync(VTOAFS(ip), credp);
+ code = afs_fsync(ITOAFS(ip), credp);
#ifdef AFS_LINUX24_ENV
unlock_kernel();
#endif
static int afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
{
int code = 0;
- struct vcache *vcp = VTOAFS(FILE_INODE(fp));
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
cred_t *credp = crref();
#ifdef AFS_LINUX24_ENV
struct flock64 flock;
*/
int afs_linux_flush(struct file *fp)
{
- struct vcache *vcp = VTOAFS(FILE_INODE(fp));
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
int code = 0;
cred_t *credp;
int code;
cred_t *credp;
struct vrequest treq;
- struct vcache *vcp = VTOAFS(dp->d_inode);
+ struct vcache *vcp = ITOAFS(dp->d_inode);
AFS_GLOCK();
#ifdef AFS_LINUX24_ENV
struct vcache *lookupvcp = NULL;
int code, bad_dentry = 1;
struct sysname_info sysState;
- struct vcache *vcp = VTOAFS(dp->d_inode);
- struct vcache *parentvcp = VTOAFS(dp->d_parent->d_inode);
+ struct vcache *vcp = ITOAFS(dp->d_inode);
+ struct vcache *parentvcp = ITOAFS(dp->d_parent->d_inode);
AFS_GLOCK();
int code;
cred_t *credp;
struct vrequest treq;
- struct inode *ip = AFSTOV(dp->d_inode);
+ struct inode *ip = AFSTOI(dp->d_inode);
unsigned long timeout = 3*HZ; /* 3 seconds */
vattr.va_mode = mode;
AFS_GLOCK();
- code = afs_create(VTOAFS(dip), name, &vattr, NONEXCL, mode,
+ code = afs_create(ITOAFS(dip), name, &vattr, NONEXCL, mode,
(struct vcache**)&ip, credp);
if (!code) {
struct vcache *vcp=NULL;
const char *comp = dp->d_name.name;
AFS_GLOCK();
- code = afs_lookup(VTOAFS(dip), comp, &vcp, credp);
+ code = afs_lookup(ITOAFS(dip), comp, &vcp, credp);
if (vcp) {
- struct inode *ip = AFSTOV(vcp);
+ struct inode *ip = AFSTOI(vcp);
/* Reset ops if symlink or directory. */
#if defined(AFS_LINUX24_ENV)
if (S_ISREG(ip->i_mode)) {
}
dp->d_time = jiffies;
dp->d_op = afs_dops;
- d_add(dp, AFSTOV(vcp));
+ d_add(dp, AFSTOI(vcp));
AFS_GUNLOCK();
crfree(credp);
d_drop(newdp);
AFS_GLOCK();
- code = afs_link(VTOAFS(oldip), VTOAFS(dip), name, credp);
+ code = afs_link(ITOAFS(oldip), ITOAFS(dip), name, credp);
AFS_GUNLOCK();
crfree(credp);
int putback = 0;
AFS_GLOCK();
- code = afs_remove(VTOAFS(dip), name, credp);
+ code = afs_remove(ITOAFS(dip), name, credp);
AFS_GUNLOCK();
if (!code)
d_drop(dp);
AFS_GLOCK();
VATTR_NULL(&vattr);
- code = afs_symlink(VTOAFS(dip), name, &vattr, target, credp);
+ code = afs_symlink(ITOAFS(dip), name, &vattr, target, credp);
AFS_GUNLOCK();
crfree(credp);
return -code;
VATTR_NULL(&vattr);
vattr.va_mask = ATTR_MODE;
vattr.va_mode = mode;
- code = afs_mkdir(VTOAFS(dip), name, &vattr, &tvcp, credp);
+ code = afs_mkdir(ITOAFS(dip), name, &vattr, &tvcp, credp);
if (tvcp) {
tvcp->v.v_op = &afs_dir_iops;
#endif
dp->d_op = afs_dops;
dp->d_time = jiffies;
- d_instantiate(dp, AFSTOV(tvcp));
+ d_instantiate(dp, AFSTOI(tvcp));
}
AFS_GUNLOCK();
const char *name = dp->d_name.name;
AFS_GLOCK();
- code = afs_rmdir(VTOAFS(dip), name, credp);
+ code = afs_rmdir(ITOAFS(dip), name, credp);
/* Linux likes to see ENOTEMPTY returned from an rmdir() syscall
* that failed because a directory is not empty. So, we map
d_drop(newdp);
}
AFS_GLOCK();
- code = afs_rename(VTOAFS(oldip), oldname, VTOAFS(newip),
+ code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip),
newname, credp);
AFS_GUNLOCK();
struct iovec iov;
setup_uio(&tuio, &iov, target, (afs_offs_t) 0, maxlen, UIO_READ, seg);
- code = afs_readlink(VTOAFS(ip), &tuio, credp);
+ code = afs_readlink(ITOAFS(ip), &tuio, credp);
crfree(credp);
if (!code)
setup_uio(&tuio, &iovec, (char*)address, offset, PAGESIZE,
UIO_READ, AFS_UIOSYS);
- code = afs_rdwr(VTOAFS(ip), &tuio, UIO_READ, 0, credp);
+ code = afs_rdwr(ITOAFS(ip), &tuio, UIO_READ, 0, credp);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
unlock_kernel();
#endif
if (mode & MAY_EXEC) tmp |= VEXEC;
if (mode & MAY_READ) tmp |= VREAD;
if (mode & MAY_WRITE) tmp |= VWRITE;
- code = afs_access(VTOAFS(ip), tmp, credp);
+ code = afs_access(ITOAFS(ip), tmp, credp);
AFS_GUNLOCK();
crfree(credp);
unsigned long offset,
unsigned int count)
{
- struct vcache *vcp = VTOAFS(ip);
+ struct vcache *vcp = ITOAFS(ip);
char *buffer;
afs_offs_t base;
int code = 0;
unsigned long offset,
unsigned int count, int sync)
{
- struct vcache *vcp = VTOAFS(FILE_INODE(fp));
+ struct vcache *vcp = ITOAFS(FILE_INODE(fp));
u8 *page_addr = (u8*) afs_linux_page_address(pp);
int code = 0;
cred_t *credp;