GNU C Library master sources branch, master, updated. glibc-2.12-97-g3cdaa6a

drepper@sourceware.org drepper@sourceware.org
Wed Aug 11 21:08:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  3cdaa6adb113a088fdfb87aa6d7747557eccc58d (commit)
      from  754f7da38b0904b4b989d3500cc8dd5be625cf6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3cdaa6adb113a088fdfb87aa6d7747557eccc58d

commit 3cdaa6adb113a088fdfb87aa6d7747557eccc58d
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Aug 11 14:07:28 2010 -0700

    f_flags in Linux statfs implementation.
    
    The 2.6.36 kernel provides an additional field in the statfs results.
    Use this value in the statvfs emulation to avoid filling in f_flag
    the hard way.

diff --git a/ChangeLog b/ChangeLog
index 1d12009..250eaf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2010-08-11  Ulrich Drepper  <drepper@redhat.com>
 
+	* sysdeps/unix/sysv/linux/bits/statfs.h (struct statfs): Add f_flags
+	field.
+	(struct statfs64): Likewise.
+	(_STATFS_F_FLAGS): Define.
+	* sysdeps/unix/sysv/linux/s390/bits/statfs.h: Likewise.
+	* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+	Don't define if __ASSUME_STATFS_F_FLAGS is defined.
+	(ST_VALID): Define locally.
+	(INTERNAL_STATVFS): If f_flags has ST_VALID set don't call
+	__statvfs_getflags, use the provided value.
+	* sysdeps/unix/sysv/linux/kernel-features.h: Define
+	__ASSUME_STATFS_F_FLAGS.
+
 	* sysdeps/unix/sysv/linux/sys/inotify.h (IN_EXCL_UNLINK): Define.
 
 	* sysdeps/unix/sysv/linux/Makefile [subdir=misc] (sysdep_headers):
diff --git a/sysdeps/unix/sysv/linux/bits/statfs.h b/sysdeps/unix/sysv/linux/bits/statfs.h
index 0e27865..7bd90d0 100644
--- a/sysdeps/unix/sysv/linux/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2002,2003,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +42,8 @@ struct statfs
     __fsid_t f_fsid;
     __SWORD_TYPE f_namelen;
     __SWORD_TYPE f_frsize;
-    __SWORD_TYPE f_spare[5];
+    __SWORD_TYPE f_flags;
+    __SWORD_TYPE f_spare[4];
   };
 
 #ifdef __USE_LARGEFILE64
@@ -58,10 +59,12 @@ struct statfs64
     __fsid_t f_fsid;
     __SWORD_TYPE f_namelen;
     __SWORD_TYPE f_frsize;
-    __SWORD_TYPE f_spare[5];
+    __SWORD_TYPE f_flags;
+    __SWORD_TYPE f_spare[4];
   };
 #endif
 
 /* Tell code we have these members.  */
 #define _STATFS_F_NAMELEN
 #define _STATFS_F_FRSIZE
+#define _STATFS_F_FLAGS
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 59b173e..0169ae3 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -29,6 +29,11 @@
 #include <sys/statfs.h>
 #include <sys/statvfs.h>
 #include "linux_fsinfo.h"
+#include "kernel-features.h"
+
+
+/* Special internal-only bit value.  */
+#define ST_VALID 0x0020
 
 
 #ifndef STATFS
@@ -37,6 +42,7 @@
 # define INTERNAL_STATVFS __internal_statvfs
 
 
+# ifndef __ASSUME_STATFS_F_FLAGS
 int
 __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
 {
@@ -200,6 +206,7 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
 
   return result;
 }
+# endif
 #else
 extern int __statvfs_getflags (const char *name, int fstype,
 			       struct stat64 *st);
@@ -240,9 +247,14 @@ INTERNAL_STATVFS (const char *name, struct STATVFS *buf,
   /* XXX I have no idea how to compute f_favail.  Any idea???  */
   buf->f_favail = buf->f_ffree;
 
-  /* Determining the flags is tricky.  We have to read /proc/mounts or
-     the /etc/mtab file and search for the entry which matches the given
-     file.  The way we can test for matching filesystem is using the
-     device number.  */
-  buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
+#ifndef __ASSUME_STATFS_F_FLAGS
+  if ((fsbuf->f_flags & ST_VALID) == 0)
+    /* Determining the flags is tricky.  We have to read /proc/mounts or
+       the /etc/mtab file and search for the entry which matches the given
+       file.  The way we can test for matching filesystem is using the
+       device number.  */
+    buf->f_flag = __statvfs_getflags (name, fsbuf->f_type, st);
+  else
+#endif
+    buf->f_flag = fsbuf->f_flags ^ ST_VALID;
 }
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index b3f2456..838b310 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -530,3 +530,8 @@
 #if __LINUX_KERNEL_VERSION >= 0x020621
 # define __ASSUME_RECVMMSG	1
 #endif
+
+/* statfs fills in f_flags since 2.6.36.  */
+#if __LINUX_KERNEL_VERSION >= 0x020624
+# define __ASSUME_STATFS_F_FLAGS	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/s390/bits/statfs.h b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
index d838e6b..956150b 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/statfs.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2003, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -42,7 +42,8 @@ struct statfs
     __fsid_t f_fsid;
     int f_namelen;
     int f_frsize;
-    int f_spare[5];
+    int f_flags;
+    int f_spare[4];
   };
 
 #ifdef __USE_LARGEFILE64
@@ -58,10 +59,12 @@ struct statfs64
     __fsid_t f_fsid;
     int f_namelen;
     int f_frsize;
-    int f_spare[5];
+    int f_flags;
+    int f_spare[4];
   };
 #endif
 
 /* Tell code we have this member.  */
 #define _STATFS_F_NAMELEN
 #define _STATFS_F_FRSIZE
+#define _STATFS_F_FLAGS

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                  |   13 +++++++++++++
 sysdeps/unix/sysv/linux/bits/statfs.h      |    9 ++++++---
 sysdeps/unix/sysv/linux/internal_statvfs.c |   22 +++++++++++++++++-----
 sysdeps/unix/sysv/linux/kernel-features.h  |    5 +++++
 sysdeps/unix/sysv/linux/s390/bits/statfs.h |    9 ++++++---
 5 files changed, 47 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list