version 1.14, 2005/01/09 16:42:43 |
version 1.14.2.1, 2005/04/29 11:29:22 |
Line 195 adosfs_getattr(v) |
|
Line 195 adosfs_getattr(v) |
|
vap->va_bytes = amp->bsize; |
vap->va_bytes = amp->bsize; |
vap->va_size = amp->bsize; |
vap->va_size = amp->bsize; |
} else { |
} else { |
/* |
/* |
* XXX actually we can track this if we were to walk the list |
* XXX actually we can track this if we were to walk the list |
* of links if it exists. |
* of links if it exists. |
* XXX for now, just set nlink to 2 if this is a hard link |
* XXX for now, just set nlink to 2 if this is a hard link |
Line 203 adosfs_getattr(v) |
|
Line 203 adosfs_getattr(v) |
|
*/ |
*/ |
vap->va_nlink = 1 + (ap->linkto != 0); |
vap->va_nlink = 1 + (ap->linkto != 0); |
/* |
/* |
* round up to nearest blocks add number of file list |
* round up to nearest blocks add number of file list |
* blocks needed and mutiply by number of bytes per block. |
* blocks needed and mutiply by number of bytes per block. |
*/ |
*/ |
fblks = howmany(ap->fsize, amp->dbsize); |
fblks = howmany(ap->fsize, amp->dbsize); |
Line 219 adosfs_getattr(v) |
|
Line 219 adosfs_getattr(v) |
|
return(0); |
return(0); |
} |
} |
/* |
/* |
* are things locked??? they need to be to avoid this being |
* are things locked??? they need to be to avoid this being |
* deleted or changed (data block pointer blocks moving about.) |
* deleted or changed (data block pointer blocks moving about.) |
*/ |
*/ |
int |
int |
|
|
error = 0; |
error = 0; |
uio = sp->a_uio; |
uio = sp->a_uio; |
ap = VTOA(sp->a_vp); |
ap = VTOA(sp->a_vp); |
amp = ap->amp; |
amp = ap->amp; |
/* |
/* |
* Return EOF for character devices, EIO for others |
* Return EOF for character devices, EIO for others |
*/ |
*/ |
|
|
} |
} |
|
|
/* |
/* |
* to expensive to let general algorithm figure out that |
* to expensive to let general algorithm figure out that |
* we are beyond the file. Do it now. |
* we are beyond the file. Do it now. |
*/ |
*/ |
if (uio->uio_offset >= ap->fsize) |
if (uio->uio_offset >= ap->fsize) |
|
|
on = uio->uio_offset % size; |
on = uio->uio_offset % size; |
n = MIN(size - on, uio->uio_resid); |
n = MIN(size - on, uio->uio_resid); |
diff = ap->fsize - uio->uio_offset; |
diff = ap->fsize - uio->uio_offset; |
/* |
/* |
* check for EOF |
* check for EOF |
*/ |
*/ |
if (diff <= 0) |
if (diff <= 0) |
|
|
n = diff; |
n = diff; |
/* |
/* |
* read ahead could possibly be worth something |
* read ahead could possibly be worth something |
* but not much as ados makes little attempt to |
* but not much as ados makes little attempt to |
* make things contigous |
* make things contigous |
*/ |
*/ |
error = bread(sp->a_vp, lbn, amp->bsize, NOCRED, &bp); |
error = bread(sp->a_vp, lbn, amp->bsize, NOCRED, &bp); |
|
|
} |
} |
|
|
int |
int |
adosfs_link(v) |
adosfs_link(v) |
void *v; |
void *v; |
{ |
{ |
struct vop_link_args /* { |
struct vop_link_args /* { |
struct vnode *a_dvp; |
struct vnode *a_dvp; |
struct vnode *a_vp; |
struct vnode *a_vp; |
struct componentname *a_cnp; |
struct componentname *a_cnp; |
} */ *ap = v; |
} */ *ap = v; |
|
|
VOP_ABORTOP(ap->a_dvp, ap->a_cnp); |
VOP_ABORTOP(ap->a_dvp, ap->a_cnp); |
vput(ap->a_dvp); |
vput(ap->a_dvp); |
return (EROFS); |
return (EROFS); |
Line 451 adosfs_symlink(v) |
|
Line 451 adosfs_symlink(v) |
|
struct vattr *a_vap; |
struct vattr *a_vap; |
char *a_target; |
char *a_target; |
} */ *ap = v; |
} */ *ap = v; |
|
|
VOP_ABORTOP(ap->a_dvp, ap->a_cnp); |
VOP_ABORTOP(ap->a_dvp, ap->a_cnp); |
vput(ap->a_dvp); |
vput(ap->a_dvp); |
return (EROFS); |
return (EROFS); |
|
|
long nb, flblk, flblkoff, fcnt; |
long nb, flblk, flblkoff, fcnt; |
daddr_t *bnp; |
daddr_t *bnp; |
daddr_t bn; |
daddr_t bn; |
int error; |
int error; |
|
|
#ifdef ADOSFS_DIAGNOSTIC |
#ifdef ADOSFS_DIAGNOSTIC |
advopprint(sp); |
advopprint(sp); |
|
|
/* |
/* |
* check last indirect block cache |
* check last indirect block cache |
*/ |
*/ |
if (flblk < ap->lastlindblk) |
if (flblk < ap->lastlindblk) |
fcnt = 0; |
fcnt = 0; |
else { |
else { |
flblk -= ap->lastlindblk; |
flblk -= ap->lastlindblk; |
|
|
nb = adoswordn(flbp, ap->nwords - 2); |
nb = adoswordn(flbp, ap->nwords - 2); |
flblk--; |
flblk--; |
} |
} |
/* |
/* |
* calculate offset of block number in table. The table starts |
* calculate offset of block number in table. The table starts |
* at nwords - 51 and goes to offset 6 or less if indicated by the |
* at nwords - 51 and goes to offset 6 or less if indicated by the |
* valid table entries stored at offset ADBI_NBLKTABENT. |
* valid table entries stored at offset ADBI_NBLKTABENT. |
|
|
*bnp = adoswordn(flbp, flblkoff) * ap->amp->bsize / DEV_BSIZE; |
*bnp = adoswordn(flbp, flblkoff) * ap->amp->bsize / DEV_BSIZE; |
} else { |
} else { |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
printf("flblk offset %ld too large in lblk %ld blk %" PRId64 "\n", |
printf("flblk offset %ld too large in lblk %ld blk %" PRId64 "\n", |
flblkoff, (long)bn, flbp->b_blkno); |
flblkoff, (long)bn, flbp->b_blkno); |
#endif |
#endif |
error = EINVAL; |
error = EINVAL; |
Line 610 struct adirent { |
|
Line 610 struct adirent { |
|
char namlen; |
char namlen; |
char name[ADMAXNAMELEN+2]; /* maxlen plus 2 NUL's */ |
char name[ADMAXNAMELEN+2]; /* maxlen plus 2 NUL's */ |
}; |
}; |
|
|
int |
int |
adosfs_readdir(v) |
adosfs_readdir(v) |
void *v; |
void *v; |
{ |
{ |
Line 916 adosfs_reclaim(v) |
|
Line 916 adosfs_reclaim(v) |
|
} |
} |
|
|
/* |
/* |
* POSIX pathconf info, grabbed from kern/u fs, probably need to |
* POSIX pathconf info, grabbed from kern/u fs, probably need to |
* investigate exactly what each return type means as they are probably |
* investigate exactly what each return type means as they are probably |
* not valid currently |
* not valid currently |
*/ |
*/ |