stat1(fp
->f_inode
, u
.u_arg
[0]);
* The basic routine for fstat and stat:
* get the inode and pass appropriate parts back.
bp
= bread(ip
->i_dev
, ldiv(ip
->i_number
+31, 16));
cp
= bp
->b_addr
+ 32*lrem(ip
->i_number
+31, 16) + 24;
register struct mount
*mp
, *smp
;
if(ip
->i_count
!=1 || (ip
->i_mode
&(IFBLK
&IFCHR
))!=0)
for(mp
= &mount
[0]; mp
< &mount
[NMOUNT
]; mp
++) {
(*bdevsw
[d
.d_major
].d_open
)(d
, !u
.u_arg
[2]);
smp
->m_bufp
= getblk(NODEV
);
bcopy(mp
->b_addr
, smp
->m_bufp
->b_addr
, 256);
smp
= smp
->m_bufp
->b_addr
;
smp
->s_ronly
= u
.u_arg
[2] & 1;
* the umount system call.
register struct inode
*ip
;
register struct mount
*mp
;
for(mp
= &mount
[0]; mp
< &mount
[NMOUNT
]; mp
++)
if(mp
->m_bufp
!=NULL
&& d
==mp
->m_dev
)
for(ip
= &inode
[0]; ip
< &inode
[NINODE
]; ip
++)
if(ip
->i_number
!=0 && d
==ip
->i_dev
) {
(*bdevsw
[d
.d_major
].d_close
)(d
, 0);
* Common code for mount and umount.
* Check that the user's argument is a reasonable
* thing on which to mount, and return the device number if so.
if((ip
->i_mode
&IFMT
) != IFBLK
)
if(ip
->i_addr
[0].d_major
>= nblkdev
)