From owner-p4-projects@FreeBSD.ORG Thu Oct 26 17:34:12 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E079B16A415; Thu, 26 Oct 2006 17:34:11 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA58E16A40F for ; Thu, 26 Oct 2006 17:34:11 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 892C243D46 for ; Thu, 26 Oct 2006 17:34:11 +0000 (GMT) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k9QHYBbV050223 for ; Thu, 26 Oct 2006 17:34:11 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k9QHYBb3050217 for perforce@freebsd.org; Thu, 26 Oct 2006 17:34:11 GMT (envelope-from rdivacky@FreeBSD.org) Date: Thu, 26 Oct 2006 17:34:11 GMT Message-Id: <200610261734.k9QHYBb3050217@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 108500 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2006 17:34:12 -0000 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))