From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5490 invoked by alias); 1 Oct 2010 04:33:09 -0000 Received: (qmail 5469 invoked by uid 22791); 1 Oct 2010 04:33:08 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,TW_TM,TW_TV,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 01 Oct 2010 04:33:02 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id EB7AF93987 for ; Fri, 1 Oct 2010 06:32:59 +0200 (CEST) To: libc-hacker@sourceware.org Subject: Patch to handle cgroup and btrfs filesystems From: Andreas Jaeger Date: Fri, 01 Oct 2010 04:33:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201010010632.57347.aj@suse.de> Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00000.txt.bz2 Here's a patch to handle btrfs and cgroup on Linux, Andreas 2010-09-30 Andreas Jaeger * sysdeps/unix/sysv/linux_fsinfo.h (BTRFS_SUPER_MAGIC): Define. (CGROUP_SUPER_MAGIC): Define. * sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags): Handle btrfs and cgroup file systems. * sysdeps/unix/sysv/linux/pathconf.c (__statfs_filesize_max): Likewise. diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c=20 b/sysdeps/unix/sysv/linux/internal_statvfs.c index 0169ae3..aefaf2a 100644 --- a/sysdeps/unix/sysv/linux/internal_statvfs.c +++ b/sysdeps/unix/sysv/linux/internal_statvfs.c @@ -109,6 +109,12 @@ __statvfs_getflags (const char *name, int fstype,=20 struct stat64 *st) case LOGFS_MAGIC_U32: fsname =3D "logfs"; break; + case BTRFS_SUPER_MAGIC: + fsname =3D "btrfs"; + break; + case CGROUP_SUPER_MAGIC: + fsname =3D "cgroup"; + break; } =20 FILE *mtab =3D __setmntent ("/proc/mounts", "r"); diff --git a/sysdeps/unix/sysv/linux/linux_fsinfo.h=20 b/sysdeps/unix/sysv/linux/linux_fsinfo.h index b10e98b..8efbdea 100644 --- a/sysdeps/unix/sysv/linux/linux_fsinfo.h +++ b/sysdeps/unix/sysv/linux/linux_fsinfo.h @@ -23,7 +23,7 @@ /* These definitions come from the kernel headers. But we cannot include the headers here because of type clashes. If new filesystem types will become available we have to add the - appropriate definitions here.*/ + appropriate definitions here. */ =20 /* Constant that identifies the `adfs' filesystem. */ #define ADFS_SUPER_MAGIC 0xadf5 @@ -37,6 +37,12 @@ /* Constant that identifies the `bfs' filesystem. */ #define BFS_MAGIC 0x1BADFACE =20 +/* Constant that identifies the `btrfs' filesystem. */ +#define BTRFS_SUPER_MAGIC 0x1BADFACE + +/* Constant that identifies the `cgroup' filesystem. */ +#define CGROUP_SUPER_MAGIC 0x1BADFACE + /* Constant that identifies the `coda' filesystem. */ #define CODA_SUPER_MAGIC 0x73757245 =20 diff --git a/sysdeps/unix/sysv/linux/pathconf.c=20 b/sysdeps/unix/sysv/linux/pathconf.c index db03529..ae597fb 100644 --- a/sysdeps/unix/sysv/linux/pathconf.c +++ b/sysdeps/unix/sysv/linux/pathconf.c @@ -1,5 +1,5 @@ /* Get file-specific information about a file. Linux version. - Copyright (C) 1991,1995,1996,1998-2003,2008 Free Software Foundation,=20 Inc. + Copyright (C) 1991,1995,1996,1998-2003,2008,2010 Free Software=20 Foundation, Inc. This file is part of the GNU C Library. =20 The GNU C Library is free software; you can redistribute it and/or @@ -126,6 +126,9 @@ __statfs_filesize_max (int result, const struct statfs= =20 *fsbuf) =20 switch (fsbuf->f_type) { + case BTRFS_SUPER_MAGIC: + return 255; + case EXT2_SUPER_MAGIC: case UFS_MAGIC: case UFS_CIGAM: @@ -136,6 +139,7 @@ __statfs_filesize_max (int result, const struct statfs= =20 *fsbuf) case UDF_SUPER_MAGIC: case JFS_SUPER_MAGIC: case VXFS_SUPER_MAGIC: + case CGROUP_SUPER_MAGIC: return 64; =20 case MSDOS_SUPER_MAGIC: --=20 Andreas Jaeger, Program Manager openSUSE, aj@{novell.com,opensuse.org} Twitter: jaegerandi | Identica: jaegerandi SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N=FCrnberg) Maxfeldstr. 5, 90409 N=FCrnberg, Germany GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126 --=20 Andreas Jaeger, Program Manager openSUSE, aj@{novell.com,opensuse.org} Twitter: jaegerandi | Identica: jaegerandi SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG N=FCrnberg) Maxfeldstr. 5, 90409 N=FCrnberg, Germany GPG fingerprint =3D 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126