Date: Thu, 26 Oct 2006 17:34:11 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 108500 for review Message-ID: <200610261734.k9QHYBb3050217@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=108500 Change 108500 by rdivacky@rdivacky_witten on 2006/10/26 17:33:39 An attempt to implement linux_ustat. Untested. Affected files ... .. //depot/projects/linuxolator/src/sys/compat/linux/linux_stats.c#3 edit Differences ... ==== //depot/projects/linuxolator/src/sys/compat/linux/linux_stats.c#3 (text+ko) ==== @@ -468,12 +468,24 @@ int linux_ustat(struct thread *td, struct linux_ustat_args *args) { + struct mount *mp; + struct l_ustat linux_ustat; + #ifdef DEBUG - if (ldebug(ustat)) - printf(ARGS(ustat, "%d, *"), args->dev); + if (ldebug(ustat)) + printf(ARGS(ustat, "%d, *"), args->dev); #endif + mtx_lock(&mountlist_mtx); + TAILQ_FOREACH_REVERSE(mp, &mountlist, mntlist, mnt_list) + if (mp->mnt_stat.f_fsid.val[0] == args->dev) + break; + mtx_unlock(&mountlist_mtx); - return (EOPNOTSUPP); + bzero(&linux_ustat, sizeof(linux_ustat)); + linux_ustat.f_tfree = mp->mnt_stat.f_bfree; + linux_ustat.f_tinode = mp->mnt_stat.f_ffree; + + return copyout(&linux_ustat, args->ubuf, sizeof(linux_ustat)); } #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200610261734.k9QHYBb3050217>