[packages/lustre] - updated to 2.15.4, patched to make userspace parts build on PLD

qboosh qboosh at pld-linux.org
Tue May 21 22:12:27 CEST 2024


commit e6baadc407f8db40198e99a2851218750c7ab115
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Tue May 21 22:06:48 2024 +0200

    - updated to 2.15.4, patched to make userspace parts build on PLD

 lustre-32bit.patch     |  45 ++++++++++++++
 lustre-configure.patch |  54 +++++++++++++++++
 lustre-format.patch    | 159 +++++++++++++++++++++++++++++++++++++++++++++++++
 lustre-heimdal.patch   |  30 ++++++++++
 lustre-link.patch      |  18 ++++++
 lustre-snmp.patch      |  28 +++++++++
 lustre-tests.patch     |  11 ++++
 lustre-zfs.patch       |  79 ++++++++++++++++++++++++
 8 files changed, 424 insertions(+)
---
diff --git a/lustre-32bit.patch b/lustre-32bit.patch
new file mode 100644
index 0000000..fe7df81
--- /dev/null
+++ b/lustre-32bit.patch
@@ -0,0 +1,45 @@
+Disable LP64 ABI-dependent functions from API when building on e.g. ILP32 archs
+--- lustre-release-cac870c/lustre/utils/liblustreapi_swap.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/liblustreapi_swap.c	2024-05-20 18:33:20.563568251 +0200
+@@ -348,6 +348,7 @@ int llapi_group_lock(int fd, int gid)
+ 	return rc;
+ }
+ 
++#ifdef __LP64__
+ int llapi_group_lock64(int fd, __u64 gid)
+ {
+ 	int rc;
+@@ -364,6 +365,7 @@ int llapi_group_lock64(int fd, __u64 gid
+ 	}
+ 	return rc;
+ }
++#endif
+ 
+ /**
+  * Put group lock.
+@@ -386,6 +388,7 @@ int llapi_group_unlock(int fd, int gid)
+ 	return rc;
+ }
+ 
++#ifdef __LP64__
+ int llapi_group_unlock64(int fd, __u64 gid)
+ {
+ 	int rc;
+@@ -397,3 +400,4 @@ int llapi_group_unlock64(int fd, __u64 g
+ 	}
+ 	return rc;
+ }
++#endif
+--- lustre-release-cac870c/lustre/include/lustre/lustreapi.h.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/include/lustre/lustreapi.h	2024-05-20 18:36:52.786571879 +0200
+@@ -654,8 +654,10 @@ int llapi_lease_put(int fd); /* obsolete
+ /* Group lock */
+ int llapi_group_lock(int fd, int gid);
+ int llapi_group_unlock(int fd, int gid);
++#ifdef __LP64__
+ int llapi_group_lock64(int fd, __u64 gid);
+ int llapi_group_unlock64(int fd, __u64 gid);
++#endif
+ 
+ bool llapi_file_is_sparse(int fd);
+ off_t llapi_data_seek(int src_fd, off_t offset, size_t *length);
diff --git a/lustre-configure.patch b/lustre-configure.patch
new file mode 100644
index 0000000..58877d6
--- /dev/null
+++ b/lustre-configure.patch
@@ -0,0 +1,54 @@
+--- lustre-release-cac870c/config/lustre-build.m4.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/config/lustre-build.m4	2024-05-20 20:02:55.285060327 +0200
+@@ -154,6 +154,7 @@ AC_ARG_ENABLE([modules],
+ 	])
+ AC_MSG_RESULT([$enable_modules ($target_os)])
+ 
++LC_PROG_LINUX
+ AS_IF([test "x$enable_modules" = xyes], [
+ 	AS_IF([test "x$FLEX" = "x"], [AC_MSG_ERROR([flex package is required to build kernel modules])])
+ 	AS_IF([test "x$BISON" = "x"], [AC_MSG_ERROR([bison package is required to build kernel modules])])
+@@ -167,7 +168,6 @@ AS_IF([test "x$enable_modules" = xyes],
+ 			LIBCFS_PROG_LINUX
+ 			LN_PROG_LINUX
+ 			AS_IF([test "x$enable_server" != xno], [LB_EXT4_SRC_DIR])
+-			LC_PROG_LINUX
+ 
+ 			# Run any parallel compile tests
+ 			LB_PROG_LINUX_SRC
+@@ -509,7 +509,6 @@ AC_ARG_ENABLE([server],
+ # before running, so until LB_CONFIG_MODULES can be reorganized, we
+ # call it here.
+ LB_CONFIG_MODULES
+-AS_IF([test x$enable_modules = xno], [enable_server=no])
+ LB_CONFIG_LDISKFS
+ LB_CONFIG_ZFS
+ 
+--- lustre-release-cac870c/lustre/autoconf/lustre-core.m4.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/autoconf/lustre-core.m4	2024-05-20 20:26:24.607425373 +0200
+@@ -286,7 +286,6 @@ AC_ARG_ENABLE([gss_keyring],
+ AC_MSG_RESULT([$enable_gss_keyring])
+ AS_IF([test "x$enable_gss_keyring" != xno], [
+ 	LB_CHECK_CONFIG_IM([KEYS], [], [
+-		gss_keyring_conf_test="fail"
+ 		AC_MSG_WARN([GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel.])])
+ 
+ 	AC_CHECK_LIB([keyutils], [keyctl_search], [], [
+@@ -334,7 +333,7 @@ AC_DEFUN([LC_KEY_TYPE_INSTANTIATE_2ARGS]
+ AC_DEFUN([LC_CONFIG_SUNRPC], [
+ LB_CHECK_CONFIG_IM([SUNRPC], [], [
+ 	AS_IF([test "x$sunrpc_required" = xyes], [
+-		AC_MSG_ERROR([
++		AC_MSG_WARN([
+ 
+ kernel SUNRPC support is required by using GSS.
+ ])
+@@ -4081,7 +4081,7 @@ AS_IF([test "x$enable_crypto" = xin-kern
+ 	      AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via in-kernel fscrypt])], [
+ 	      AC_MSG_ERROR([Lustre client crypto cannot be enabled via in-kernel fscrypt.])
+ 	      enable_crypto=no])],
+-	[AS_IF([test "x$has_is_encrypted" = xyes], [
++	[AS_IF([test "x$enable_crypto" != xno], [
+ 	      AC_DEFINE(HAVE_LUSTRE_CRYPTO, 1, [Enable Lustre client crypto via embedded llcrypt])
+ 	      AC_DEFINE(CONFIG_LL_ENCRYPTION, 1, [embedded llcrypt])
+ 	      AC_DEFINE(HAVE_FSCRYPT_DUMMY_CONTEXT_ENABLED, 1, [embedded llcrypt uses llcrypt_dummy_context_enabled()])
diff --git a/lustre-format.patch b/lustre-format.patch
new file mode 100644
index 0000000..1f47e18
--- /dev/null
+++ b/lustre-format.patch
@@ -0,0 +1,159 @@
+--- lustre-release-cac870c/libcfs/include/libcfs/libcfs_cpu.h.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/libcfs/include/libcfs/libcfs_cpu.h	2024-05-20 17:26:23.682439108 +0200
+@@ -305,7 +305,7 @@ struct workqueue_struct *cfs_cpt_bind_wo
+ 	struct workqueue_attrs attrs = { };
+ 	struct workqueue_struct *wq;
+ 
+-	wq = alloc_workqueue(wq_name, WQ_UNBOUND | flags, nthrs);
++	wq = alloc_workqueue("%s", WQ_UNBOUND | flags, nthrs, wq_name);
+ 	if (!wq)
+ 		return ERR_PTR(-ENOMEM);
+ 
+--- lustre-release-cac870c/lustre/utils/lfs.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/lfs.c	2024-05-20 18:17:43.426251832 +0200
+@@ -2699,7 +2699,7 @@ new_comp:
+ 		rc = llapi_layout_comp_extent_set(layout, prev_end,
+ 						  comp_end);
+ 		if (rc) {
+-			fprintf(stderr, "Set extent [%lu, %lu) failed. %s\n",
++			fprintf(stderr, "Set extent [%"PRIu64", %"PRIu64") failed. %s\n",
+ 				prev_end, comp_end, strerror(errno));
+ 			return rc;
+ 		}
+@@ -2786,7 +2786,7 @@ new_comp:
+ 		rc = llapi_layout_stripe_size_set(layout, size);
+ 
+ 	if (rc) {
+-		fprintf(stderr, "Set stripe size %lu failed: %s\n",
++		fprintf(stderr, "Set stripe size %"PRIu64" failed: %s\n",
+ 			size, strerror(errno));
+ 		return rc;
+ 	}
+@@ -3232,7 +3232,7 @@ static int layout_adjust_first_extent(ch
+ 
+ 	if (start > prev_end || end < prev_end) {
+ 		fprintf(stderr,
+-			"%s setstripe: first extent [%lu, %lu) not adjacent with extent end %lu\n",
++			"%s setstripe: first extent [%"PRIu64", %"PRIu64") not adjacent with extent end %"PRIu64"\n",
+ 			progname, start, end, prev_end);
+ 		return -EINVAL;
+ 	}
+@@ -3240,7 +3240,7 @@ static int layout_adjust_first_extent(ch
+ 	rc = llapi_layout_comp_extent_set(layout, prev_end, end);
+ 	if (rc) {
+ 		fprintf(stderr,
+-			"%s setstripe: cannot set component extent [%lu, %lu): %s\n",
++			"%s setstripe: cannot set component extent [%"PRIu64", %"PRIu64"): %s\n",
+ 			progname, prev_end, end, strerror(errno));
+ 		return rc;
+ 	}
+@@ -11085,7 +11085,7 @@ static inline int lfs_mirror_read(int ar
+ 
+ 		if (written != bytes_read) {
+ 			fprintf(stderr,
+-		"%s %s: written %ld bytes does not match with %ld read.\n",
++		"%s %s: written %zd bytes does not match with %zd read.\n",
+ 				progname, argv[0], written, bytes_read);
+ 			rc = -EIO;
+ 			goto free_buf;
+--- lustre-release-cac870c/lustre/utils/llsom_sync.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/llsom_sync.c	2024-05-20 18:30:09.526728906 +0200
+@@ -272,10 +272,10 @@ static int lsom_update_one(struct fid_re
+ 
+ 	llapi_printf(LLAPI_MSG_DEBUG,
+ 		     "record %llu:%llu, updated LSOM for fid " DFID
+-		     " size:%lu blocks:%lu\n",
++		     " size:%llu blocks:%llu\n",
+ 		     (unsigned long long)f->fr_time,
+ 		     (unsigned long long)f->fr_index,
+-		     PFID(&f->fr_fid), st.st_size, st.st_blocks);
++		     PFID(&f->fr_fid), (unsigned long long)st.st_size, (unsigned long long)st.st_blocks);
+ 
+ clean_up:
+ 	rc = llapi_changelog_clear(opt.o_mdtname,
+--- lustre-release-cac870c/lustre/utils/lhsmtool_posix.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/lhsmtool_posix.c	2024-05-20 18:37:39.159967695 +0200
+@@ -2014,7 +2014,7 @@ static int ct_archive_upgrade_dir(int ar
+ 	}
+ 
+ 	while ((d = readdir(dir)) != NULL) {
+-		CT_TRACE("archive upgrade found %s '%s' (%ld)\n",
++		CT_TRACE("archive upgrade found %s '%s' (%"PRId64")\n",
+ 			 d_type_name(d->d_type), d->d_name, d->d_ino);
+ 
+ 		switch (d->d_type) {
+@@ -2031,12 +2031,12 @@ static int ct_archive_upgrade_dir(int ar
+ 						     dirfd(dir), d->d_name);
+ 			if (rc2 < 0) {
+ 				rc = rc2;
+-				CT_ERROR(rc, "cannot upgrade dir '%s' (%ld)",
++				CT_ERROR(rc, "cannot upgrade dir '%s' (%"PRId64")",
+ 					 d->d_name, d->d_ino);
+ 			}
+ 
+ 			rc2 = unlinkat(dirfd(dir), d->d_name, AT_REMOVEDIR);
+-			CT_TRACE("unlink dir '%s' (%ld): %s",
++			CT_TRACE("unlink dir '%s' (%"PRId64"): %s",
+ 				 d->d_name, d->d_ino, strerror(rc2 < 0 ? errno: 0));
+ 			if (rc2 < 0 && errno != ENOTEMPTY)
+ 				rc = -errno;
+@@ -2051,7 +2051,7 @@ static int ct_archive_upgrade_dir(int ar
+ 			break;
+ 		default:
+ ignore:
+-			CT_TRACE("ignoring unexpected %s '%s' (%ld) in archive",
++			CT_TRACE("ignoring unexpected %s '%s' (%"PRId64") in archive",
+ 				 d_type_name(d->d_type), d->d_name, d->d_ino);
+ 			break;
+ 		}
+--- lustre-release-cac870c/lustre/tests/lockahead_test.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/tests/lockahead_test.c	2024-05-20 18:45:26.591009301 +0200
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <poll.h>
+ #include <time.h>
++#include <inttypes.h>
+ 
+ #include <lustre/lustreapi.h>
+ #include <linux/lustre/lustre_idl.h>
+@@ -1182,10 +1183,10 @@ static int test23(void)
+ 		mainpath2, strerror(errno));
+ 
+ 	ASSERTF(sb.st_size == sb2.st_size,
+-		"size on %s and %s differs: %lu vs %lu",
++		"size on %s and %s differs: %"PRIu64" vs %"PRIu64,
+ 		mainpath, mainpath2, sb.st_size, sb2.st_size);
+ 
+-	ASSERTF(sb.st_size == write_size, "size %lu != bytes written (%lu)",
++	ASSERTF(sb.st_size == write_size, "size %"PRIu64" != bytes written (%zu)",
+ 		sb.st_size, write_size);
+ 
+ 	close(fd);
+--- lustre-release-cac870c/lustre/tests/expand_truncate_test.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/tests/expand_truncate_test.c	2024-05-20 18:49:47.303013091 +0200
+@@ -1,6 +1,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <errno.h>
++#include <inttypes.h>
+ #include <sys/file.h>
+ 
+ int main(int argc, char **argv)
+@@ -24,7 +25,7 @@ int main(int argc, char **argv)
+ 
+ 	off = 1021 * 1024 * 1024;
+ 	if (ftruncate(fd, off) < 0) {
+-		fprintf(stderr, "ftruncate %ld failed:%d\n", off, errno);
++		fprintf(stderr, "ftruncate %"PRId64" failed:%d\n", (int64_t)off, errno);
+ 		rc = -1;
+ 		goto close;
+ 	}
+@@ -32,7 +33,7 @@ int main(int argc, char **argv)
+ 	off -= 4;
+ 	off = lseek(fd, off, SEEK_SET);
+ 	if (off == (off_t)-1) {
+-		fprintf(stderr, "lseek %ld failed:%d\n", off, errno);
++		fprintf(stderr, "lseek %"PRId64" failed:%d\n", (int64_t)off, errno);
+ 		rc = -1;
+ 		goto close;
+ 	}
diff --git a/lustre-heimdal.patch b/lustre-heimdal.patch
new file mode 100644
index 0000000..f9219e7
--- /dev/null
+++ b/lustre-heimdal.patch
@@ -0,0 +1,30 @@
+--- lustre-release-cac870c/lustre/autoconf/kerberos5.m4.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/autoconf/kerberos5.m4	2024-05-21 19:26:48.492063213 +0200
+@@ -31,15 +31,11 @@ AC_DEFUN([AC_KERBEROS_V5],[
+     fi
+     if test "$K5CONFIG" != ""; then
+       KRBCFLAGS=`$K5CONFIG --cflags`
+-      KRBLIBS=`$K5CONFIG --libs gssapi`
++      KRBLIBS=`$K5CONFIG --libs gssapi`
+       K5VERS=`$K5CONFIG --version | head -n 1 | awk '{split($(4),v,"."); if (v@<:@"3"@:>@ == "") v@<:@"3"@:>@ = "0"; print v@<:@"1"@:>@v@<:@"2"@:>@v@<:@"3"@:>@ }'`
+       AC_DEFINE_UNQUOTED(KRB5_VERSION, $K5VERS, [Define this as the Kerberos version number])
+       if test -f $dir/include/gssapi/gssapi_krb5.h -a \
+-                \( -f $dir/lib/libgssapi_krb5.a -o \
+-                   -f $dir/lib64/libgssapi_krb5.a -o \
+-                   -f $dir/lib64/libgssapi_krb5.so -o \
+-                   -f $dir/lib/x86_64-linux-gnu/libgssapi_krb5.so -o \
+-                   -f $dir/lib/libgssapi_krb5.so \) ; then
++                -f $dir/include/kdb.h ; then
+          KRBDIR="$dir"
+   dnl If we are using MIT K5 1.3.1 and before, we *MUST* use the
+   dnl private function (gss_krb5_ccache_name) to get correct
+@@ -55,8 +51,7 @@ AC_DEFUN([AC_KERBEROS_V5],[
+       dnl The following ugly hack brought on by the split installation
+       dnl of Heimdal Kerberos on SuSe
+       elif test \( -f $dir/include/heim_err.h -o\
+-      		 -f $dir/include/heimdal/heim_err.h \) -a \
+-                -f $dir/lib/libroken.a; then
++      		 -f $dir/include/heimdal/heim_err.h \); then
+          AC_DEFINE(HAVE_HEIMDAL, 1, [Define this if you have Heimdal Kerberos libraries])
+          KRBDIR="$dir"
+          gssapi_lib=gssapi
diff --git a/lustre-link.patch b/lustre-link.patch
new file mode 100644
index 0000000..e255086
--- /dev/null
+++ b/lustre-link.patch
@@ -0,0 +1,18 @@
+--- lustre-release-cac870c/lnet/utils/lnetconfig/Makefile.am.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lnet/utils/lnetconfig/Makefile.am	2024-05-20 18:08:18.831319015 +0200
+@@ -33,7 +33,7 @@ liblnetconfig_la_SOURCES  = liblnetconfi
+ 			    liblnetconfig_udsp.c liblnetconfig_netlink.c
+ liblnetconfig_la_CPPFLAGS = -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
+ 			    -DLUSTRE_UTILS=1 $(LIBNL3_CFLAGS) -fPIC
+-liblnetconfig_la_LDFLAGS = -L$(top_builddir)/libcfs/libcfs -lyaml -lm \
++liblnetconfig_la_LDFLAGS = -lyaml -lm \
+ 			   $(LIBREADLINE) -version-info 4:0:0
+ liblnetconfig_la_LIBADD = $(top_builddir)/libcfs/libcfs/libcfs.la \
+ 			  $(LIBNL3_LIBS)
+--- lustre-release-cac870c/lustre/utils/lustre.pc.in.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/lustre.pc.in	2024-05-20 20:05:12.307651345 +0200
+@@ -8,3 +8,4 @@ Description: Library that applications c
+ Version: @PACKAGE_VERSION@
+ Cflags: -I${includedir}/lustre
+ Libs: -L${libdir} -llustreapi
++Libs.private: -llnetconfig -lyaml
diff --git a/lustre-snmp.patch b/lustre-snmp.patch
new file mode 100644
index 0000000..a79820e
--- /dev/null
+++ b/lustre-snmp.patch
@@ -0,0 +1,28 @@
+--- lustre-release-cac870c/snmp/lustre-snmp.h.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/snmp/lustre-snmp.h	2024-05-20 17:38:51.655671784 +0200
+@@ -37,10 +37,10 @@
+ #include "lustre-snmp-util.h"
+ #include "lustre-snmp-trap.h"
+ 
+-config_require(util_funcs)
+-config_add_mib(LUSTRE-MIB)
+-config_require(lustre/cfs_util)
+-config_require(lustre/cfs_trap)
++config_require(util_funcs);
++config_add_mib(LUSTRE-MIB);
++config_require(lustre/cfs_util);
++config_require(lustre/cfs_trap);
+ 
+ /* function prototypes */
+ void   init_cfsNetSNMPPlugin(void);
+--- lustre-release-cac870c/snmp/Makefile.am.orig	2024-05-20 21:26:50.847780343 +0200
++++ lustre-release-cac870c/snmp/Makefile.am	2024-05-20 21:26:57.724409756 +0200
+@@ -12,7 +12,7 @@ liblustresnmp_la_SOURCES =	\
+ LIBCFS = $(top_builddir)/libcfs/libcfs/libcfs.la
+ 
+ liblustresnmp_la_CFLAGS := $(NET_SNMP_CFLAGS)
+-liblustresnmp_la_LIBADD := $(NET_SNMP_LIBS) $(LIBCFS)
++liblustresnmp_la_LIBADD := $(NET_SNMP_LIBS) $(LIBCFS) -lreadline
+ liblustresnmp_la_LDFLAGS := -version-info 1:0:0
+ 
+ SUBDIRS =
diff --git a/lustre-tests.patch b/lustre-tests.patch
new file mode 100644
index 0000000..73a3d16
--- /dev/null
+++ b/lustre-tests.patch
@@ -0,0 +1,11 @@
+--- lustre-release-cac870c/lustre/utils/wiretest.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/wiretest.c	2024-05-20 18:14:21.427824277 +0200
+@@ -4745,8 +4745,6 @@ void lustre_assert_wire_constants(void)
+ 		 (long long)(int)sizeof(((struct fiemap *)0)->fm_reserved));
+ 	LASSERTF((int)offsetof(struct fiemap, fm_extents) == 32, "found %lld\n",
+ 		 (long long)(int)offsetof(struct fiemap, fm_extents));
+-	LASSERTF((int)sizeof(((struct fiemap *)0)->fm_extents) == 0, "found %lld\n",
+-		 (long long)(int)sizeof(((struct fiemap *)0)->fm_extents));
+ 	BUILD_BUG_ON(FIEMAP_FLAG_SYNC != 0x00000001);
+ 	BUILD_BUG_ON(FIEMAP_FLAG_XATTR != 0x00000002);
+ 	BUILD_BUG_ON(FIEMAP_FLAG_DEVICE_ORDER != 0x40000000);
diff --git a/lustre-zfs.patch b/lustre-zfs.patch
new file mode 100644
index 0000000..9f55e7a
--- /dev/null
+++ b/lustre-zfs.patch
@@ -0,0 +1,79 @@
+--- lustre-release-cac870c/lustre/utils/libmount_utils_zfs.c.orig	2023-12-23 04:15:24.000000000 +0100
++++ lustre-release-cac870c/lustre/utils/libmount_utils_zfs.c	2024-05-20 21:19:50.733389631 +0200
+@@ -62,17 +62,17 @@ struct zfs_ldd_prop_bridge {
+ 	int   zlpb_ldd_offset;
+ 	/* Function pointer responsible for reading in the @prop
+ 	 * property from @zhp and storing it in @ldd_field */
+-	int (*zlpb_get_prop_fn)(zfs_handle_t *zhp, char *prop, void *ldd_field);
++	int (*zlpb_get_prop_fn)(zfs_handle_t *zhp, const char *prop, void *ldd_field);
+ 	/* Function pointer responsible for writing the value of @ldd_field
+ 	 * into the @prop dataset property in @zhp */
+-	int (*zlpb_set_prop_fn)(zfs_handle_t *zhp, char *prop, void *ldd_field);
++	int (*zlpb_set_prop_fn)(zfs_handle_t *zhp, const char *prop, void *ldd_field);
+ };
+ 
+ /* Forward declarations needed to initialize the ldd prop bridge list */
+-static int zfs_get_prop_int(zfs_handle_t *, char *, void *);
+-static int zfs_set_prop_int(zfs_handle_t *, char *, void *);
+-static int zfs_get_prop_str(zfs_handle_t *, char *, void *);
+-static int zfs_set_prop_str(zfs_handle_t *, char *, void *);
++static int zfs_get_prop_int(zfs_handle_t *, const char *, void *);
++static int zfs_set_prop_int(zfs_handle_t *, const char *, void *);
++static int zfs_get_prop_str(zfs_handle_t *, const char *, void *);
++static int zfs_set_prop_str(zfs_handle_t *, const char *, void *);
+ 
+ /* Helper for initializing the entries in the special_ldd_prop_params list.
+  *    - @name: stored directly in the zlpb_prop_name field
+@@ -113,7 +113,7 @@ static libzfs_handle_t *g_zfs;
+ 
+ void zfs_fini(void);
+ 
+-static int zfs_set_prop_int(zfs_handle_t *zhp, char *prop, void *val)
++static int zfs_set_prop_int(zfs_handle_t *zhp, const char *prop, void *val)
+ {
+ 	char str[64];
+ 	int ret;
+@@ -129,7 +129,7 @@ static int zfs_set_prop_int(zfs_handle_t
+  * Write the zfs property string, note that properties with a NULL or
+  * zero-length value will not be written and 0 returned.
+  */
+-static int zfs_set_prop_str(zfs_handle_t *zhp, char *prop, void *val)
++static int zfs_set_prop_str(zfs_handle_t *zhp, const char *prop, void *val)
+ {
+ 	int ret = 0;
+ 
+@@ -173,7 +173,7 @@ static int zfs_erase_prop(zfs_handle_t *
+ 	return zfs_remove_prop(zhp, nvl, propname);
+ }
+ 
+-static int zfs_is_special_ldd_prop_param(char *name)
++static int zfs_is_special_ldd_prop_param(const char *name)
+ {
+ 	int i;
+ 
+@@ -478,10 +478,10 @@ int zfs_erase_ldd(struct mkfs_opts *mop,
+ 	return add_param(mop->mo_ldd.ldd_params, key, "");
+ }
+ 
+-static int zfs_get_prop_int(zfs_handle_t *zhp, char *prop, void *val)
++static int zfs_get_prop_int(zfs_handle_t *zhp, const char *prop, void *val)
+ {
+ 	nvlist_t *propval;
+-	char *propstr;
++	const char *propstr;
+ 	int ret;
+ 
+ 	ret = nvlist_lookup_nvlist(zfs_get_user_props(zhp), prop, &propval);
+@@ -500,10 +500,10 @@ static int zfs_get_prop_int(zfs_handle_t
+ 	return ret;
+ }
+ 
+-static int zfs_get_prop_str(zfs_handle_t *zhp, char *prop, void *val)
++static int zfs_get_prop_str(zfs_handle_t *zhp, const char *prop, void *val)
+ {
+ 	nvlist_t *propval;
+-	char *propstr;
++	const char *propstr;
+ 	int ret;
+ 
+ 	ret = nvlist_lookup_nvlist(zfs_get_user_props(zhp), prop, &propval);
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lustre.git/commitdiff/e6baadc407f8db40198e99a2851218750c7ab115



More information about the pld-cvs-commit mailing list