From 88b89eb2da9d8255c613e317c0b0f0620b9cf622 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Mon, 18 Aug 2014 12:58:29 -0500 Subject: [PATCH] LU-2675 lustre: remove linux/lustre_lib.h Remove lustre/include/linux/lustre_lib.h. Remove some unused declarations from lustre/include/lustre_lib.h and move some others to more natural headers. Signed-off-by: John L. Hammond Change-Id: I30b032e5e766cc052dbf6af34eb2e5d3f1af589e Reviewed-on: http://review.whamcloud.com/11500 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- lustre/include/linux/Makefile.am | 2 +- lustre/include/linux/lustre_lib.h | 80 --------------------------------------- lustre/include/lustre_lib.h | 40 ++------------------ lustre/include/obd.h | 16 ++++++++ lustre/include/obd_class.h | 5 +++ lustre/llite/file.c | 7 +++- lustre/lod/lod_internal.h | 7 ++++ 7 files changed, 39 insertions(+), 118 deletions(-) delete mode 100644 lustre/include/linux/lustre_lib.h diff --git a/lustre/include/linux/Makefile.am b/lustre/include/linux/Makefile.am index d3ff9a0..ea51f78 100644 --- a/lustre/include/linux/Makefile.am +++ b/lustre/include/linux/Makefile.am @@ -42,7 +42,7 @@ if UTILS linux_HEADERS = lustre_user.h endif -EXTRA_DIST = lustre_lib.h \ +EXTRA_DIST = \ lustre_net.h obd_class.h obd_support.h \ obd.h lvfs.h lustre_log.h lustre_compat25.h lustre_lite.h lustre_quota.h \ lustre_user.h lustre_patchless_compat.h diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h deleted file mode 100644 index f5680fe..0000000 --- a/lustre/include/linux/lustre_lib.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program 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 version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2011, 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lustre_lib.h - * - * Basic Lustre library routines. - */ - -#ifndef _LINUX_LUSTRE_LIB_H -#define _LINUX_LUSTRE_LIB_H - -#ifndef _LUSTRE_LIB_H -#error Do not #include this file directly. #include instead -#endif - -#include -#include -#include -#include -#include - -#ifndef LP_POISON -#if BITS_PER_LONG > 32 -# define LI_POISON ((int)0x5a5a5a5a5a5a5a5a) -# define LL_POISON ((long)0x5a5a5a5a5a5a5a5a) -# define LP_POISON ((void *)(long)0x5a5a5a5a5a5a5a5a) -#else -# define LI_POISON ((int)0x5a5a5a5a) -# define LL_POISON ((long)0x5a5a5a5a) -# define LP_POISON ((void *)(long)0x5a5a5a5a) -#endif -#endif - -#define LUSTRE_FATAL_SIGS (sigmask(SIGKILL) | sigmask(SIGINT) | \ - sigmask(SIGTERM) | sigmask(SIGQUIT) | \ - sigmask(SIGALRM)) - -/* initialize ost_lvb according to inode */ -static inline void inode_init_lvb(struct inode *inode, struct ost_lvb *lvb) -{ - lvb->lvb_size = i_size_read(inode); - lvb->lvb_blocks = inode->i_blocks; - lvb->lvb_mtime = LTIME_S(inode->i_mtime); - lvb->lvb_atime = LTIME_S(inode->i_atime); - lvb->lvb_ctime = LTIME_S(inode->i_ctime); -} - -#endif /* _LUSTRE_LIB_H */ diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index e1a4c2a..e37b2f7 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -46,14 +46,13 @@ * @{ */ +#include #include #include #include #include -#include /* target.c */ -struct kstatfs; struct ptlrpc_request; struct obd_export; struct lu_target; @@ -85,42 +84,8 @@ int do_set_info_async(struct obd_import *imp, obd_count vallen, void *val, struct ptlrpc_request_set *set); -#define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */ - void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id); -/* client.c */ - -int client_sanobd_setup(struct obd_device *obddev, struct lustre_cfg* lcfg); -struct client_obd *client_conn2cli(struct lustre_handle *conn); - -struct md_open_data; -struct obd_client_handle { - struct lustre_handle och_fh; - struct lu_fid och_fid; - struct md_open_data *och_mod; - struct lustre_handle och_lease_handle; /* open lock for lease */ - __u32 och_magic; - int och_flags; -}; -#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed - -/* statfs_pack.c */ -void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs); -void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs); - -/* Until such time as we get_info the per-stripe maximum from the OST, - * we define this to be 2T - 4k, which is the ext3 maxbytes. */ -#define LUSTRE_STRIPE_MAXBYTES 0x1fffffff000ULL - -/* Special values for remove LOV EA from disk */ -#define LOVEA_DELETE_VALUES(size, count, offset) (size == 0 && count == 0 && \ - offset == (typeof(offset))(-1)) - -#define LMVEA_DELETE_VALUES(count, offset) ((count) == 0 && \ - (offset) == (typeof(offset))(-1)) -/* #define POISON_BULK 0 */ - /* * l_wait_event is a flexible sleeping function, permitting simple caller * configuration of interrupt and timeout sensitivity along with actions to @@ -242,6 +207,9 @@ struct l_wait_info { #define LWI_INTR(cb, data) LWI_TIMEOUT_INTR(0, NULL, cb, data) +#define LUSTRE_FATAL_SIGS \ + (sigmask(SIGKILL) | sigmask(SIGINT) | sigmask(SIGTERM) | \ + sigmask(SIGQUIT) | sigmask(SIGALRM)) /* * wait for @condition to become true, but no longer than timeout, specified diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 2a2bb37..94ba798 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -83,6 +84,10 @@ static inline void loi_init(struct lov_oinfo *loi) { } +/* Until such time as we get_info the per-stripe maximum from the OST, + * we define this to be 2T - 4k, which is the ext3 maxbytes. */ +#define LUSTRE_STRIPE_MAXBYTES 0x1fffffff000ULL + struct lov_stripe_md { atomic_t lsm_refc; spinlock_t lsm_lock; @@ -1018,6 +1023,17 @@ struct md_open_data { bool mod_is_create; }; +struct obd_client_handle { + struct lustre_handle och_fh; + struct lu_fid och_fid; + struct md_open_data *och_mod; + struct lustre_handle och_lease_handle; /* open lock for lease */ + __u32 och_magic; + int och_flags; +}; + +#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed + struct lookup_intent; struct cl_attr; diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index 844f405..71269f6 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1920,6 +1920,11 @@ void class_exit_uuidlist(void); /* prng.c */ #define ll_generate_random_uuid(uuid_out) cfs_get_random_bytes(uuid_out, sizeof(class_uuid_t)) +/* statfs_pack.c */ +struct kstatfs; +void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs); +void statfs_unpack(struct kstatfs *sfs, struct obd_statfs *osfs); + /* root squash info */ struct rw_semaphore; struct root_squash_info { diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 19948f7..7c00ed5 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1036,7 +1036,12 @@ int ll_merge_lvb(const struct lu_env *env, struct inode *inode) LTIME_S(inode->i_atime) = lli->lli_lvb.lvb_atime; LTIME_S(inode->i_mtime) = lli->lli_lvb.lvb_mtime; LTIME_S(inode->i_ctime) = lli->lli_lvb.lvb_ctime; - inode_init_lvb(inode, &lvb); + + lvb.lvb_size = i_size_read(inode); + lvb.lvb_blocks = inode->i_blocks; + lvb.lvb_mtime = LTIME_S(inode->i_mtime); + lvb.lvb_atime = LTIME_S(inode->i_atime); + lvb.lvb_ctime = LTIME_S(inode->i_ctime); cl_object_attr_lock(obj); rc = cl_object_attr_get(env, obj, attr); diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h index 0aa33c4..b1f828c 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h @@ -45,6 +45,13 @@ #define LOV_USES_ASSIGNED_STRIPE 0 #define LOV_USES_DEFAULT_STRIPE 1 +/* Special values to remove LOV EA from disk */ +#define LOVEA_DELETE_VALUES(size, count, offset) \ + ((size) == 0 && (count) == 0 && (offset) == (typeof(offset))(-1)) + +#define LMVEA_DELETE_VALUES(count, offset) \ + ((count) == 0 && (offset) == (typeof(offset))(-1)) + struct lod_qos_rr { __u32 lqr_start_idx; /* start index of new inode */ __u32 lqr_offset_idx; /* aliasing for start_idx */ -- 1.8.3.1