about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@whamcloud.com>2011-07-07 00:20:32 -0400
committerAndreas Schwab <schwab@redhat.com>2011-07-21 12:18:50 +0200
commit51f8ca96484efa481e3c86d48560fd7061cfdbc1 (patch)
treee9e3fc4784c6220687e064ea24e98cf2f68a7809
parent77b2540f78e4c97ffded2c0600012cc48c4670fd (diff)
downloadglibc-51f8ca96484efa481e3c86d48560fd7061cfdbc1.tar.gz
glibc-51f8ca96484efa481e3c86d48560fd7061cfdbc1.tar.xz
glibc-51f8ca96484efa481e3c86d48560fd7061cfdbc1.zip
Handle Lustre filesystem
(cherry picked from commit de283087c74f720cf8a7171972e72b5fa2b45e79)
-rw-r--r--ChangeLog10
-rw-r--r--sysdeps/unix/sysv/linux/internal_statvfs.c5
-rw-r--r--sysdeps/unix/sysv/linux/linux_fsinfo.h7
-rw-r--r--sysdeps/unix/sysv/linux/pathconf.c4
4 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4d7e1ba669..af6de9054a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-07  Ulrich Drepper  <drepper@gmail.com>
+
+	[BZ #12868]
+	* sysdeps/unix/sysv/linux/linux_fsinfo.h: Define Lustre constants.
+	* sysdeps/unix/sysv/linux/internal_statvfs.c (__statvfs_getflags):
+	Handle Lustre.
+	* sysdeps/unix/sysv/linux/pathconf.c (__statfs_link_max): Likewise.
+	(__statfs_filesize_max): Likewise.
+	Patch mostly by Andreas Dilger <adilger@whamcloud.com>.
+
 2011-07-06  Ulrich Drepper  <drepper@gmail.com>
 
 	[BZ #12922]
diff --git a/sysdeps/unix/sysv/linux/internal_statvfs.c b/sysdeps/unix/sysv/linux/internal_statvfs.c
index 828854806c..2ddec1edba 100644
--- a/sysdeps/unix/sysv/linux/internal_statvfs.c
+++ b/sysdeps/unix/sysv/linux/internal_statvfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-2006, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1998-2006, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
@@ -115,6 +115,9 @@ __statvfs_getflags (const char *name, int fstype, struct stat64 *st)
     case CGROUP_SUPER_MAGIC:
       fsname = "cgroup";
       break;
+    case LUSTRE_SUPER_MAGIC:
+      fsname = "lustre";
+      break;
     }
 
   FILE *mtab = __setmntent ("/proc/mounts", "r");
diff --git a/sysdeps/unix/sysv/linux/linux_fsinfo.h b/sysdeps/unix/sysv/linux/linux_fsinfo.h
index a0e070071d..55bc6e380a 100644
--- a/sysdeps/unix/sysv/linux/linux_fsinfo.h
+++ b/sysdeps/unix/sysv/linux/linux_fsinfo.h
@@ -1,5 +1,5 @@
 /* Constants from kernel header for various FSes.
-   Copyright (C) 1998-2003,2005,2010 Free Software Foundation, Inc.
+   Copyright (C) 1998-2003,2005,2010,2011 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
@@ -83,6 +83,9 @@
 /* Constant that identifies the `logfs' filesystem.  */
 #define LOGFS_MAGIC_U32		0xc97e8168u
 
+/* Constant that identifies the `lustre' filesystem.  */
+#define LUSTRE_SUPER_MAGIC	0x0BD00BD0
+
 /* Constants that identify the `minix2' filesystem.  */
 #define MINIX2_SUPER_MAGIC	0x2468
 #define MINIX2_SUPER_MAGIC2	0x2478
@@ -150,6 +153,8 @@
 /* Maximum link counts.  */
 #define COH_LINK_MAX		10000
 #define EXT2_LINK_MAX		32000
+#define EXT4_LINK_MAX		65000
+#define LUSTRE_LINK_MAX		EXT4_LINK_MAX
 #define MINIX2_LINK_MAX		65530
 #define MINIX_LINK_MAX		250
 #define REISERFS_LINK_MAX	64535
diff --git a/sysdeps/unix/sysv/linux/pathconf.c b/sysdeps/unix/sysv/linux/pathconf.c
index 52610a14d8..42b7b80c39 100644
--- a/sysdeps/unix/sysv/linux/pathconf.c
+++ b/sysdeps/unix/sysv/linux/pathconf.c
@@ -121,6 +121,9 @@ __statfs_link_max (int result, const struct statfs *fsbuf)
     case XFS_SUPER_MAGIC:
       return XFS_LINK_MAX;
 
+    case LUSTRE_SUPER_MAGIC:
+      return LUSTRE_LINK_MAX;
+
     default:
       return LINUX_LINK_MAX;
     }
@@ -157,6 +160,7 @@ __statfs_filesize_max (int result, const struct statfs *fsbuf)
     case JFS_SUPER_MAGIC:
     case VXFS_SUPER_MAGIC:
     case CGROUP_SUPER_MAGIC:
+    case LUSTRE_SUPER_MAGIC:
       return 64;
 
     case MSDOS_SUPER_MAGIC: