CFLAGS="$KCFLAGS"
CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib"
+if test $host_cpu == "lib" ; then
+CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g"
+fi
AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
AC_SUBST(MOD_LINK)
else
AC_MSG_RESULT(no)
fi
+
+# --- Check that ext3 and ext3 xattr are enabled in the kernel
+if test "$host_cpu" != "lib" ; then
+ AC_MSG_CHECKING([that ext3 is enabled in the kernel])
+ AC_TRY_COMPILE([
+#define __KERNEL__
+#include <linux/config.h>
+ ],
+ [
+#ifdef CONFIG_EXT3_FS
+ return 0;
+#else
+#error CONFIG_EXT3_FS not #defined
+#endif
+ ],[AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
+ ])
+# disable this check until our xattr patches define it!
+# AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
+# AC_TRY_COMPILE([
+##define __KERNEL__
+##include <linux/config.h>
+# ],
+# [
+##ifdef CONFIG_EXT3_FS_XATTR
+# return 0;
+##else
+##error CONFIG_EXT3_FS_XATTR not #defined
+##endif
+# ],[AC_MSG_RESULT([yes])],
+# [AC_MSG_RESULT([no])
+# AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR)])
+# ])
+fi
} lib_counters_t;
/* temporary expedient: limit number of entries in discontiguous MDs */
-# define PTL_MTU (512<<10)
-# define PTL_MD_MAX_IOV 128
-# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE)
+#define PTL_MTU (512<<10)
+#define PTL_MD_MAX_IOV 128
struct lib_msg_t {
struct list_head msg_list;
* using the generic single-entry routines.
*/
-#define prefetch(a) ((void)a)
-
struct list_head {
struct list_head *next, *prev;
};
* @head: the head for your list.
*/
#define list_for_each(pos, head) \
- for (pos = (head)->next, prefetch(pos->next); pos != (head); \
- pos = pos->next, prefetch(pos->next))
+ for (pos = (head)->next ; pos != (head); pos = pos->next )
/**
* list_for_each_prev - iterate over a list in reverse order
* @head: the head for your list.
*/
#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
- pos = pos->prev, prefetch(pos->prev))
+ for (pos = (head)->prev ; pos != (head); pos = pos->prev)
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- prefetch(pos->member.next); \
+ for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member), \
- prefetch(pos->member.next))
+ pos = list_entry(pos->member.next, typeof(*pos), member))
#endif
#ifndef list_for_each_entry_safe
* version 1.2.2
* bug fixes
- don't copy lvb into (possibly NULL) reply on error (2983)
+ - don't deref dentry after dput, don't free lvb on error (2922)
- use the kms to determine writeback rpc length (2947)
+ - increment oti_logcookies when osc is inactive (2948)
- update client's i_blocks count via lvb messages (2543)
- handle intent open/close of special files properly (1557)
- mount MDS with errors=remount-ro, like obdfilter (2009)
+ * miscellania
+ - allow default OST striping configuration per directory (1414)
2004-03-22 Cluster File Systems, Inc. <info@clusterfs.com>
* version 1.2.1
sh -e -x -c '(cp -f $0.mk $0.in)'
fi
-AM_CONFIG_HEADER(portals/include/config.h)
+AM_CONFIG_HEADER(include/config.h)
AC_OUTPUT([Makefile lvfs/Makefile portals/Makefile portals/Kernelenv \
portals/libcfs/Makefile portals/portals/Makefile \
cobd/Makefile ptlbd/Makefile conf/Makefile tests/Makefile \
utils/Makefile utils/Lustre/Makefile obdfilter/Makefile \
obdclass/Makefile smfs/Makefile snapfs/Makefile snapfs/utils/Makefile \
- include/Makefile include/linux/Makefile llite/Makefile doc/Makefile scripts/Makefile \
+ include/Makefile include/linux/Makefile include/lustre/Makefile \
+ llite/Makefile doc/Makefile scripts/Makefile \
scripts/lustre.spec])
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-SUBDIRS = linux
+SUBDIRS = linux lustre
EXTRA_DIST = config.h.in ioctl.h liblustre.h
include $(top_srcdir)/Rules
-/* include/config.h.in. Generated automatically from configure.in by autoheader. */
+/* include/config.h.in. Generated from configure.in by autoheader. */
-/* Define if you have the `readline' library (-lreadline). */
-#undef HAVE_LIBREADLINE
+/* Use the Pinger */
+#undef ENABLE_PINGER
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* IOCTL Buffer Size */
+#undef OBD_MAX_IOCTL_BUFFER
/* Name of package */
#undef PACKAGE
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of a `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
/* Version number of package */
#undef VERSION
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
-#define loff_t __u64
+#define loff_t long long
#define ERESTART 2001
typedef unsigned short umode_t;
typedef __u64 kdev_t;
#define SPIN_LOCK_UNLOCKED 0
+#define LASSERT_SPIN_LOCKED(lock) do {} while(0)
+
static inline void spin_lock(spinlock_t *l) {return;}
static inline void spin_unlock(spinlock_t *l) {return;}
static inline void spin_lock_init(spinlock_t *l) {return;}
# This code is issued under the GNU General Public License.
# See the file COPYING in this distribution
-
-pkginclude_HEADERS = lustre_user.h
-
EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_ha.h lustre_lib.h \
lustre_mgmt.h obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \
lustre_net.h obd_class.h obd_ost.h obd_support.h lustre_commit_confd.h \
#endif
/* Defn's shared with user-space. */
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
/*
* this file contains all data structures used in Lustre interfaces:
#define OBD_MD_FLIFID (0x02000000) /* ->ost write inline fid */
#define OBD_MD_FLEPOCH (0x04000000) /* ->ost write easize is epoch */
#define OBD_MD_FLGRANT (0x08000000) /* ost preallocation space grant */
+#define OBD_MD_FLDIREA (0x10000000) /* dir's extended attribute data */
#define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME|\
OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | OBD_MD_FLCKSUM|\
OBD_MD_FLQOS | OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE))
#include <linux/lustre_idl.h>
#endif /* __KERNEL__ */
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
#endif
#include <linux/lustre_import.h>
#include <linux/lprocfs_status.h>
+/* Define some large-ish defaults for MTU and MAX_IOV if portals ones
+ * aren't defined (i.e. no limits) or too large */
+#if (defined(PTL_MTU) && (PTL_MTU <= (1 << 20)))
+# define PTLRPC_MTU PTL_MTU
+#else
+# define PTLRPC_MTU (1 << 20)
+#endif
+#if (defined(PTL_MAX_IOV) && (PTL_MAX_IOV <= 512))
+# define PTLRPC_MAX_IOV PTL_MAX_IOV
+#else
+# define PTLRPC_MAX_IOV 512
+#endif
+
+/* Define consistent max bulk size/pages */
+#if (PTLRPC_MTU > PTLRPC_MAX_IOV * PAGE_SIZE)
+# define PTLRPC_MAX_BRW_PAGES PTLRPC_MAX_IOV
+# define PTLRPC_MAX_BRW_SIZE (PTLRPC_MAX_IOV * PAGE_SIZE)
+#else
+# define PTLRPC_MAX_BRW_PAGES (PTLRPC_MTU / PAGE_SIZE)
+# define PTLRPC_MAX_BRW_SIZE PTLRPC_MTU
+#endif
+
/* Size over which to OBD_VMALLOC() rather than OBD_ALLOC() service request
* buffers */
#define SVC_BUF_VMALLOC_THRESHOLD (2*PAGE_SIZE)
#define IOC_MDC_TYPE 'i'
#define IOC_MDC_MIN_NR 20
#define IOC_MDC_LOOKUP _IOWR(IOC_MDC_TYPE, 20, struct obd_device *)
+#define IOC_MDC_GETSTRIPE _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *)
#define IOC_MDC_MAX_NR 50
#ifdef __KERNEL__
--- /dev/null
+# Copyright (C) 2001 Cluster File Systems, Inc.
+#
+# This code is issued under the GNU General Public License.
+# See the file COPYING in this distribution
+
+
+pkginclude_HEADERS = lustre_user.h liblustreapi.h
--- /dev/null
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2002 Cluster File Systems, Inc.
+ * Author: Peter J. Braam <braam@clusterfs.com>
+ * Author: Phil Schwan <phil@clusterfs.com>
+ * Author: Brian Behlendorf <behlendorf1@llnl.gov>
+ * Author: Robert Read <rread@clusterfs.com>
+ *
+ * This file is part of Lustre, http://www.lustre.org.
+ *
+ * Lustre is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * Lustre is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Lustre; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ */
+#ifndef _LIBLUSTREAPI_H_
+#define _LIBLUSTREAPI_H_
+
+/* liblustreapi.c */
+int op_create_file(char *name, long stripe_size, int stripe_offset,
+ int stripe_count);
+int op_find(char *path, struct obd_uuid *obduuid, int recursive,
+ int verbose, int quiet);
+int op_check(int type_num, char **obd_type_p, char *dir);
+int op_catinfo(char *dir, char *keyword, char *node_name);
+
+
+
+#endif
#define _LUSTRE_USER_H
#include <asm/types.h>
-#define IOC_MDC_TYPE 'i'
-#define IOC_MDC_GETSTRIPE _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *)
-
#define LL_IOC_GETFLAGS _IOR ('f', 151, long)
#define LL_IOC_SETFLAGS _IOW ('f', 152, long)
#define LL_IOC_CLRFLAGS _IOW ('f', 153, long)
#define LL_IOC_LOV_GETSTRIPE _IOW ('f', 155, long)
#define LL_IOC_LOV_SETEA _IOW ('f', 156, long)
#define LL_IOC_RECREATE_OBJ _IOW ('f', 157, long)
+#define LL_IOC_GROUP_LOCK _IOW ('f', 158, long)
+#define LL_IOC_GROUP_UNLOCK _IOW ('f', 159, long)
#define O_LOV_DELAY_CREATE 0100000000 /* hopefully this does not conflict */
#define LL_FILE_IGNORE_LOCK 0x00000001
+#define LL_FILE_GROUP_LOCKED 0x00000002
#define LOV_USER_MAGIC_V1 0x0BD10BD0
#define LOV_USER_MAGIC LOV_USER_MAGIC_V1
struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */
} __attribute__((packed));
-extern int op_create_file(char *name, long stripe_size, int stripe_offset,
- int stripe_count);
-extern int get_file_stripe(char *path, struct lov_user_md *lum);
-
#endif /* _LUSTRE_USER_H */
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
===================================================================
--- linux-2.4.19-pre1.orig/arch/ppc/defconfig 2004-01-14 01:10:36.000000000 +0300
+++ linux-2.4.19-pre1/arch/ppc/defconfig 2004-01-14 01:11:49.000000000 +0300
-@@ -1,6 +1,20 @@
+@@ -1,6 +1,13 @@
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
-+# CONFIG_EXT3_FS_XATTR_SHARING is not set
-+# CONFIG_EXT3_FS_XATTR_USER is not set
-+# CONFIG_EXT2_FS_XATTR is not set
-+# CONFIG_EXT2_FS_XATTR_SHARING is not set
-+# CONFIG_EXT2_FS_XATTR_USER is not set
-+# CONFIG_FS_MBCACHE is not set
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
CONFIG_MIPS64=y
--- kernel-2.4.20-6chaos_18_7/arch/ppc/defconfig~linux-2.4.20-xattr-0.8.54-chaos 2003-05-15 21:12:20.000000000 -0600
+++ kernel-2.4.20-6chaos_18_7-braam/arch/ppc/defconfig 2003-07-12 15:34:44.000000000 -0600
-@@ -1,6 +1,20 @@
+@@ -1,6 +1,13 @@
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
-+# CONFIG_EXT3_FS_XATTR_SHARING is not set
-+# CONFIG_EXT3_FS_XATTR_USER is not set
-+# CONFIG_EXT2_FS_XATTR is not set
-+# CONFIG_EXT2_FS_XATTR_SHARING is not set
-+# CONFIG_EXT2_FS_XATTR_USER is not set
-+# CONFIG_FS_MBCACHE is not set
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
CONFIG_MIPS64=y
--- linux-2.4.20/arch/ppc/defconfig~linux-2.4.20-xattr-0.8.54 2002-11-29 07:53:11.000000000 +0800
+++ linux-2.4.20-root/arch/ppc/defconfig 2003-05-07 18:08:03.000000000 +0800
-@@ -1,6 +1,20 @@
+@@ -1,6 +1,13 @@
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
-+# CONFIG_EXT3_FS_XATTR_SHARING is not set
-+# CONFIG_EXT3_FS_XATTR_USER is not set
-+# CONFIG_EXT2_FS_XATTR is not set
-+# CONFIG_EXT2_FS_XATTR_SHARING is not set
-+# CONFIG_EXT2_FS_XATTR_USER is not set
-+# CONFIG_FS_MBCACHE is not set
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
.llong .sys_perfmonctl /* Put this here for now ... */
--- linux-2.4.22-ac1/arch/ppc/defconfig~xattr-0.8.54-2.4.22-rh 2003-06-13 18:51:31.000000000 +0400
+++ linux-2.4.22-ac1-alexey/arch/ppc/defconfig 2003-09-25 23:57:02.000000000 +0400
-@@ -1,6 +1,20 @@
+@@ -1,6 +1,13 @@
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
-+# CONFIG_EXT3_FS_XATTR_SHARING is not set
-+# CONFIG_EXT3_FS_XATTR_USER is not set
-+# CONFIG_EXT2_FS_XATTR is not set
-+# CONFIG_EXT2_FS_XATTR_SHARING is not set
-+# CONFIG_EXT2_FS_XATTR_USER is not set
-+# CONFIG_FS_MBCACHE is not set
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#
# Automatically generated make config: don't edit
#
-+# CONFIG_EXT3_FS_XATTR is not set
++CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_XATTR_SHARING is not set
+# CONFIG_EXT3_FS_XATTR_USER is not set
+# CONFIG_EXT2_FS_XATTR is not set
#else
void l_check_no_ns_lock(struct ldlm_namespace *ns)
{
-#warning "FIXME: check lock in user space??"
+ if (l_has_lock(&ns->ns_lock)) {
+ CERROR("namespace %s lock held illegally; tell phil\n",
+ ns->ns_name);
}
#endif /* __KERNEL__ */
/* ldlm_request.c */
-int ldlm_cancel_lru(struct ldlm_namespace *ns);
+typedef enum {
+ LDLM_ASYNC,
+ LDLM_SYNC,
+} ldlm_sync_t;
+
+int ldlm_cancel_lru(struct ldlm_namespace *ns, ldlm_sync_t sync);
/* ldlm_lock.c */
void ldlm_grant_lock(struct ldlm_lock *lock, void *data, int datalen,
/* ldlm_lockd.c */
int ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
struct ldlm_lock *lock);
+void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
+ struct ldlm_lock_desc *ld, struct ldlm_lock *lock);
/* ldlm_plain.c */
int ldlm_process_plain_lock(struct ldlm_lock *lock, int *flags, int first_enq,
spin_lock_init(&cli->cl_write_rpc_hist.oh_lock);
spin_lock_init(&cli->cl_read_page_hist.oh_lock);
spin_lock_init(&cli->cl_write_page_hist.oh_lock);
- cli->cl_max_pages_per_rpc = PTL_MD_MAX_PAGES;
+ cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES;
cli->cl_max_rpcs_in_flight = OSC_MAX_RIF_DEFAULT;
ldlm_get_ref();
}
if (!list_empty(&lock->l_res_link)) {
+ LDLM_ERROR(lock, "lock still on resource");
ldlm_lock_dump(D_ERROR, lock, 0);
LBUG();
}
LDLM_LOCK_GET(lock); /* dropped by bl thread */
ldlm_lock_remove_from_lru(lock);
+#ifdef __KERNEL__
ldlm_bl_to_thread(ns, NULL, lock);
l_unlock(&ns->ns_lock);
+#else
+ l_unlock(&ns->ns_lock);
+ ldlm_handle_bl_callback(ns, NULL, lock);
+#endif
} else if (ns->ns_client == LDLM_NAMESPACE_CLIENT &&
!lock->l_readers && !lock->l_writers) {
/* If this is a client-side namespace and this was the last
list_add_tail(&lock->l_lru, &ns->ns_unused_list);
ns->ns_nr_unused++;
l_unlock(&ns->ns_lock);
- ldlm_cancel_lru(ns);
+ ldlm_cancel_lru(ns, LDLM_ASYNC);
} else {
l_unlock(&ns->ns_lock);
}
RETURN(0);
}
-static void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
- struct ldlm_lock_desc *ld,
- struct ldlm_lock *lock)
+void ldlm_handle_bl_callback(struct ldlm_namespace *ns,
+ struct ldlm_lock_desc *ld, struct ldlm_lock *lock)
{
int do_ast;
ENTRY;
return ptlrpc_reply(req);
}
-#ifdef __KERNEL__
int ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld,
struct ldlm_lock *lock)
{
+#ifdef __KERNEL__
struct ldlm_bl_pool *blp = ldlm_state->ldlm_bl_pool;
struct ldlm_bl_work_item *blwi;
ENTRY;
list_add_tail(&blwi->blwi_entry, &blp->blp_list);
wake_up(&blp->blp_waitq);
spin_unlock(&blp->blp_lock);
+#else
+ LBUG();
+#endif
RETURN(0);
}
-#endif
static int ldlm_callback_handler(struct ptlrpc_request *req)
{
return rc;
}
-int ldlm_cancel_lru(struct ldlm_namespace *ns)
+/* when called with LDLM_ASYNC the blocking callback will be handled
+ * in a thread and this function will return after the thread has been
+ * asked to call the callback. when called with LDLM_SYNC the blocking
+ * callback will be performed in this function. */
+int ldlm_cancel_lru(struct ldlm_namespace *ns, ldlm_sync_t sync)
{
struct list_head *tmp, *next;
+ struct ldlm_lock *lock;
int count, rc = 0;
+ LIST_HEAD(cblist);
ENTRY;
l_lock(&ns->ns_lock);
}
list_for_each_safe(tmp, next, &ns->ns_unused_list) {
- struct ldlm_lock *lock;
+
lock = list_entry(tmp, struct ldlm_lock, l_lru);
LASSERT(!lock->l_readers && !lock->l_writers);
LDLM_LOCK_GET(lock); /* dropped by bl thread */
ldlm_lock_remove_from_lru(lock);
- ldlm_bl_to_thread(ns, NULL, lock);
+ if (sync == LDLM_ASYNC)
+ ldlm_bl_to_thread(ns, NULL, lock);
+ else
+ list_add(&lock->l_lru, &cblist);
if (--count == 0)
break;
}
l_unlock(&ns->ns_lock);
+
+ list_for_each_safe(tmp, next, &cblist) {
+ lock = list_entry(tmp, struct ldlm_lock, l_lru);
+ list_del_init(&lock->l_lru);
+ ldlm_handle_bl_callback(ns, NULL, lock);
+ }
RETURN(rc);
}
ns->ns_name);
tmp = ns->ns_max_unused;
ns->ns_max_unused = 0;
- ldlm_cancel_lru(ns);
+ ldlm_cancel_lru(ns, LDLM_SYNC);
ns->ns_max_unused = tmp;
return count;
}
ns->ns_name, ns->ns_max_unused, (unsigned int)tmp);
ns->ns_max_unused = (unsigned int)tmp;
- ldlm_cancel_lru(ns);
+ ldlm_cancel_lru(ns, LDLM_ASYNC);
return count;
}
SUBDIRS = . tests
-CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \
- -I$(top_srcdir)/portals/unals -I$(SYSIO)/include
+LL_CFLAGS = -I$(SYSIO)/include
-CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1
LIBS = $(LIBEFENCE)
LUSTRE_LIBS = libllite.a \
- $(top_srcdir)/lov/liblov.a \
- $(top_srcdir)/obdecho/libobdecho.a \
- $(top_srcdir)/osc/libosc.a \
- $(top_srcdir)/mdc/libmdc.a \
- $(top_srcdir)/ptlrpc/libptlrpc.a \
- $(top_srcdir)/obdclass/liblustreclass.a \
- $(top_srcdir)/lvfs/liblvfs.a
-
-PTL_LIBS = $(top_srcdir)/portals/utils/libuptlctl.a \
- $(top_srcdir)/portals/unals/libtcpnal.a \
- $(top_srcdir)/portals/portals/libportals.a
-
-SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \
- $(SYSIO)/drivers/sockets/libsysio_sockets.a \
- $(SYSIO)/src/libsysio.a \
- $(SYSIO)/dev/stdfd/libsysio_stdfd.a
-
-#SYSIO_LIBS = $(SYSIO)/lib/libsysio.a
+ $(top_builddir)/lov/liblov.a \
+ $(top_builddir)/obdecho/libobdecho.a \
+ $(top_builddir)/osc/libosc.a \
+ $(top_builddir)/mdc/libmdc.a \
+ $(top_builddir)/ptlrpc/libptlrpc.a \
+ $(top_builddir)/obdclass/liblustreclass.a \
+ $(top_builddir)/lvfs/liblvfs.a
+
+PTL_LIBS = $(top_builddir)/portals/utils/libuptlctl.a \
+ $(top_builddir)/portals/unals/libtcpnal.a \
+ $(top_builddir)/portals/portals/libportals.a
+
+SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \
+ $(SYSIO)/drivers/sockets/libsysio_sockets.a \
+ $(SYSIO)/src/libsysio.a \
+ $(SYSIO)/dev/stdfd/libsysio_stdfd.a
lib_LIBRARIES = liblustre.a
noinst_LIBRARIES = libllite.a
libllite_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c
-libllite_a_CFLAGS = -fPIC
+libllite_a_CFLAGS = $(LL_CFLAGS)
# for make rpms -- need cleanup
liblustre_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c
-liblustre_a_CFLAGS = -fPIC
+liblustre_a_CFLAGS = $(LL_CFLAGS)
liblustre.a : $(LUSTRE_LIBS) $(PTL_LIBS) $(SYSIO_LIBS)
- $(shell ./genlib.sh $(SYSIO) $(AR) $(LINK))
+ $(shell $(top_srcdir)/liblustre/genlib.sh $(SYSIO) $(AR) $(LINK))
include $(top_srcdir)/Rules
#include <time.h>
#include <sys/types.h>
#include <sys/queue.h>
+#include <fcntl.h>
#include <sysio.h>
#include <fs.h>
CERROR("ldlm_cli_cancel failed: %d\n", rc);
break;
case LDLM_CB_CANCELING: {
- struct inode *inode = llu_inode_from_lock(lock);
+ struct inode *inode;
struct llu_inode_info *lli;
struct lov_stripe_md *lsm;
__u32 stripe;
__u64 kms;
+ /* This lock wasn't granted, don't try to evict pages */
+ if (lock->l_req_mode != lock->l_granted_mode)
+ RETURN(0);
+
+ inode = llu_inode_from_lock(lock);
if (!inode)
RETURN(0);
lli= llu_i2info(inode);
{
struct ptlrpc_request *req = reqp;
struct inode *inode = llu_inode_from_lock(lock);
- struct obd_export *exp;
struct llu_inode_info *lli;
struct ost_lvb *lvb;
- struct {
- int stripe_number;
- __u64 size;
- struct lov_stripe_md *lsm;
- } data;
- __u32 vallen = sizeof(data);
- int rc, size = sizeof(*lvb);
+ int rc, size = sizeof(*lvb), stripe = 0;
ENTRY;
if (inode == NULL)
- RETURN(0);
+ GOTO(out, rc = -ELDLM_NO_LOCK_DATA);
lli = llu_i2info(inode);
if (lli == NULL)
- goto iput;
+ GOTO(iput, rc = -ELDLM_NO_LOCK_DATA);
if (lli->lli_smd == NULL)
- goto iput;
- exp = llu_i2obdexp(inode);
+ GOTO(iput, rc = -ELDLM_NO_LOCK_DATA);
/* First, find out which stripe index this lock corresponds to. */
if (lli->lli_smd->lsm_stripe_count > 1)
- data.stripe_number = llu_lock_to_stripe_offset(inode, lock);
- else
- data.stripe_number = 0;
-
- data.size = lli->lli_st_size;
- data.lsm = lli->lli_smd;
-
- rc = obd_get_info(exp, strlen("size_to_stripe"), "size_to_stripe",
- &vallen, &data);
- if (rc != 0) {
- CERROR("obd_get_info: rc = %d\n", rc);
- LBUG();
- }
-
- LDLM_DEBUG(lock, "i_size: %Lu -> stripe number %d -> size %Lu",
- lli->lli_st_size, data.stripe_number, data.size);
+ stripe = llu_lock_to_stripe_offset(inode, lock);
rc = lustre_pack_reply(req, 1, &size, NULL);
if (rc) {
CERROR("lustre_pack_reply: %d\n", rc);
- goto iput;
+ GOTO(iput, rc);
}
lvb = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*lvb));
- lvb->lvb_size = data.size;
- ptlrpc_reply(req);
+ lvb->lvb_size = lli->lli_smd->lsm_oinfo[stripe].loi_kms;
+ LDLM_DEBUG(lock, "i_size: %llu -> stripe number %u -> kms "LPU64,
+ lli->lli_st_size, stripe, lvb->lvb_size);
iput:
I_RELE(inode);
- RETURN(0);
+ out:
+ /* These errors are normal races, so we don't want to fill the console
+ * with messages by calling ptlrpc_error() */
+ if (rc == -ELDLM_NO_LOCK_DATA)
+ lustre_pack_reply(req, 0, NULL, NULL);
+
+ req->rq_status = rc;
+ return rc;
}
__u64 lov_merge_size(struct lov_stripe_md *lsm, int kms);
## Liblustre excecutables & libraries Makefile
DEFS=
-CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \
- -I$(top_srcdir)/portals/unals -I$(SYSIO)/include \
- -I/opt/lam/include -L/opt/lam/lib
-
-KFLAGS:=
-CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1
-LIBS = $(LIBEFENCE)
-
+LL_CFLAGS = -I$(SYSIO)/include
LLIB_EXEC= ../liblustre.a -lpthread
endif
echo_test_SOURCES = echo_test.c ../../utils/parser.c ../../utils/obd.c ../../utils/lustre_cfg.c
+echo_test_CFLAGS = $(LL_CFLAGS)
echo_test_LDADD = ../liblsupport.a $(LIBREADLINE) -lpthread
-echo_test_DEPENDENCIES=$(top_srcdir)/liblustre/liblsupport.a
+echo_test_DEPENDENCIES=$(top_builddir)/liblustre/liblsupport.a
sanity_SOURCES = sanity.c
+sanity_CFLAGS = $(LL_CFLAGS)
sanity_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-sanity_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a ./libtestcommon.a
+sanity_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a ./libtestcommon.a
recovery_small_SOURCES = recovery_small.c
+recovery_small_CFLAGS = $(LL_CFLAGS)
recovery_small_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-recovery_small_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
+recovery_small_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a
replay_single_SOURCES = replay_single.c
+replay_single_CFLAGS = $(LL_CFLAGS)
replay_single_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-replay_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
+replay_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a
replay_ost_single_SOURCES = replay_ost_single.c
+replay_ost_single_CFLAGS = $(LL_CFLAGS)
replay_ost_single_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-replay_ost_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
+replay_ost_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a
if MPITESTS
test_lock_cancel_SOURCES = test_lock_cancel.c
+test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include -L/opt/lam/lib
test_lock_cancel_LDADD := $(LLIB_EXEC) -lmpi -llam
endif
obd_ioctl_freedata(buf, len);
return rc;
}
- case LL_IOC_LOV_SETSTRIPE:
- case LL_IOC_LOV_GETSTRIPE:
- RETURN(-ENOTTY);
+ case LL_IOC_LOV_SETSTRIPE: {
+ struct ptlrpc_request *request = NULL;
+ struct mdc_op_data op_data;
+ struct iattr attr;
+ struct lov_user_md lum, *lump = (struct lov_user_md *)arg;
+ int rc = 0;
+
+ ll_prepare_mdc_op_data(&op_data, inode, NULL, NULL, 0, 0);
+
+ memset(&attr, 0x0, sizeof(attr));
+
+ LASSERT(sizeof(lum) == sizeof(*lump));
+ LASSERT(sizeof(lum.lmm_objects[0])
+ == sizeof(lump->lmm_objects[0]));
+ rc = copy_from_user(&lum, lump, sizeof(lum));
+ if (rc)
+ return(-EFAULT);
+
+ if (lum.lmm_magic != LOV_USER_MAGIC)
+ RETURN(-EINVAL);
+
+ rc = mdc_setattr(sbi->ll_mdc_exp, &op_data,
+ &attr, &lum, sizeof(lum), NULL, 0, &request);
+ if (rc) {
+ ptlrpc_req_finished(request);
+ if (rc != -EPERM && rc != -EACCES)
+ CERROR("mdc_setattr fails: rc = %d\n", rc);
+ return rc;
+ }
+ ptlrpc_req_finished(request);
+
+ return rc;
+ }
+ case LL_IOC_LOV_GETSTRIPE: {
+ struct ptlrpc_request *request = NULL;
+ struct lov_user_md *lump = (struct lov_user_md *)arg;
+ struct lov_mds_md *lmm;
+ struct ll_fid fid;
+ struct mds_body *body;
+ unsigned long valid = 0;
+ int rc, lmmsize;
+
+ valid |= OBD_MD_FLDIREA;
+
+ ll_inode2fid(&fid, inode);
+ rc = mdc_getattr(sbi->ll_mdc_exp, &fid, valid,
+ obd_size_diskmd(sbi->ll_osc_exp, NULL),
+ &request);
+ if (rc < 0) {
+ CDEBUG(D_INFO, "mdc_getattr failed: rc = %d\n", rc);
+ RETURN(rc);
+ }
+
+ body = lustre_msg_buf(request->rq_repmsg, 0, sizeof(*body));
+ LASSERT(body != NULL); /* checked by mdc_getattr_name */
+ LASSERT_REPSWABBED(request, 0);/* swabbed by mdc_getattr_name */
+
+ lmmsize = body->eadatasize;
+ if (lmmsize == 0)
+ GOTO(out_get, rc = -ENODATA);
+
+ lmm = lustre_msg_buf(request->rq_repmsg, 1, lmmsize);
+ LASSERT(lmm != NULL);
+ LASSERT_REPSWABBED(request, 1);
+ rc = copy_to_user(lump, lmm, lmmsize);
+ if (rc)
+ GOTO(out_get, rc = -EFAULT);
+
+ EXIT;
+ out_get:
+ ptlrpc_req_finished(request);
+ RETURN(rc);
+ }
case IOC_MDC_GETSTRIPE: {
struct ptlrpc_request *request = NULL;
struct ll_fid fid;
#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/module.h>
+#include <linux/types.h>
#include <linux/random.h>
#include <linux/version.h>
RETURN(rc);
}
-#define LL_RA_MIN(inode) ((unsigned long)PTL_MD_MAX_PAGES / 2)
+#define LL_RA_MIN(inode) ((unsigned long)PTLRPC_MAX_BRW_PAGES / 2)
#define LL_RA_MAX(inode) ((ll_i2info(inode)->lli_smd->lsm_xfersize * 3) >> \
PAGE_CACHE_SHIFT)
#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/module.h>
+#include <linux/types.h>
#include <linux/random.h>
#include <linux/version.h>
#include <linux/lustre_lite.h>
#define DEBUG_SUBSYSTEM S_LLITE
#include <linux/module.h>
+#include <linux/types.h>
#include <linux/random.h>
#include <linux/version.h>
#include <linux/lustre_lite.h>
#ifndef LOV_INTERNAL_H
#define LOV_INTERNAL_H
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
#define LAP_MAGIC 8200
if (lsm_new != NULL) {
memcpy(lsm_new, lsm, newsize);
lsm_new->lsm_stripe_count = obj_alloc;
- OBD_FREE(lsm, newsize);
+ OBD_FREE(lsm, oldsize);
lsm = lsm_new;
} else {
CWARN("'leaking' %d bytes\n", oldsize - newsize);
if (lov->tgts[loi->loi_ost_idx].active == 0) {
CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx);
/* Orphan clean up will (someday) fix this up. */
+ if (oti != NULL && oa->o_valid & OBD_MD_FLCOOKIE)
+ oti->oti_logcookies++;
continue;
}
#include <linux/obd_lov.h>
#include <linux/obd_class.h>
#include <linux/obd_support.h>
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
#include "lov_internal.h"
(*lsmp)->lsm_magic = LOV_MAGIC;
(*lsmp)->lsm_stripe_count = stripe_count;
(*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES * stripe_count;
- (*lsmp)->lsm_xfersize = PTL_MTU * stripe_count;
+ (*lsmp)->lsm_xfersize = PTLRPC_MTU * stripe_count;
(*lsmp)->lsm_pattern = pattern;
(*lsmp)->lsm_oinfo[0].loi_ost_idx = ~0;
RETURN(0);
}
+int mds_get_md(struct obd_device *obd, struct inode *inode, void *md,
+ int *size, int lock)
+{
+ int rc = 0;
+ int lmm_size;
+
+ if (lock)
+ down(&inode->i_sem);
+ rc = fsfilt_get_md(obd, inode, md, *size);
+ if (lock)
+ up(&inode->i_sem);
+
+ if (rc < 0) {
+ CERROR("Error %d reading eadata for ino %lu\n",
+ rc, inode->i_ino);
+ } else if (rc > 0) {
+ lmm_size = rc;
+ rc = mds_convert_lov_ea(obd, inode, md, lmm_size);
+
+ if (rc == 0) {
+ *size = lmm_size;
+ rc = lmm_size;
+ } else if (rc > 0) {
+ *size = rc;
+ }
+ }
+
+ RETURN (rc);
+}
+
+
/* Call with lock=1 if you want mds_pack_md to take the i_sem.
* Call with lock=0 if the caller has already taken the i_sem. */
int mds_pack_md(struct obd_device *obd, struct lustre_msg *msg, int offset,
inode->i_ino, lmm_size, mds->mds_max_mdsize);
// RETURN(-EINVAL);
}
-
- if (lock)
- down(&inode->i_sem);
- rc = fsfilt_get_md(obd, inode, lmm, lmm_size);
- if (lock)
- up(&inode->i_sem);
- if (rc < 0) {
- CERROR("Error %d reading eadata for ino %lu\n",
- rc, inode->i_ino);
- } else if (rc > 0) {
- lmm_size = rc;
- rc = mds_convert_lov_ea(obd, inode, lmm, lmm_size);
-
- if (rc > 0)
- lmm_size = rc;
- body->valid |= OBD_MD_FLEASIZE;
+
+ rc = mds_get_md(obd, inode, lmm, &lmm_size, lock);
+ if (rc > 0) {
+ if (S_ISDIR(inode->i_mode))
+ body->valid |= OBD_MD_FLDIREA;
+ else
+ body->valid |= OBD_MD_FLEASIZE;
body->eadatasize = lmm_size;
rc = 0;
}
mds_pack_inode2fid(&body->fid1, inode);
mds_pack_inode2body(body, inode);
- if (S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE) != 0) {
+ if ((S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE)) ||
+ (S_ISDIR(inode->i_mode) && (reqbody->valid & OBD_MD_FLDIREA))) {
rc = mds_pack_md(obd, req->rq_repmsg, reply_off + 1, body,
inode, 1);
/* If we have LOV EA data, the OST holds size, atime, mtime */
- if (!(body->valid & OBD_MD_FLEASIZE))
+ if (!(body->valid & OBD_MD_FLEASIZE) &&
+ !(body->valid & OBD_MD_FLDIREA))
body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS |
OBD_MD_FLATIME | OBD_MD_FLMTIME);
} else if (S_ISLNK(inode->i_mode) &&
LASSERT(body != NULL); /* checked by caller */
LASSERT_REQSWABBED(req, offset); /* swabbed by caller */
- if (S_ISREG(inode->i_mode) && (body->valid & OBD_MD_FLEASIZE)) {
+ if ((S_ISREG(inode->i_mode) && (body->valid & OBD_MD_FLEASIZE)) ||
+ (S_ISDIR(inode->i_mode) && (body->valid & OBD_MD_FLDIREA))) {
int rc;
down(&inode->i_sem);
rc = fsfilt_get_md(req->rq_export->exp_obd, inode, NULL, 0);
extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp,
int len, void *karg, void *uarg);
#ifdef __KERNEL__
+int mds_get_md(struct obd_device *, struct inode *, void *md, int *size,
+ int lock);
int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset,
struct mds_body *, struct inode *, int lock);
void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode);
static int mds_create_objects(struct ptlrpc_request *req, int offset,
struct mds_update_record *rec,
struct mds_obd *mds, struct obd_device *obd,
- struct inode *inode, void **handle, obd_id **ids)
+ struct dentry *dchild, void **handle,
+ obd_id **ids)
{
struct obdo *oa;
struct obd_trans_info oti = { 0 };
struct mds_body *body;
struct lov_stripe_md *lsm = NULL;
struct lov_mds_md *lmm = NULL;
+ struct inode *inode = dchild->d_inode;
void *lmm_buf;
int rc, lmm_bufsize, lmm_size;
ENTRY;
0, &lsm, rec->ur_eadata);
if (rc)
GOTO(out_oa, rc);
+ } else {
+ OBD_ALLOC(lmm, mds->mds_max_mdsize);
+ if (lmm == NULL)
+ GOTO(out_oa, rc = -ENOMEM);
+
+ lmm_size = mds->mds_max_mdsize;
+ rc = mds_get_md(obd, dchild->d_parent->d_inode,
+ lmm, &lmm_size, 1);
+ if (rc > 0)
+ rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
+ mds->mds_osc_exp,
+ 0, &lsm, lmm);
+ OBD_FREE(lmm, mds->mds_max_mdsize);
+ if (rc)
+ GOTO(out_oa, rc);
}
rc = obd_create(mds->mds_osc_exp, oa, &lsm, &oti);
if (rc) {
mfd = NULL;
}
-#warning "XXX fixme"
+ /* #warning "XXX fixme" bug 2991 */
/* Here it used to LASSERT(mfd) if exp_outstanding_reply != NULL.
* Now that exp_outstanding_reply is a list, it's just using mfd != NULL
* to detect a re-open */
if (rec != NULL) {
/* no EA: create objects */
rc = mds_create_objects(req, 2, rec, mds, obd,
- dchild->d_inode, handle, &ids);
+ dchild, handle, &ids);
if (rc) {
CERROR("mds_create_objects: rc = %d\n", rc);
up(&dchild->d_inode->i_sem);
}
if (last_orphan && unlink_orphan) {
+ struct lov_mds_md *lmm = NULL;
int stripe_count = 0;
LASSERT(rc == 0); /* mds_put_write_access must have succeeded */
cleanup_phase = 2; /* dput(pending_child) when finished */
if (req != NULL) {
- struct lov_mds_md *lmm = lustre_msg_buf(req->rq_repmsg,
+ lmm = lustre_msg_buf(req->rq_repmsg,
1, 0);
stripe_count = le32_to_cpu(lmm->lmm_stripe_count);
}
}
if (req != NULL && (reply_body->valid & OBD_MD_FLEASIZE) &&
- mds_log_op_unlink(obd, pending_child->d_inode,
- lustre_msg_buf(req->rq_repmsg, 1, 0),
+ mds_log_op_unlink(obd, pending_child->d_inode, lmm,
req->rq_repmsg->buflens[1],
lustre_msg_buf(req->rq_repmsg, 2, 0),
req->rq_repmsg->buflens[2]) > 0) {
cleanup_phase = 1;
inode = de->d_inode;
LASSERT(inode);
- if (S_ISREG(inode->i_mode) && rec->ur_eadata != NULL)
+ if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) &&
+ rec->ur_eadata != NULL)
down(&inode->i_sem);
OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_SETATTR_WRITE, inode->i_sb);
else /* setattr */
rc = fsfilt_setattr(obd, de, handle, &rec->ur_iattr, 0);
- if (rc == 0 && S_ISREG(inode->i_mode) && rec->ur_eadata != NULL) {
- rc = fsfilt_set_md(obd, inode, handle,
- rec->ur_eadata, rec->ur_eadatalen);
+ if (rc == 0 && (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) &&
+ rec->ur_eadata != NULL) {
+ struct lov_stripe_md *lsm = NULL;
+
+ rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE,
+ mds->mds_osc_exp, 0, &lsm, rec->ur_eadata);
+ if (rc)
+ GOTO(cleanup, rc);
+
+ obd_free_memmd(mds->mds_osc_exp, &lsm);
+
+ rc = fsfilt_set_md(obd, inode, handle, rec->ur_eadata,
+ rec->ur_eadatalen);
+ if (rc)
+ GOTO(cleanup, rc);
}
body = lustre_msg_buf(req->rq_repmsg, 0, sizeof (*body));
err = mds_finish_transno(mds, inode, handle, req, rc, 0);
switch (cleanup_phase) {
case 1:
- if (S_ISREG(inode->i_mode) && rec->ur_eadata != NULL)
+ if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) &&
+ rec->ur_eadata != NULL)
up(&inode->i_sem);
l_dput(de);
if (locked) {
if (tmplock->l_granted_mode == LCK_PR)
continue;
- if (tmplock->l_policy_data.l_extent.end <=
- reply_lvb->lvb_size)
+ if (tmplock->l_policy_data.l_extent.end <= reply_lvb->lvb_size)
continue;
if (l == NULL) {
int rc = 0;
struct ost_lvb *lvb = NULL;
struct obd_device *obd;
- struct obdo *oa = NULL;
struct dentry *dentry;
ENTRY;
obd = res->lr_namespace->ns_lvbp;
LASSERT(obd != NULL);
- oa = obdo_alloc();
- if (oa == NULL)
- GOTO(out, rc = -ENOMEM);
-
- oa->o_id = res->lr_name.name[0];
- oa->o_gr = 0;
- dentry = filter_oa2dentry(obd, oa);
+ dentry = filter_fid2dentry(obd, NULL, 0, res->lr_name.name[0]);
if (IS_ERR(dentry))
GOTO(out, rc = PTR_ERR(dentry));
- /* Limit the valid bits in the return data to what we actually use */
- oa->o_valid = OBD_MD_FLID;
- obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS);
- f_dput(dentry);
lvb->lvb_size = dentry->d_inode->i_size;
lvb->lvb_mtime = LTIME_S(dentry->d_inode->i_mtime);
lvb->lvb_blocks = dentry->d_inode->i_blocks;
+ f_dput(dentry);
+
CDEBUG(D_DLMTRACE, "res: "LPU64" initial lvb size: "LPU64", "
"mtime: "LPU64", blocks: "LPU64"\n",
res->lr_name.name[0], lvb->lvb_size,
lvb->lvb_mtime, lvb->lvb_blocks);
out:
- if (oa)
- obdo_free(oa);
- if (rc && lvb != NULL) {
- OBD_FREE(lvb, sizeof(*lvb));
- res->lr_lvb_data = NULL;
- res->lr_lvb_len = 0;
- }
+ /* Don't free lvb data on lookup error */
up(&res->lr_lvb_sem);
return rc;
}
int rc = 0;
struct ost_lvb *lvb = res->lr_lvb_data;
struct obd_device *obd;
- struct obdo *oa = NULL;
struct dentry *dentry;
ENTRY;
obd = res->lr_namespace->ns_lvbp;
LASSERT(obd);
- oa = obdo_alloc();
- if (oa == NULL)
- GOTO(out, rc = -ENOMEM);
-
- oa->o_id = res->lr_name.name[0];
- oa->o_gr = 0;
- dentry = filter_oa2dentry(obd, oa);
+ dentry = filter_fid2dentry(obd, NULL, 0, res->lr_name.name[0]);
if (IS_ERR(dentry))
GOTO(out, rc = PTR_ERR(dentry));
- /* Limit the valid bits in the return data to what we actually use */
- oa->o_valid = OBD_MD_FLID;
- obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS);
-
if (dentry->d_inode->i_size > lvb->lvb_size || !increase) {
CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb size from disk: "
LPU64" -> %llu\n", res->lr_name.name[0],
lvb->lvb_size, dentry->d_inode->i_size);
lvb->lvb_size = dentry->d_inode->i_size;
}
- if (dentry->d_inode->i_mtime > lvb->lvb_mtime || !increase) {
+
+ if (LTIME_S(dentry->d_inode->i_mtime) > lvb->lvb_mtime || !increase) {
CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb mtime from disk: "
LPU64" -> %lu\n", res->lr_name.name[0],
lvb->lvb_mtime, LTIME_S(dentry->d_inode->i_mtime));
f_dput(dentry);
out:
- if (oa != NULL)
- obdo_free(oa);
up(&res->lr_lvb_sem);
return rc;
}
if (rc)
return rc;
- if (val < 1 || val > PTL_MD_MAX_PAGES)
+ if (val < 1 || val > PTLRPC_MAX_BRW_PAGES)
return -ERANGE;
spin_lock(&cli->cl_loi_list_lock);
# include <linux/module.h>
# include <linux/mm.h>
# include <linux/highmem.h>
-# include <linux/lustre_dlm.h>
+# include <linux/ctype.h>
+# include <linux/init.h>
# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
# include <linux/workqueue.h>
# include <linux/smp_lock.h>
# include <liblustre.h>
#endif
-#ifndef __CYGWIN__
-# include <linux/ctype.h>
-# include <linux/init.h>
-#else
+#ifdef __CYGWIN__
# include <ctype.h>
#endif
+# include <linux/lustre_dlm.h>
#include <linux/obd_class.h>
#include "osc_internal.h"
#ifndef OSC_INTERNAL_H
#define OSC_INTERNAL_H
-#include <portals/lib-types.h> /* for PTL_MTU and PTL_MD_MAX_PAGES */
-
-
-/* bug 1578: negotiate BRW_MAX_SIZE with the OST, instead of hard-coding it */
-#define OSC_BRW_MAX_SIZE PTL_MTU
-#define OSC_BRW_MAX_IOV PTL_MD_MAX_PAGES
-
#define OAP_MAGIC 8675309
struct osc_async_page {
# include <linux/module.h>
# include <linux/mm.h>
# include <linux/highmem.h>
-# include <linux/lustre_dlm.h>
+# include <linux/ctype.h>
+# include <linux/init.h>
# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
# include <linux/workqueue.h>
# include <linux/smp_lock.h>
# include <liblustre.h>
#endif
+# include <linux/lustre_dlm.h>
#include <linux/kp30.h>
#include <linux/lustre_net.h>
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
#include <linux/obd_ost.h>
#include <linux/obd_lov.h>
-#ifndef __CYGWIN__
-# include <linux/ctype.h>
-# include <linux/init.h>
-#else
+#ifdef __CYGWIN__
# include <ctype.h>
#endif
memcpy(aa->aa_oa, &body->oa, sizeof(*aa->aa_oa));
/* This should really be sent by the OST */
- aa->aa_oa->o_blksize = OSC_BRW_MAX_SIZE;
+ aa->aa_oa->o_blksize = PTLRPC_MAX_BRW_SIZE;
aa->aa_oa->o_valid |= OBD_MD_FLBLKSZ;
} else {
CERROR("can't unpack ost_body\n");
memcpy(oa, &body->oa, sizeof(*oa));
/* This should really be sent by the OST */
- oa->o_blksize = OSC_BRW_MAX_SIZE;
+ oa->o_blksize = PTLRPC_MAX_BRW_SIZE;
oa->o_valid |= OBD_MD_FLBLKSZ;
EXIT;
memcpy(oa, &body->oa, sizeof(*oa));
/* This should really be sent by the OST */
- oa->o_blksize = OSC_BRW_MAX_SIZE;
+ oa->o_blksize = PTLRPC_MAX_BRW_SIZE;
oa->o_valid |= OBD_MD_FLBLKSZ;
/* XXX LOV STACKING: the lsm that is passed to us from LOV does not
obd_count pages_per_brw;
int rc;
- if (page_count > OSC_BRW_MAX_IOV)
- pages_per_brw = OSC_BRW_MAX_IOV;
+ if (page_count > PTLRPC_MAX_BRW_PAGES)
+ pages_per_brw = PTLRPC_MAX_BRW_PAGES;
else
pages_per_brw = page_count;
obd_count pages_per_brw;
int rc;
- if (page_count > OSC_BRW_MAX_IOV)
- pages_per_brw = OSC_BRW_MAX_IOV;
+ if (page_count > PTLRPC_MAX_BRW_PAGES)
+ pages_per_brw = PTLRPC_MAX_BRW_PAGES;
else
pages_per_brw = page_count;
obd_count pages_per_brw;
int rc;
- if (page_count > OSC_BRW_MAX_IOV)
- pages_per_brw = OSC_BRW_MAX_IOV;
+ if (page_count > PTLRPC_MAX_BRW_PAGES)
+ pages_per_brw = PTLRPC_MAX_BRW_PAGES;
else
pages_per_brw = page_count;
CFLAGS="$KCFLAGS"
CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib"
+if test $host_cpu == "lib" ; then
+CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g"
+fi
AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib)
AC_SUBST(MOD_LINK)
else
AC_MSG_RESULT(no)
fi
+
+# --- Check that ext3 and ext3 xattr are enabled in the kernel
+if test "$host_cpu" != "lib" ; then
+ AC_MSG_CHECKING([that ext3 is enabled in the kernel])
+ AC_TRY_COMPILE([
+#define __KERNEL__
+#include <linux/config.h>
+ ],
+ [
+#ifdef CONFIG_EXT3_FS
+ return 0;
+#else
+#error CONFIG_EXT3_FS not #defined
+#endif
+ ],[AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)])
+ ])
+# disable this check until our xattr patches define it!
+# AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel])
+# AC_TRY_COMPILE([
+##define __KERNEL__
+##include <linux/config.h>
+# ],
+# [
+##ifdef CONFIG_EXT3_FS_XATTR
+# return 0;
+##else
+##error CONFIG_EXT3_FS_XATTR not #defined
+##endif
+# ],[AC_MSG_RESULT([yes])],
+# [AC_MSG_RESULT([no])
+# AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR)])
+# ])
+fi
} lib_counters_t;
/* temporary expedient: limit number of entries in discontiguous MDs */
-# define PTL_MTU (512<<10)
-# define PTL_MD_MAX_IOV 128
-# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE)
+#define PTL_MTU (512<<10)
+#define PTL_MD_MAX_IOV 128
struct lib_msg_t {
struct list_head msg_list;
* using the generic single-entry routines.
*/
-#define prefetch(a) ((void)a)
-
struct list_head {
struct list_head *next, *prev;
};
* @head: the head for your list.
*/
#define list_for_each(pos, head) \
- for (pos = (head)->next, prefetch(pos->next); pos != (head); \
- pos = pos->next, prefetch(pos->next))
+ for (pos = (head)->next ; pos != (head); pos = pos->next )
/**
* list_for_each_prev - iterate over a list in reverse order
* @head: the head for your list.
*/
#define list_for_each_prev(pos, head) \
- for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
- pos = pos->prev, prefetch(pos->prev))
+ for (pos = (head)->prev ; pos != (head); pos = pos->prev)
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @member: the name of the list_struct within the struct.
*/
#define list_for_each_entry(pos, head, member) \
- for (pos = list_entry((head)->next, typeof(*pos), member), \
- prefetch(pos->member.next); \
+ for (pos = list_entry((head)->next, typeof(*pos), member); \
&pos->member != (head); \
- pos = list_entry(pos->member.next, typeof(*pos), member), \
- prefetch(pos->member.next))
+ pos = list_entry(pos->member.next, typeof(*pos), member))
#endif
#ifndef list_for_each_entry_safe
/* avoid integer overflow */
ptlbd_size[i] = (16*1024*((1024*1024) >> BLOCK_SIZE_BITS));
ptlbd_hardsect_size[i] = 4096;
- ptlbd_max_sectors[i] = PTL_MD_MAX_IOV * (4096/512);
+ ptlbd_max_sectors[i] = PTLRPC_MAX_BRW_PAGES * (4096/512);
}
return 0;
int ptlrpc_init_import(struct obd_import *imp)
{
unsigned long flags;
-
+
spin_lock_irqsave(&imp->imp_lock, flags);
imp->imp_generation++;
{
unsigned long flags;
int rc = 0;
-
+
spin_lock_irqsave(&imp->imp_lock, flags);
if (imp->imp_state == LUSTRE_IMP_FULL) {
IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON);
- spin_unlock_irqrestore(&imp->imp_lock, flags);
+ spin_unlock_irqrestore(&imp->imp_lock, flags);
obd_import_event(imp->imp_obd, imp, IMP_EVENT_DISCON);
rc = 1;
} else {
spin_unlock_irqrestore(&imp->imp_lock, flags);
CDEBUG(D_HA, "%p %s: import already not connected: %s\n",
- imp,imp->imp_client->cli_name,
+ imp,imp->imp_client->cli_name,
ptlrpc_import_state_name(imp->imp_state));
}
imp->imp_obd->obd_name);
ptlrpc_invalidate_import(imp);
}
-
- CDEBUG(D_HA, "%s: waking up pinger\n",
+
+ CDEBUG(D_HA, "%s: waking up pinger\n",
imp->imp_target_uuid.uuid);
-
+
spin_lock_irqsave(&imp->imp_lock, flags);
imp->imp_force_verify = 1;
spin_unlock_irqrestore(&imp->imp_lock, flags);
-
+
ptlrpc_pinger_wake_up();
-
}
EXIT;
}
IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CONNECTING);
- imp->imp_conn_cnt++;
+ imp->imp_conn_cnt++;
imp->imp_last_replay_transno = 0;
if (imp->imp_remote_handle.cookie == 0) {
imp->imp_connection = conn;
dlmexp = class_conn2export(&imp->imp_dlm_handle);
-
+
LASSERT(dlmexp != NULL);
if (dlmexp->exp_connection)
unsigned long flags;
int msg_flags;
ENTRY;
-
+
spin_lock_irqsave(&imp->imp_lock, flags);
if (imp->imp_state == LUSTRE_IMP_CLOSED) {
spin_unlock_irqrestore(&imp->imp_lock, flags);
imp->imp_remote_handle = request->rq_repmsg->handle;
} else {
CERROR("reconnected to %s@%s after partition\n",
- imp->imp_target_uuid.uuid,
+ imp->imp_target_uuid.uuid,
imp->imp_connection->c_remote_uuid.uuid);
}
IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
imp->imp_connection->c_remote_uuid.uuid);
ptlrpc_connect_import(imp, NULL);
RETURN(0);
- }
+ }
}
out:
if (rc != 0) {
req->rq_replen = lustre_msg_size(0, NULL);
req->rq_send_state = LUSTRE_IMP_REPLAY_WAIT;
req->rq_reqmsg->flags |= MSG_LAST_REPLAY;
- req->rq_timeout *= 3;
+ req->rq_timeout *= 3;
req->rq_interpret_reply = completed_replay_interpret;
ptlrpcd_add_req(req);
imp->imp_connection->c_remote_uuid.uuid);
ptlrpc_invalidate_import(imp);
IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER);
- }
-
+ }
+
if (imp->imp_state == LUSTRE_IMP_REPLAY) {
CDEBUG(D_HA, "replay requested by %s\n",
imp->imp_target_uuid.uuid);
rc = ptlrpc_replay_next(imp, &inflight);
- if (inflight == 0 &&
+ if (inflight == 0 &&
atomic_read(&imp->imp_replay_inflight) == 0) {
IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY_LOCKS);
rc = ldlm_replay_locks(imp);
RETURN(rc);
}
-static int back_to_sleep(void *unused)
+static int back_to_sleep(void *unused)
{
return 0;
}
if (ptlrpc_import_in_recovery(imp)) {
struct l_wait_info lwi;
- lwi = LWI_TIMEOUT_INTR(MAX(obd_timeout * HZ, 1), back_to_sleep,
+ lwi = LWI_TIMEOUT_INTR(MAX(obd_timeout * HZ, 1), back_to_sleep,
NULL, NULL);
- rc = l_wait_event(imp->imp_recovery_waitq,
+ rc = l_wait_event(imp->imp_recovery_waitq,
!ptlrpc_import_in_recovery(imp), &lwi);
}
#else /* !__KERNEL__ */
int llog_origin_connect(struct llog_ctxt *ctxt, int count,
- struct llog_logid *logid, struct llog_gen *gen)
+ struct llog_logid *logid, struct llog_gen *gen,
+ struct obd_uuid *uuid)
{
return 0;
}
/* NB no locking required until desc is on the network */
LASSERT (desc->bd_nob > 0);
LASSERT (!desc->bd_network_rw);
- LASSERT (desc->bd_page_count <= PTL_MD_MAX_PAGES);
+ LASSERT (desc->bd_page_count <= PTLRPC_MAX_BRW_PAGES);
LASSERT (desc->bd_req != NULL);
LASSERT (desc->bd_type == BULK_PUT_SINK ||
desc->bd_type == BULK_GET_SOURCE);
XMLCONFIG
*.log
logs
+ostactive
+ll_dirstripe_verify
noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany fchdir_test checkstat
noinst_PROGRAMS += wantedi statone runas openfile getdents mkdirdeep o_directory
noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify
-noinst_PROGRAMS += ll_sparseness_write mrename
+noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify
# noinst_PROGRAMS += ldaptest
bin_PROGRAMS = mcreate munlink mkdirmany iopentest1 iopentest2
#sanity test
ll_sparseness_verify_SOURCES = ll_sparseness_verify.c
ll_sparseness_write_SOURCES = ll_sparseness_write.c
+ll_dirstripe_verify_SOURCE = ll_dirstripe_verify.c
include $(top_srcdir)/Rules
}
run_test 17 "Verify failed mds_postsetup won't fail assertion (2936)"
+test_18() {
+ [ -f $MDSDEV ] && echo "remove $MDSDEV" && rm -f $MDSDEV
+ echo "mount mds with large journal..."
+ OLDMDSSIZE=$MDSSIZE
+ MDSSIZE=2000000
+ gen_config
+
+ echo "mount lustre system..."
+ start_ost
+ start_mds
+ mount_client $MOUNT
+ check_mount || return 41
+
+ echo "check journal size..."
+ FOUNDJOURNALSIZE=`debugfs -R "stat <8>" $MDSDEV | awk '/Size: / { print $6; exit;}'`
+ if [ $FOUNDJOURNALSIZE = "79691776" ]; then
+ echo "Success:lconf creates large journals"
+ else
+ echo "Error:lconf not create large journals correctly"
+ echo "expected journal size: 79691776(76M), found journal size: $FOUNDJOURNALSIZE"
+ return 1
+ fi
+
+ cleanup || return $?
+
+ MDSSIZE=$OLDMDSSIZE
+ gen_config
+}
+run_test 18 "check lconf creates large journals"
equals_msg "Done"
--- /dev/null
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * ll_dirstripe_verify <dir> <file>:
+ * - to verify if the file has the same lov_user_md setting as the parent dir.
+ * - if dir's offset is set -1, ll_dirstripe_verify <dir> <file1> <file2>
+ * is used to further verify if file1 and file2's obdidx is continuous.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <dirent.h>
+
+#include <liblustre.h>
+#include <linux/obd.h>
+#include <linux/lustre_lib.h>
+#include <lustre/lustre_user.h>
+#include <linux/obd_lov.h>
+
+#include <portals/ptlctl.h>
+
+
+#define MAX_LOV_UUID_COUNT 1000
+
+int compare(struct lov_user_md *lum_dir, struct lov_user_md *lum_file1,
+ struct lov_user_md *lum_file2)
+{
+ int stripe_count;
+ int stripe_size;
+ int stripe_offset;
+ int ost_count;
+ int fd;
+ char buf[32];
+ int i;
+
+ stripe_count = (int)lum_dir->lmm_stripe_count;
+ if (stripe_count == 0) {
+ fd = open("/proc/fs/lustre/lov/lov1/stripecount", O_RDONLY);
+ if (fd == -1) {
+ fprintf(stderr, "open proc file error: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ if (read(fd, buf, sizeof(buf)) == -1) {
+ fprintf(stderr, "read proc file error: %s\n",
+ strerror(errno));
+ close(fd);
+ return -1;
+ }
+
+ stripe_count = atoi(buf);
+ stripe_count = stripe_count ? stripe_count : 1;
+ close(fd);
+ }
+
+ stripe_size = (int)lum_dir->lmm_stripe_size;
+ if (stripe_size == 0) {
+ fd = open("/proc/fs/lustre/lov/lov1/stripesize", O_RDONLY);
+ if (fd == -1) {
+ fprintf(stderr, "open proc file error: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ if (read(fd, buf, sizeof(buf)) == -1) {
+ fprintf(stderr, "read proc file error: %s\n",
+ strerror(errno));
+ close(fd);
+ return -1;
+ }
+
+ stripe_size = atoi(buf);
+ close(fd);
+ }
+
+ fd = open("/proc/fs/lustre/lov/lov1/numobd", O_RDONLY);
+ if(fd == -1) {
+ fprintf(stderr, "open proc file error: %s\n",
+ strerror(errno));
+ return -1;
+ }
+ if (read(fd, buf, sizeof(buf)) == -1) {
+ fprintf(stderr, "read proc file error: %s\n",
+ strerror(errno));
+ close(fd);
+ return -1;
+ }
+
+ ost_count = atoi(buf);
+ close(fd);
+
+ if ((lum_file1->lmm_stripe_count != stripe_count) ||
+ (lum_file1->lmm_stripe_size != stripe_size))
+ return -1;
+
+ stripe_offset = (short int)lum_dir->lmm_stripe_offset;
+ if (stripe_offset != -1) {
+ for (i = 0; i < stripe_count; i++)
+ if (lum_file1->lmm_objects[i].l_ost_idx !=
+ (stripe_offset + i) % ost_count)
+ return -1;
+ } else if (lum_file2 != NULL) {
+ int next, idx;
+ next = (lum_file1->lmm_objects[stripe_count-1].l_ost_idx + 1)
+ % ost_count;
+ idx = lum_file2->lmm_objects[0].l_ost_idx;
+ if (idx != next)
+ return -1;
+ }
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ DIR * dir;
+ struct lov_user_md *lum_dir, *lum_file1, *lum_file2=NULL;
+ int rc;
+ int lum_size;
+ char *fname;
+
+ if (argc < 3) {
+ fprintf(stderr, "Usage: %s <dirname> <filename1> [filename2]\n",
+ argv[0]);
+ exit(1);
+ }
+
+ dir = opendir(argv[1]);
+ if (dir == NULL) {
+ fprintf(stderr, "%s opendir failed\n", argv[1]);
+ return errno;
+ }
+
+ lum_size = lov_mds_md_size(MAX_LOV_UUID_COUNT);
+ if ((lum_dir = (struct lov_user_md *)malloc(lum_size)) == NULL) {
+ fprintf(stderr, "unable to allocate memory for ioctl's");
+ return errno;
+ }
+
+ rc = ioctl(dirfd(dir), LL_IOC_LOV_GETSTRIPE, lum_dir);
+ if (rc) {
+ if (errno == ENODATA) {
+ lum_dir->lmm_stripe_size = 0;
+ lum_dir->lmm_stripe_count = 0;
+ lum_dir->lmm_stripe_offset = -1;
+ } else {
+ rc = errno;
+ goto cleanup;
+ }
+ }
+
+ if ((lum_file1 = (struct lov_user_md *)malloc(lum_size)) == NULL) {
+ fprintf(stderr, "unable to allocate memory for ioctl's");
+ rc = errno;
+ goto cleanup;
+ }
+
+ fname = strrchr(argv[2], '/');
+ fname++;
+ strncpy((char *)lum_file1, fname, lum_size);
+ rc = ioctl(dirfd(dir), IOC_MDC_GETSTRIPE, lum_file1);
+ if (rc) {
+ rc = errno;
+ goto cleanup;
+ }
+
+ if (argc == 4) {
+ if ((lum_file2 = (struct lov_user_md *)malloc(lum_size))
+ == NULL) {
+ fprintf(stderr,
+ "unable to allocate memory for ioctl's");
+ rc = errno;
+ goto cleanup;
+ }
+
+ fname = strrchr(argv[3], '/');
+ fname++;
+ strncpy((char *)lum_file2, fname, lum_size);
+ rc = ioctl(dirfd(dir), IOC_MDC_GETSTRIPE, lum_file2);
+ if (rc) {
+ rc = errno;
+ goto cleanup;
+ }
+ }
+
+ rc = compare(lum_dir, lum_file1, lum_file2);
+
+cleanup:
+ if (lum_dir != NULL)
+ free(lum_dir);
+ if (lum_file1 != NULL)
+ free(lum_file1);
+ if (lum_file2 != NULL)
+ free(lum_file2);
+
+ return rc;
+}
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
int main(int argc, char **argv)
{
#include <sys/wait.h>
#include <sys/ioctl.h>
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
int main(int argc, char *argv[])
{
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
+#include <lustre/lustre_user.h>
typedef struct flag_mapping {
const char *string;
{"O_LARGEFILE", O_LARGEFILE},
{"O_DIRECTORY", O_DIRECTORY},
{"O_NOFOLLOW", O_NOFOLLOW},
+ {"O_LOV_DELAY_CREATE", O_LOV_DELAY_CREATE},
{"", -1}
};
set -e
# 17 = bug 2732 2986
-ALWAYS_EXCEPT="17 19b"
+ALWAYS_EXCEPT="17 20b"
LUSTRE=${LUSTRE:-`dirname $0`/..}
UPCALL=${UPCALL:-$PWD/recovery-small-upcall.sh}
}
run_test 8 "touch: drop rep (bug 1423)"
-
#bug 1420
test_9() {
pause_bulk "cp /etc/profile $MOUNT" || return 1
}
run_test 15 "failed open (-ENOMEM)"
+test_16() {
+ do_facet client cp /etc/termcap $MOUNT
+ sync
+
+#define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
+ sysctl -w lustre.fail_loc=0x80000504
+ cancel_lru_locks OSC
+ # will get evicted here
+ do_facet client "diff /etc/termcap $MOUNT/termcap" && return 1
+ sysctl -w lustre.fail_loc=0
+ do_facet client "diff /etc/termcap $MOUNT/termcap" || return 2
+}
+run_test 16 "timeout bulk put, evict client (2732)"
+
+test_17() {
+#define OBD_FAIL_PTLRPC_BULK_GET_NET 0x504 | OBD_FAIL_ONCE
+ # will get evicted here
+ sysctl -w lustre.fail_loc=0x80000503
+ do_facet client cp /etc/termcap $MOUNT && return 1
+
+ do_facet client "diff /etc/termcap $MOUNT/termcap" && return 2
+ sysctl -w lustre.fail_loc=0
+ do_facet client "diff /etc/termcap $MOUNT/termcap" || return 3
+}
+run_test 17 "timeout bulk get, evict client (2732)"
+
+test_18a() {
+ do_facet client mkdir -p $MOUNT/$tdir
+ f=$MOUNT/$tdir/$tfile
+
+ cancel_lru_locks OSC
+ pgcache_empty || return 1
+
+ # 1 stripe on ost2
+ lfs setstripe $f $((128 * 1024)) 1 1
+
+ do_facet client cp /etc/termcap $f
+ sync
+ local osc2_dev=`$LCTL device_list | \
+ awk '(/ost2.*client_facet/){print $4}' `
+ $LCTL --device %$osc2_dev deactivate
+ # my understanding is that there should be nothing in the page
+ # cache after the client reconnects?
+ rc=0
+ pgcache_empty || rc=2
+ $LCTL --device %$osc2_dev activate
+ rm -f $f
+ return $rc
+}
+run_test 18a "manual ost invalidate clears page cache immediately"
+
+test_18b() {
+# OBD_FAIL_PTLRPC_BULK_PUT_NET|OBD_FAIL_ONCE
+ do_facet client mkdir -p $MOUNT/$tdir
+ f=$MOUNT/$tdir/$tfile
+ f2=$MOUNT/$tdir/${tfile}-2
+
+ cancel_lru_locks OSC
+ pgcache_empty || return 1
+
+ # shouldn't have to set stripe size of count==1
+ lfs setstripe $f $((128 * 1024)) 0 1
+ sync
+ sysctl -w lustre.fail_loc=0
+ # allow recovery to complete
+ sleep $((TIMEOUT + 2))
+ # my understanding is that there should be nothing in the page
+ # cache after the client reconnects?
+ rc=0
+ pgcache_empty || rc=2
+ rm -f $f $f2
+ return $rc
+}
+run_test 18b "eviction and reconnect clears page cache (2766)"
+
test_19a() {
f=$MOUNT/$tfile
do_facet client mcreate $f || return 1
unlinkmany $DIR/$tfile-%d 400 400
$CHECKSTAT -t file $DIR/$tfile-* && return 1 || true
}
-run_test 42 "recoery after ost failure"
+run_test 42 "recovery after ost failure"
# b=2530
# directory orphans can't be unlinked from PENDING directory
}
run_test 47 "Device nodes check ================================"
-test_48a() {
+test_48a() { # bug 2399
mkdir $DIR/d48a
cd $DIR/d48a
mv $DIR/d48a $DIR/d48.new || error "move directory failed"
}
run_test 48a "Access renamed working dir (should return errors)="
-test_48b() {
+test_48b() { # bug 2399
mkdir $DIR/d48b
cd $DIR/d48b
rmdir $DIR/d48b || error "remove cwd $DIR/d48b failed"
}
run_test 64b "check out-of-space detection on client ============"
+# bug 1414 - set/get directories' stripe info
+test_65() {
+ LFS=${LFS:-lfs}
+ LVERIFY=${LVERIFY:-ll_dirstripe_verify}
+
+ echo "dir has no stripe info"
+ mkdir $DIR/d65
+ touch $DIR/d65/f1
+ $LVERIFY $DIR/d65 $DIR/d65/f1 || error
+
+ echo "setstripe $(($STRIPESIZE * 2)) 0 1"
+ $LFS setstripe $DIR/d65 $(($STRIPESIZE * 2)) 0 1 || error
+ touch $DIR/d65/f2
+ $LVERIFY $DIR/d65 $DIR/d65/f2 || error
+
+ if [ $ostcount -gt 1 ]; then
+ echo "setstripe $(($STRIPESIZE * 4)) 1 $(($OSTCOUNT - 1))"
+ $LFS setstripe $DIR/d65 $(($STRIPESIZE * 4)) 1 \
+ $(($OSTCOUNT - 1)) || error
+ touch $DIR/d65/f3
+ $LVERIFY $DIR/d65 $DIR/d65/f3 || error
+ fi
+
+ [ $STRIPECOUNT -eq 0 ] && sc=1 || sc=$(($STRIPECOUNT - 1))
+
+ echo "setstripe $STRIPESIZE -1 $sc"
+ $LFS setstripe $DIR/d65 $STRIPESIZE -1 $sc || error
+ touch $DIR/d65/f4 $DIR/d65/f5
+ $LVERIFY $DIR/d65 $DIR/d65/f4 $DIR/d65/f5 || error
+
+ echo "setstripe 0 -1 0 (default)"
+ $LFS setstripe $DIR/d65 0 -1 0 || error
+ touch $DIR/d65/f6
+ $LVERIFY $DIR/d65 $DIR/d65/f6 || error
+}
+run_test 65 "Verify that the files are created using parent dir's stripe info"
+
+# bug 2543 - update blocks count on client
+test_66() {
+ COUNT=${COUNT:-8}
+ dd if=/dev/zero of=$DIR/f66 bs=1k count=$COUNT
+ sync
+ BLOCKS=`ls -s $DIR/f66 | awk '{ print $1 }'`
+ [ $BLOCKS -ge $COUNT ] || error "$DIR/f66 blocks $BLOCKS < $COUNT"
+}
+run_test 66 "update inode blocks count on client ==============="
+
# on the LLNL clusters, runas will still pick up root's $TMP settings,
# which will not be writable for the runas user, and then you get a CVS
# error message with a corrupt path string (CVS bug) and panic.
test_99b() {
[ ! -d $DIR/d99cvsroot ] && test_99a
cd /etc/init.d
- $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" d99reposname vtag rtag
+ # some versions of cvs import exit(1) when asked to import links or
+ # files they can't read. ignore those files.
+ TOIGNORE=$(find . -type l -printf '-I %f\n' -o \
+ ! -perm +4 -printf '-I %f\n')
+ $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" $TOIGNORE \
+ d99reposname vtag rtag
}
run_test 99b "cvs import ======================================="
done
}
+
+pgcache_empty() {
+ for a in /proc/fs/lustre/llite/*/dump_page_cache; do
+ if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then
+ echo there is still data in page cache $a ?
+ cat $a;
+ return 1;
+ fi
+ done
+ return 0
+}
+
##################################
# Test interface
error() {
}
/* Print process rank, loop count, message, and exit (i.e. a fatal error) */
-int rprintf(int rank, int loop, const char *fmt, ...)
+void rprintf(int rank, int loop, const char *fmt, ...)
{
va_list ap;
vprintf(fmt, ap);
- MPI_Finalize();
- exit(1);
+ MPI_Abort(MPI_COMM_WORLD, 1);
}
int main(int argc, char *argv[])
#include <stdarg.h>
#include "mpi.h"
-
-#define FILENAME "/mnt/lustre/write_disjoint"
#define CHUNK_MAX_SIZE 123456
-int rprintf(int rank, int loop, const char *fmt, ...)
+void rprintf(int rank, int loop, const char *fmt, ...)
{
va_list ap;
vprintf(fmt, ap);
- MPI_Finalize();
- exit(1);
+ MPI_Abort(MPI_COMM_WORLD, 1);
}
int main (int argc, char *argv[]) {
int rank, noProcessors, done;
off_t offset;
char **chunk_buf;
- char *read_buf;
+ char *read_buf, c;
struct stat stat_buf;
ssize_t ret;
+ char *filename = "/mnt/lustre/write_disjoint";
+
+ /* Parse command line options */
+ while (1) {
+ c = getopt(argc, argv, "f:");
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'f':
+ filename = optarg;
+ break;
+ }
+ }
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &noProcessors);
read_buf = malloc(noProcessors * CHUNK_MAX_SIZE);
if (rank == 0) {
- fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0666);
+ fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd < 0)
rprintf(rank, -1, "open() returned %s\n",
strerror(errno));
}
MPI_Barrier(MPI_COMM_WORLD);
- fd = open(FILENAME, O_RDWR);
+ fd = open(filename, O_RDWR);
if (fd < 0)
rprintf(rank, -1, "open() returned %s\n", strerror(errno));
for (n=0; n < 1000 ; n++) {
/* reset the environment */
if (rank == 0) {
- ret = truncate(FILENAME, 0);
+ ret = truncate(filename, 0);
if (ret != 0)
rprintf(rank, n, "truncate() returned %s\n",
strerror(errno) );
lseek(fd, 0, SEEK_SET);
/* quick check */
- stat(FILENAME, &stat_buf);
+ stat(filename, &stat_buf);
file_size = stat_buf.st_size;
if (file_size != chunk_size * noProcessors)
rprintf(rank, n, "invalid file size %d"
(b + 4096) & ~(4096-1));
}
- sprintf(command, "od -Ad -a %s", FILENAME);
+ sprintf(command, "od -Ad -a %s", filename);
system(command);
MPI_Finalize();
exit(1);
init_select(config.select)
if len(args) > 0:
- if not os.access(args[0], os.R_OK):
+ # allow config to be fetched via HTTP, but only with python2
+ if sys.version[0] != '1' and args[0].startswith('http://'):
+ import urllib2
+ try:
+ config_file = urllib2.urlopen(args[0])
+ except (urllib2.URLError, socket.error), err:
+ if hasattr(err, 'args'):
+ err = err.args[1]
+ print "Could not access '%s': %s" %(args[0], err)
+ sys.exit(1)
+ elif not os.access(args[0], os.R_OK):
print 'File not found or readable:', args[0]
sys.exit(1)
+ else:
+ # regular file
+ config_file = open(args[0], 'r')
try:
- dom = xml.dom.minidom.parse(args[0])
+ dom = xml.dom.minidom.parse(config_file)
except Exception:
panic("%s does not appear to be a config file." % (args[0]))
sys.exit(1) # make sure to die here, even in debug mode.
#include <liblustre.h>
#include <linux/lustre_idl.h>
-#include <linux/lustre_user.h>
+#include <lustre/liblustreapi.h>
+#include <lustre/lustre_user.h>
#include "parser.h"
#include "obdctl.h"
-extern int op_find(char *path, struct obd_uuid *obduuid, int recursive,
- int verbose, int quiet);
-extern int op_check(int type_num, char **obd_type_p, char *dir);
-extern int op_catinfo(char *dir, char *keyword, char *node_name);
-
/* all functions */
static int lfs_setstripe(int argc, char **argv);
static int lfs_find(int argc, char **argv);
/* all avaialable commands */
command_t cmdlist[] = {
{"setstripe", lfs_setstripe, 0,
- "To create a new file with a specific striping pattern.\n"
- "usage: setstripe <filename> <stripe size> <stripe start> <stripe count>\n"
+ "To create a new file with a specific striping pattern, or to set default striping pattern on an existing directory\n"
+ "usage: setstripe <filename|dirname> <stripe size> <stripe start> <stripe count>\n"
"\tstripe size: Number of bytes in each stripe (0 default)\n"
"\tstripe start: OST index of first stripe (-1 default)\n"
"\tstripe count: Number of OSTs to stripe over (0 default)"},
#include <liblustre.h>
#include <linux/obd.h>
#include <linux/lustre_lib.h>
-#include <linux/lustre_user.h>
+#include <lustre/lustre_user.h>
#include <linux/obd_lov.h>
#include <portals/ptlctl.h>
lum.lmm_stripe_count = stripe_count;
fd = open(name, O_CREAT | O_RDWR | O_LOV_DELAY_CREATE, 0644);
+ if (errno == EISDIR)
+ fd = open(name, O_DIRECTORY | O_RDONLY);
+
if (fd < 0) {
err_msg("unable to open '%s'",name);
rc = -errno;
return rc;
}
+
if (ioctl(fd, LL_IOC_LOV_SETSTRIPE, &lum)) {
char *errmsg = "stripe already set";
if (errno != EEXIST && errno != EALREADY)
return rc;
}
-
struct find_param {
int recursive;
int verbose;
obdstripe = 1;
}
+ /* if it's a directory */
+ if (*fname == '\0') {
+ if (header && (obdstripe == 1)) {
+ printf("count: %d, size: %d, offset: %d\n\n",
+ lum->lmm_stripe_count, lum->lmm_stripe_size,
+ (short int)lum->lmm_stripe_offset);
+ }
+ return;
+ }
+
if (header && (obdstripe == 1)) {
printf("lmm_magic: 0x%08X\n", lum->lmm_magic);
printf("lmm_object_gr: "LPX64"\n", lum->lmm_object_gr);
return 0;
}
+/* some 64bit libcs implement readdir64() by calling sys_getdents(). the
+ * kernel's sys_getdents() doesn't return d_type. */
+unsigned char handle_dt_unknown(char *parent, char *entry)
+{
+ char path[PATH_MAX + 1];
+ int fd, ret;
+
+ ret = snprintf(path, PATH_MAX, "%s/%s", parent, entry);
+ if (ret >= PATH_MAX)
+ return DT_UNKNOWN;
+
+ fd = open(path, O_DIRECTORY|O_RDONLY);
+ if (fd < 0) {
+ if (errno == ENOTDIR)
+ return DT_REG; /* kind of a lie */
+ return DT_UNKNOWN;
+ }
+ close(fd);
+ return DT_DIR;
+}
static int process_dir(DIR *dir, char *dname, struct find_param *param)
{
return rc;
}
+ /* retrieve dir's stripe info */
+ strncpy((char *)param->lum, dname, param->buflen);
+ rc = ioctl(dirfd(dir), LL_IOC_LOV_GETSTRIPE, (void *)param->lum);
+ if (rc) {
+ if (errno == ENODATA) {
+ if (!param->obduuid && !param->quiet)
+ printf("%s/%s has no stripe info\n",
+ dname, "");
+ rc = 0;
+ } else {
+ err_msg("IOC_MDC_GETSTRIPE ioctl failed");
+ return errno;
+ }
+ } else {
+ lov_dump_user_lmm(param, dname, "");
+ }
+
/* Handle the contents of the directory */
while ((dirp = readdir64(dir)) != NULL) {
if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, ".."))
continue;
+ if (dirp->d_type == DT_UNKNOWN)
+ dirp->d_type = handle_dt_unknown(dname, dirp->d_name);
+
switch (dirp->d_type) {
case DT_UNKNOWN:
err_msg("\"%s\" is UNKNOWN type %d", dirp->d_name,