kernels/linux-2.4.0/arch/parisc/hpux/sys_hpux.c
/*  This function is called from hpux_utssys(); HP-UX implements
 *  ustat() as an option to utssys().
 *
 *  Now, struct ustat on HP-UX is exactly the same as on Linux, except
 *  that it contains one addition field on the end, int32_t f_blksize.
 *  So, we could have written this function to just call the Linux
 *  sys_ustat(), (defined in linux/fs/super.c), and then just
 *  added this additional field to the user's structure.  But I figure
 *  if we're gonna be digging through filesystem structures to get
 *  this, we might as well just do the whole enchilada all in one go.
 *
 *  So, most of this function is almost identical to sys_ustat().
 *  I have placed comments at the few lines changed or added, to
 *  aid in porting forward if and when sys_ustat() is changed from
 *  its form in kernel 2.2.5.
 */
This function is called from hpux_utssys(); HP-UX implements
ustat() as an option to utssys().

Now, struct ustat on HP-UX is exactly the same as on Linux, except
that it contains one addition field on the end, int32_t f_blksize.
So, we could have written this function to just call the Linux
sys_ustat(), (defined in linux/fs/super.c), and then just
added this additional field to the user's structure.  But I figure
if we're gonna be digging through filesystem structures to get
this, we might as well just do the whole enchilada all in one go.

So, most of this function is almost identical to sys_ustat().
I have placed comments at the few lines changed or added, to
aid in porting forward if and when sys_ustat() is changed from
its form in kernel 2.2.5.
This function is called from hpux_utssys () ; HP - UX implements ustat () as an option to utssys () . Now struct ustat on HP - UX is exactly the same as on Linux except that it contains one addition field on the end int32_t f_blksize . So we could have written this function to just call the Linux sys_ustat () ( defined in linux / fs / super . c ) and then just added this additional field to the user ' s structure . But I figure if we ' re gonna be digging through filesystem structures to get this we might as well just do the whole enchilada all in one go . So most of this function is almost identical to sys_ustat () . I have placed comments at the few lines changed or added to aid in porting forward if and when sys_ustat () is changed from its form in kernel 2 . 2 . 5 .
static int hpux_ustat(dev_t dev, struct hpux_ustat *ubuf)
{
	struct super_block *s;
	struct hpux_ustat tmp;  
	struct statfs sbuf;
	int err = -EINVAL;
	lock_kernel();
	s = get_super(to_kdev_t(dev));
	if (s == NULL)
		goto out;
	err = vfs_statfs(s, &sbuf);
	if (err)
		goto out;
	memset(&tmp,0,sizeof(struct hpux_ustat));  
	tmp.f_tfree = (int32_t)sbuf.f_bfree;
	tmp.f_tinode = (u_int32_t)sbuf.f_ffree;
	tmp.f_blksize = (u_int32_t)sbuf.f_bsize;  
	err = copy_to_user(ubuf,&tmp,sizeof(struct hpux_ustat)) ? -EFAULT : 0;
out:
	unlock_kernel();
	return err;
}
static int hpux_ustat ( dev_t dev , struct hpux_ustat * ubuf ) { struct super_block * s ; struct hpux_ustat tmp ; struct statfs sbuf ; int err = - EINVAL ; lock_kernel ( ) ; s = get_super ( to_kdev_t ( dev ) ) ; if ( s == NULL ) goto out ; err = vfs_statfs ( s , & sbuf ) ; if ( err ) goto out ; memset ( & tmp , 0 , sizeof ( struct hpux_ustat ) ) ; tmp . f_tfree = ( int32_t ) sbuf . f_bfree ; tmp . f_tinode = ( u_int32_t ) sbuf . f_ffree ; tmp . f_blksize = ( u_int32_t ) sbuf . f_bsize ; err = copy_to_user ( ubuf , & tmp , sizeof ( struct hpux_ustat ) ) ? - EFAULT : 0 ; out : unlock_kernel ( ) ; return err ; }
This function is called from hpux_utssys(); HP-UX implements
  ustat() as an option to utssys().
This function is called from hpux_utssys () ; HP - UX implements ustat () as an option to utssys () .
/* Changed to hpux_ustat */ /* Changed to hpux_ustat */ /*  Added this line  */ /* Changed to hpux_ustat:  */