diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass')
40 files changed, 316 insertions, 341 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile b/drivers/staging/lustre/lustre/obdclass/Makefile index 8a0e08ced454..ba10043fdd50 100644 --- a/drivers/staging/lustre/lustre/obdclass/Makefile +++ b/drivers/staging/lustre/lustre/obdclass/Makefile @@ -8,6 +8,3 @@ obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \ mea.o lu_object.o dt_object.o capa.o cl_object.o \ cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o idmap.o \ lu_ucred.o - - -ccflags-y := -I$(src)/../include diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c index f0bb632a70aa..3b394a0bff9d 100644 --- a/drivers/staging/lustre/lustre/obdclass/acl.c +++ b/drivers/staging/lustre/lustre/obdclass/acl.c @@ -41,10 +41,10 @@ */ #define DEBUG_SUBSYSTEM S_SEC -#include <lu_object.h> -#include <lustre_acl.h> -#include <lustre_eacl.h> -#include <obd_support.h> +#include "../include/lu_object.h" +#include "../include/lustre_acl.h" +#include "../include/lustre_eacl.h" +#include "../include/obd_support.h" #ifdef CONFIG_FS_POSIX_ACL diff --git a/drivers/staging/lustre/lustre/obdclass/capa.c b/drivers/staging/lustre/lustre/obdclass/capa.c index be1c613383a6..5af61a8c0b85 100644 --- a/drivers/staging/lustre/lustre/obdclass/capa.c +++ b/drivers/staging/lustre/lustre/obdclass/capa.c @@ -48,12 +48,12 @@ #include <linux/module.h> #include <linux/crypto.h> -#include <obd_class.h> -#include <lustre_debug.h> -#include <lustre/lustre_idl.h> +#include "../include/obd_class.h" +#include "../include/lustre_debug.h" +#include "../include/lustre/lustre_idl.h" #include <linux/list.h> -#include <lustre_capa.h> +#include "../include/lustre_capa.h" #define NR_CAPAHASH 32 #define CAPA_HASH_SIZE 3000 /* for MDS & OSS */ @@ -143,9 +143,9 @@ static inline int capa_hashfn(struct lu_fid *fid) * client renew right after obtaining it. */ static inline int capa_is_to_expire(struct obd_capa *oc) { - return cfs_time_before(cfs_time_sub(oc->c_expiry, - cfs_time_seconds(oc->c_capa.lc_timeout)*2/3), - cfs_time_current()); + return time_before(cfs_time_sub(oc->c_expiry, + cfs_time_seconds(oc->c_capa.lc_timeout)*2/3), + cfs_time_current()); } static struct obd_capa *find_capa(struct lustre_capa *capa, @@ -279,6 +279,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key) } keylen = alg->ha_keylen; + sg_init_table(&sl, 1); sg_set_page(&sl, virt_to_page(capa), offsetof(struct lustre_capa, lc_hmac), (unsigned long)(capa) % PAGE_CACHE_SIZE); @@ -320,9 +321,11 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen) GOTO(out, rc); } + sg_init_table(&sd, 1); sg_set_page(&sd, virt_to_page(d), 16, (unsigned long)(d) % PAGE_CACHE_SIZE); + sg_init_table(&ss, 1); sg_set_page(&ss, virt_to_page(s), 16, (unsigned long)(s) % PAGE_CACHE_SIZE); desc.tfm = tfm; @@ -370,9 +373,11 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen) GOTO(out, rc); } + sg_init_table(&sd, 1); sg_set_page(&sd, virt_to_page(d), 16, (unsigned long)(d) % PAGE_CACHE_SIZE); + sg_init_table(&ss, 1); sg_set_page(&ss, virt_to_page(s), 16, (unsigned long)(s) % PAGE_CACHE_SIZE); @@ -406,8 +411,8 @@ void _debug_capa(struct lustre_capa *c, va_list args; va_start(args, fmt); libcfs_debug_vmsg2(msgdata, fmt, args, - " capability@%p fid "DFID" opc "LPX64" uid "LPU64 - " gid "LPU64" flags %u alg %d keyid %u timeout %u " + " capability@%p fid "DFID" opc %#llx uid %llu" + " gid %llu flags %u alg %d keyid %u timeout %u " "expiry %u\n", c, PFID(capa_fid(c)), capa_opc(c), capa_uid(c), capa_gid(c), capa_flags(c), capa_alg(c), capa_keyid(c), capa_timeout(c), diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index 3bebc78e7673..6870ee823736 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -40,11 +40,11 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> -#include <obd_support.h> -#include <lustre_fid.h> +#include "../include/obd_class.h" +#include "../include/obd_support.h" +#include "../include/lustre_fid.h" #include <linux/list.h> -#include <cl_object.h> +#include "../include/cl_object.h" #include "cl_internal.h" /***************************************************************************** @@ -227,7 +227,7 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io, LINVRNT(io->ci_obj != NULL); LU_OBJECT_HEADER(D_VFSTRACE, env, &io->ci_obj->co_lu, - "io range: %u ["LPU64", "LPU64") %u %u\n", + "io range: %u [%llu, %llu) %u %u\n", iot, (__u64)pos, (__u64)pos + count, io->u.ci_rw.crw_nonblock, io->u.ci_wr.wr_append); io->u.ci_rw.crw_pos = pos; diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index df77c4fc0eac..7d99319b714e 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -40,11 +40,11 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> -#include <obd_support.h> -#include <lustre_fid.h> +#include "../include/obd_class.h" +#include "../include/obd_support.h" +#include "../include/lustre_fid.h" #include <linux/list.h> -#include <cl_object.h> +#include "../include/cl_object.h" #include "cl_internal.h" /** Lock class of cl_lock::cll_guard */ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c index 41cbc95b916e..ce96bd279111 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c @@ -51,14 +51,14 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <linux/libcfs/libcfs.h> +#include "../../include/linux/libcfs/libcfs.h" /* class_put_type() */ -#include <obd_class.h> -#include <obd_support.h> -#include <lustre_fid.h> +#include "../include/obd_class.h" +#include "../include/obd_support.h" +#include "../include/lustre_fid.h" #include <linux/list.h> -#include <linux/libcfs/libcfs_hash.h> /* for cfs_hash stuff */ -#include <cl_object.h> +#include "../../include/linux/libcfs/libcfs_hash.h" /* for cfs_hash stuff */ +#include "../include/cl_object.h" #include "cl_internal.h" static struct kmem_cache *cl_env_kmem; @@ -295,8 +295,7 @@ int cl_object_glimpse(const struct lu_env *env, struct cl_object *obj, } } LU_OBJECT_HEADER(D_DLMTRACE, env, lu_object_top(top), - "size: "LPU64" mtime: "LPU64" atime: "LPU64" " - "ctime: "LPU64" blocks: "LPU64"\n", + "size: %llu mtime: %llu atime: %llu ctime: %llu blocks: %llu\n", lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_atime, lvb->lvb_ctime, lvb->lvb_blocks); return result; diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 1b616e4fe140..b7dd04808060 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -40,12 +40,12 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <linux/libcfs/libcfs.h> -#include <obd_class.h> -#include <obd_support.h> +#include "../../include/linux/libcfs/libcfs.h" +#include "../include/obd_class.h" +#include "../include/obd_support.h" #include <linux/list.h> -#include <cl_object.h> +#include "../include/cl_object.h" #include "cl_internal.h" static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg, diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index dde04b767a6d..8b19f3caa68f 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -37,14 +37,14 @@ #define DEBUG_SUBSYSTEM S_CLASS # include <asm/atomic.h> -#include <obd_support.h> -#include <obd_class.h> -#include <linux/lnet/lnetctl.h> -#include <lustre_debug.h> -#include <lprocfs_status.h> -#include <lustre/lustre_build_version.h> +#include "../include/obd_support.h" +#include "../include/obd_class.h" +#include "../../include/linux/lnet/lnetctl.h" +#include "../include/lustre_debug.h" +#include "../include/lprocfs_status.h" +#include "../include/lustre/lustre_build_version.h" #include <linux/list.h> -#include <cl_object.h> +#include "../include/cl_object.h" #include "llog_internal.h" @@ -141,11 +141,11 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, { if (ptr == NULL || (cfs_rand() & OBD_ALLOC_FAIL_MASK) < obd_alloc_fail_rate) { - CERROR("%s%salloc of %s ("LPU64" bytes) failed at %s:%d\n", + CERROR("%s%salloc of %s (%llu bytes) failed at %s:%d\n", ptr ? "force " :"", type, name, (__u64)size, file, line); - CERROR(LPU64" total bytes and "LPU64" total pages " - "("LPU64" bytes) allocated by Lustre, " + CERROR("%llu total bytes and %llu total pages " + "(%llu bytes) allocated by Lustre, " "%d total bytes by LNET\n", obd_memory_sum(), obd_pages_sum() << PAGE_CACHE_SHIFT, @@ -420,61 +420,61 @@ int obd_init_checks(void) char buf[64]; int len, ret = 0; - CDEBUG(D_INFO, "LPU64=%s, LPD64=%s, LPX64=%s\n", LPU64, LPD64, LPX64); + CDEBUG(D_INFO, "LPU64=%s, LPD64=%s, LPX64=%s\n", "%llu", "%lld", "%#llx"); - CDEBUG(D_INFO, "OBD_OBJECT_EOF = "LPX64"\n", (__u64)OBD_OBJECT_EOF); + CDEBUG(D_INFO, "OBD_OBJECT_EOF = %#llx\n", (__u64)OBD_OBJECT_EOF); u64val = OBD_OBJECT_EOF; - CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = "LPX64"\n", u64val); + CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = %#llx\n", u64val); if (u64val != OBD_OBJECT_EOF) { - CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n", + CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n", u64val, (int)sizeof(u64val)); ret = -EINVAL; } - len = snprintf(buf, sizeof(buf), LPX64, u64val); + len = snprintf(buf, sizeof(buf), "%#llx", u64val); if (len != 18) { CWARN("LPX64 wrong length! strlen(%s)=%d != 18\n", buf, len); ret = -EINVAL; } div64val = OBD_OBJECT_EOF; - CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = "LPX64"\n", u64val); + CDEBUG(D_INFO, "u64val OBD_OBJECT_EOF = %#llx\n", u64val); if (u64val != OBD_OBJECT_EOF) { - CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n", + CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n", u64val, (int)sizeof(u64val)); ret = -EOVERFLOW; } if (u64val >> 8 != OBD_OBJECT_EOF >> 8) { - CERROR("__u64 "LPX64"(%d) != 0xffffffffffffffff\n", + CERROR("__u64 %#llx(%d) != 0xffffffffffffffff\n", u64val, (int)sizeof(u64val)); return -EOVERFLOW; } if (do_div(div64val, 256) != (u64val & 255)) { - CERROR("do_div("LPX64",256) != "LPU64"\n", u64val, u64val &255); + CERROR("do_div(%#llx,256) != %llu\n", u64val, u64val &255); return -EOVERFLOW; } if (u64val >> 8 != div64val) { - CERROR("do_div("LPX64",256) "LPU64" != "LPU64"\n", + CERROR("do_div(%#llx,256) %llu != %llu\n", u64val, div64val, u64val >> 8); return -EOVERFLOW; } - len = snprintf(buf, sizeof(buf), LPX64, u64val); + len = snprintf(buf, sizeof(buf), "%#llx", u64val); if (len != 18) { CWARN("LPX64 wrong length! strlen(%s)=%d != 18\n", buf, len); ret = -EINVAL; } - len = snprintf(buf, sizeof(buf), LPU64, u64val); + len = snprintf(buf, sizeof(buf), "%llu", u64val); if (len != 20) { CWARN("LPU64 wrong length! strlen(%s)=%d != 20\n", buf, len); ret = -EINVAL; } - len = snprintf(buf, sizeof(buf), LPD64, u64val); + len = snprintf(buf, sizeof(buf), "%lld", u64val); if (len != 2) { CWARN("LPD64 wrong length! strlen(%s)=%d != 2\n", buf, len); ret = -EINVAL; } if ((u64val & ~CFS_PAGE_MASK) >= PAGE_CACHE_SIZE) { - CWARN("mask failed: u64val "LPU64" >= "LPU64"\n", u64val, + CWARN("mask failed: u64val %llu >= %llu\n", u64val, (__u64)PAGE_CACHE_SIZE); ret = -EINVAL; } @@ -483,7 +483,7 @@ int obd_init_checks(void) } extern spinlock_t obd_types_lock; -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) extern int class_procfs_init(void); extern int class_procfs_clean(void); #else @@ -594,7 +594,7 @@ void obd_update_maxusage(void) } EXPORT_SYMBOL(obd_update_maxusage); -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) __u64 obd_memory_max(void) { __u64 ret; @@ -662,10 +662,10 @@ static void cleanup_obdclass(void) lprocfs_free_stats(&obd_memory); CDEBUG((memory_leaked) ? D_ERROR : D_INFO, - "obd_memory max: "LPU64", leaked: "LPU64"\n", + "obd_memory max: %llu, leaked: %llu\n", memory_max, memory_leaked); CDEBUG((pages_leaked) ? D_ERROR : D_INFO, - "obd_memory_pages max: "LPU64", leaked: "LPU64"\n", + "obd_memory_pages max: %llu, leaked: %llu\n", pages_max, pages_leaked); } diff --git a/drivers/staging/lustre/lustre/obdclass/debug.c b/drivers/staging/lustre/lustre/obdclass/debug.c index a4e7e754177f..e8aa42beb3c7 100644 --- a/drivers/staging/lustre/lustre/obdclass/debug.c +++ b/drivers/staging/lustre/lustre/obdclass/debug.c @@ -41,15 +41,15 @@ #define DEBUG_SUBSYSTEM D_OTHER -#include <obd_ost.h> -#include <obd_support.h> -#include <lustre_debug.h> -#include <lustre_net.h> +#include "../include/obd_ost.h" +#include "../include/obd_support.h" +#include "../include/lustre_debug.h" +#include "../include/lustre_net.h" void dump_lniobuf(struct niobuf_local *nb) { CDEBUG(D_RPCTRACE, - "niobuf_local: file_offset="LPD64", len=%d, page=%p, rc=%d\n", + "niobuf_local: file_offset=%lld, len=%d, page=%p, rc=%d\n", nb->lnb_file_offset, nb->len, nb->page, nb->rc); CDEBUG(D_RPCTRACE, "nb->page: index = %ld\n", nb->page ? page_index(nb->page) : -1); @@ -84,25 +84,25 @@ int block_debug_check(char *who, void *addr, int end, __u64 off, __u64 id) ne_off = le64_to_cpu (off); id = le64_to_cpu (id); if (memcmp(addr, (char *)&ne_off, LPDS)) { - CDEBUG(D_ERROR, "%s: id "LPX64" offset "LPU64" off: "LPX64" != " - LPX64"\n", who, id, off, *(__u64 *)addr, ne_off); + CDEBUG(D_ERROR, "%s: id %#llx offset %llu off: %#llx != %#llx\n", + who, id, off, *(__u64 *)addr, ne_off); err = -EINVAL; } if (memcmp(addr + LPDS, (char *)&id, LPDS)) { - CDEBUG(D_ERROR, "%s: id "LPX64" offset "LPU64" id: "LPX64" != "LPX64"\n", + CDEBUG(D_ERROR, "%s: id %#llx offset %llu id: %#llx != %#llx\n", who, id, off, *(__u64 *)(addr + LPDS), id); err = -EINVAL; } addr += end - LPDS - LPDS; if (memcmp(addr, (char *)&ne_off, LPDS)) { - CDEBUG(D_ERROR, "%s: id "LPX64" offset "LPU64" end off: "LPX64" != " - LPX64"\n", who, id, off, *(__u64 *)addr, ne_off); + CDEBUG(D_ERROR, "%s: id %#llx offset %llu end off: %#llx != %#llx\n", + who, id, off, *(__u64 *)addr, ne_off); err = -EINVAL; } if (memcmp(addr + LPDS, (char *)&id, LPDS)) { - CDEBUG(D_ERROR, "%s: id "LPX64" offset "LPU64" end id: "LPX64" != " - LPX64"\n", who, id, off, *(__u64 *)(addr + LPDS), id); + CDEBUG(D_ERROR, "%s: id %#llx offset %llu end id: %#llx != %#llx\n", + who, id, off, *(__u64 *)(addr + LPDS), id); err = -EINVAL; } diff --git a/drivers/staging/lustre/lustre/obdclass/dt_object.c b/drivers/staging/lustre/lustre/obdclass/dt_object.c index 1b164c7027b1..130b8dd0b418 100644 --- a/drivers/staging/lustre/lustre/obdclass/dt_object.c +++ b/drivers/staging/lustre/lustre/obdclass/dt_object.c @@ -43,13 +43,13 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd.h> -#include <dt_object.h> +#include "../include/obd.h" +#include "../include/dt_object.h" #include <linux/list.h> /* fid_be_to_cpu() */ -#include <lustre_fid.h> +#include "../include/lustre_fid.h" -#include <lustre_quota.h> +#include "../include/lustre_quota.h" /* context key constructor/destructor: dt_global_key_init, dt_global_key_fini */ LU_KEY_INIT(dt_global, struct dt_thread_info); @@ -929,7 +929,7 @@ out: } EXPORT_SYMBOL(dt_index_read); -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) int lprocfs_dt_rd_blksize(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -963,7 +963,7 @@ int lprocfs_dt_rd_kbytestotal(char *page, char **start, off_t off, result <<= 1; *eof = 1; - rc = snprintf(page, count, LPU64"\n", result); + rc = snprintf(page, count, "%llu\n", result); } return rc; @@ -985,7 +985,7 @@ int lprocfs_dt_rd_kbytesfree(char *page, char **start, off_t off, result <<= 1; *eof = 1; - rc = snprintf(page, count, LPU64"\n", result); + rc = snprintf(page, count, "%llu\n", result); } return rc; @@ -1007,7 +1007,7 @@ int lprocfs_dt_rd_kbytesavail(char *page, char **start, off_t off, result <<= 1; *eof = 1; - rc = snprintf(page, count, LPU64"\n", result); + rc = snprintf(page, count, "%llu\n", result); } return rc; @@ -1023,7 +1023,7 @@ int lprocfs_dt_rd_filestotal(char *page, char **start, off_t off, int rc = dt_statfs(NULL, dt, &osfs); if (rc == 0) { *eof = 1; - rc = snprintf(page, count, LPU64"\n", osfs.os_files); + rc = snprintf(page, count, "%llu\n", osfs.os_files); } return rc; @@ -1039,11 +1039,11 @@ int lprocfs_dt_rd_filesfree(char *page, char **start, off_t off, int rc = dt_statfs(NULL, dt, &osfs); if (rc == 0) { *eof = 1; - rc = snprintf(page, count, LPU64"\n", osfs.os_ffree); + rc = snprintf(page, count, "%llu\n", osfs.os_ffree); } return rc; } EXPORT_SYMBOL(lprocfs_dt_rd_filesfree); -#endif /* LPROCFS */ +#endif /* CONFIG_PROC_FS */ diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 3210ad8184b9..504c59aabaef 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -40,9 +40,9 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_ost.h> -#include <obd_class.h> -#include <lprocfs_status.h> +#include "../include/obd_ost.h" +#include "../include/obd_class.h" +#include "../include/lprocfs_status.h" extern struct list_head obd_types; spinlock_t obd_types_lock; @@ -699,7 +699,7 @@ struct obd_export *class_conn2export(struct lustre_handle *conn) return NULL; } - CDEBUG(D_INFO, "looking for export cookie "LPX64"\n", conn->cookie); + CDEBUG(D_INFO, "looking for export cookie %#llx\n", conn->cookie); export = class_handle2object(conn->cookie); return export; } @@ -842,7 +842,7 @@ struct obd_export *class_new_export(struct obd_device *obd, INIT_LIST_HEAD(&export->exp_handle.h_link); INIT_LIST_HEAD(&export->exp_hp_rpcs); class_handle_hash(&export->exp_handle, &export_handle_ops); - export->exp_last_request_time = cfs_time_current_sec(); + export->exp_last_request_time = get_seconds(); spin_lock_init(&export->exp_lock); spin_lock_init(&export->exp_rpc_lock); INIT_HLIST_NODE(&export->exp_uuid_hash); @@ -1113,7 +1113,7 @@ int class_connect(struct lustre_handle *conn, struct obd_device *obd, conn->cookie = export->exp_handle.h_cookie; class_export_put(export); - CDEBUG(D_IOCTL, "connect: client %s, cookie "LPX64"\n", + CDEBUG(D_IOCTL, "connect: client %s, cookie %#llx\n", cluuid->uuid, conn->cookie); return 0; } @@ -1190,7 +1190,7 @@ int class_disconnect(struct obd_export *export) GOTO(no_disconn, already_disconnected); } - CDEBUG(D_IOCTL, "disconnect: cookie "LPX64"\n", + CDEBUG(D_IOCTL, "disconnect: cookie %#llx\n", export->exp_handle.h_cookie); if (!hlist_unhashed(&export->exp_nid_hash)) @@ -1493,7 +1493,7 @@ static void print_export_data(struct obd_export *exp, const char *status, } spin_unlock(&exp->exp_lock); - CDEBUG(D_HA, "%s: %s %p %s %s %d (%d %d %d) %d %d %d %d: %p %s "LPU64"\n", + CDEBUG(D_HA, "%s: %s %p %s %s %d (%d %d %d) %d %d %d %d: %p %s %llu\n", exp->exp_obd->obd_name, status, exp, exp->exp_client_uuid.uuid, obd_export_nid2str(exp), atomic_read(&exp->exp_refcount), atomic_read(&exp->exp_rpc_count), diff --git a/drivers/staging/lustre/lustre/obdclass/idmap.c b/drivers/staging/lustre/lustre/obdclass/idmap.c index ec2590f5cfe9..1190885c06b6 100644 --- a/drivers/staging/lustre/lustre/obdclass/idmap.c +++ b/drivers/staging/lustre/lustre/obdclass/idmap.c @@ -42,9 +42,9 @@ #define DEBUG_SUBSYSTEM S_SEC -#include <lustre_idmap.h> -#include <md_object.h> -#include <obd_support.h> +#include "../include/lustre_idmap.h" +#include "../include/md_object.h" +#include "../include/obd_support.h" #define lustre_get_group_info(group_info) do { \ atomic_inc(&(group_info)->usage); \ diff --git a/drivers/staging/lustre/lustre/obdclass/linkea.c b/drivers/staging/lustre/lustre/obdclass/linkea.c index b5c19ac1470f..8a1c7b6fefe9 100644 --- a/drivers/staging/lustre/lustre/obdclass/linkea.c +++ b/drivers/staging/lustre/lustre/obdclass/linkea.c @@ -27,9 +27,9 @@ * Author: Di Wang <di.wang@intel.com> */ -#include <lustre/lustre_idl.h> -#include <obd.h> -#include <lustre_linkea.h> +#include "../include/lustre/lustre_idl.h" +#include "../include/obd.h" +#include "../include/lustre_linkea.h" int linkea_data_new(struct linkea_data *ldata, struct lu_buf *buf) { diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index bdf2eed2952a..9ce3d36c685d 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -65,13 +65,13 @@ #include <linux/miscdevice.h> #include <linux/seq_file.h> -#include <linux/libcfs/libcfs.h> -#include <obd_support.h> -#include <obd_class.h> -#include <linux/lnet/lnetctl.h> -#include <lprocfs_status.h> -#include <lustre_ver.h> -#include <lustre/lustre_build_version.h> +#include "../../../include/linux/libcfs/libcfs.h" +#include "../../../include/linux/lnet/lnetctl.h" +#include "../../include/obd_support.h" +#include "../../include/obd_class.h" +#include "../../include/lprocfs_status.h" +#include "../../include/lustre_ver.h" +#include "../../include/lustre/lustre_build_version.h" int proc_version; @@ -212,7 +212,7 @@ struct miscdevice obd_psdev = { }; -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) int obd_proc_version_seq_show(struct seq_file *m, void *v) { return seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n", @@ -328,7 +328,7 @@ struct lprocfs_vars lprocfs_base[] = { { "jobid_var", &obd_proc_jobid_var_fops }, { .name = "jobid_name", .fops = &obd_proc_jobid_name_fops}, - { 0 } + { NULL } }; static void *obd_device_list_seq_start(struct seq_file *p, loff_t *pos) @@ -435,4 +435,4 @@ int class_procfs_clean(void) } return 0; } -#endif /* LPROCFS */ +#endif /* CONFIG_PROC_FS */ diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c index d3bb5ffc564b..bb15202f1aae 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-obdo.c @@ -43,8 +43,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #include <linux/module.h> -#include <obd_class.h> -#include <lustre/lustre_idl.h> +#include "../../include/obd_class.h" +#include "../../include/lustre/lustre_idl.h" #include <linux/fs.h> #include <linux/pagemap.h> /* for PAGE_CACHE_SIZE */ @@ -151,7 +151,7 @@ void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid) if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) CDEBUG(D_INODE, - "valid "LPX64", cur time %lu/%lu, new "LPU64"/"LPU64"\n", + "valid %#llx, cur time %lu/%lu, new %llu/%llu\n", src->o_valid, LTIME_S(dst->i_mtime), LTIME_S(dst->i_ctime), src->o_mtime, src->o_ctime); @@ -190,7 +190,7 @@ void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid) if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) CDEBUG(D_INODE, - "valid "LPX64", cur time %lu/%lu, new "LPU64"/"LPU64"\n", + "valid %#llx, cur time %lu/%lu, new %llu/%llu\n", src->o_valid, LTIME_S(dst->i_mtime), LTIME_S(dst->i_ctime), src->o_mtime, src->o_ctime); diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index c1ef0c9b5a1a..38a9b319355e 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -42,17 +42,17 @@ #include <linux/slab.h> #include <linux/stat.h> #include <linux/ctype.h> -#include <asm/bitops.h> -#include <asm/uaccess.h> +#include <linux/bitops.h> +#include <linux/uaccess.h> #include <linux/utsname.h> #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_support.h> -#include <lprocfs_status.h> +#include "../../include/obd_support.h" +#include "../../include/lprocfs_status.h" #ifdef CONFIG_SYSCTL -ctl_table_header_t *obd_table_header = NULL; +static struct ctl_table_header *obd_table_header; #endif @@ -79,21 +79,22 @@ enum { }; -int LL_PROC_PROTO(proc_set_timeout) +static int proc_set_timeout(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { int rc; - rc = ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); + rc = proc_dointvec(table, write, buffer, lenp, ppos); if (ldlm_timeout >= obd_timeout) ldlm_timeout = max(obd_timeout / 3, 1U); return rc; } -int LL_PROC_PROTO(proc_memory_alloc) +static int proc_memory_alloc(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { char buf[22]; int len; - DECLARE_LL_PROC_PPOS_DECL; if (!*lenp || (*ppos && !write)) { *lenp = 0; @@ -102,7 +103,7 @@ int LL_PROC_PROTO(proc_memory_alloc) if (write) return -EINVAL; - len = snprintf(buf, sizeof(buf), LPU64"\n", obd_memory_sum()); + len = snprintf(buf, sizeof(buf), "%llu\n", obd_memory_sum()); if (len > *lenp) len = *lenp; buf[len] = '\0'; @@ -113,11 +114,11 @@ int LL_PROC_PROTO(proc_memory_alloc) return 0; } -int LL_PROC_PROTO(proc_pages_alloc) +static int proc_pages_alloc(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { char buf[22]; int len; - DECLARE_LL_PROC_PPOS_DECL; if (!*lenp || (*ppos && !write)) { *lenp = 0; @@ -126,7 +127,7 @@ int LL_PROC_PROTO(proc_pages_alloc) if (write) return -EINVAL; - len = snprintf(buf, sizeof(buf), LPU64"\n", obd_pages_sum()); + len = snprintf(buf, sizeof(buf), "%llu\n", obd_pages_sum()); if (len > *lenp) len = *lenp; buf[len] = '\0'; @@ -137,11 +138,11 @@ int LL_PROC_PROTO(proc_pages_alloc) return 0; } -int LL_PROC_PROTO(proc_mem_max) +static int proc_mem_max(struct ctl_table *table, int write, void __user *buffer, + size_t *lenp, loff_t *ppos) { char buf[22]; int len; - DECLARE_LL_PROC_PPOS_DECL; if (!*lenp || (*ppos && !write)) { *lenp = 0; @@ -150,7 +151,7 @@ int LL_PROC_PROTO(proc_mem_max) if (write) return -EINVAL; - len = snprintf(buf, sizeof(buf), LPU64"\n", obd_memory_max()); + len = snprintf(buf, sizeof(buf), "%llu\n", obd_memory_max()); if (len > *lenp) len = *lenp; buf[len] = '\0'; @@ -161,11 +162,11 @@ int LL_PROC_PROTO(proc_mem_max) return 0; } -int LL_PROC_PROTO(proc_pages_max) +static int proc_pages_max(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { char buf[22]; int len; - DECLARE_LL_PROC_PPOS_DECL; if (!*lenp || (*ppos && !write)) { *lenp = 0; @@ -174,7 +175,7 @@ int LL_PROC_PROTO(proc_pages_max) if (write) return -EINVAL; - len = snprintf(buf, sizeof(buf), LPU64"\n", obd_pages_max()); + len = snprintf(buf, sizeof(buf), "%llu\n", obd_pages_max()); if (len > *lenp) len = *lenp; buf[len] = '\0'; @@ -185,10 +186,10 @@ int LL_PROC_PROTO(proc_pages_max) return 0; } -int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) +static int proc_max_dirty_pages_in_mb(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { int rc = 0; - DECLARE_LL_PROC_PPOS_DECL; if (!table->data || !table->maxlen || !*lenp || (*ppos && !write)) { *lenp = 0; @@ -196,7 +197,7 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) } if (write) { rc = lprocfs_write_frac_helper(buffer, *lenp, - (unsigned int*)table->data, + (unsigned int *)table->data, 1 << (20 - PAGE_CACHE_SHIFT)); /* Don't allow them to let dirty pages exceed 90% of system * memory and set a hard minimum of 4MB. */ @@ -214,7 +215,7 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) int len; len = lprocfs_read_frac_helper(buf, sizeof(buf), - *(unsigned int*)table->data, + *(unsigned int *)table->data, 1 << (20 - PAGE_CACHE_SHIFT)); if (len > *lenp) len = *lenp; @@ -227,10 +228,10 @@ int LL_PROC_PROTO(proc_max_dirty_pages_in_mb) return rc; } -int LL_PROC_PROTO(proc_alloc_fail_rate) +static int proc_alloc_fail_rate(struct ctl_table *table, int write, + void __user *buffer, size_t *lenp, loff_t *ppos) { int rc = 0; - DECLARE_LL_PROC_PPOS_DECL; if (!table->data || !table->maxlen || !*lenp || (*ppos && !write)) { *lenp = 0; @@ -238,14 +239,14 @@ int LL_PROC_PROTO(proc_alloc_fail_rate) } if (write) { rc = lprocfs_write_frac_helper(buffer, *lenp, - (unsigned int*)table->data, + (unsigned int *)table->data, OBD_ALLOC_FAIL_MULT); } else { char buf[21]; int len; len = lprocfs_read_frac_helper(buf, 21, - *(unsigned int*)table->data, + *(unsigned int *)table->data, OBD_ALLOC_FAIL_MULT); if (len > *lenp) len = *lenp; @@ -258,29 +259,8 @@ int LL_PROC_PROTO(proc_alloc_fail_rate) return rc; } -int LL_PROC_PROTO(proc_at_min) -{ - return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); -} -int LL_PROC_PROTO(proc_at_max) -{ - return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); -} -int LL_PROC_PROTO(proc_at_extra) -{ - return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); -} -int LL_PROC_PROTO(proc_at_early_margin) -{ - return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); -} -int LL_PROC_PROTO(proc_at_history) -{ - return ll_proc_dointvec(table, write, filp, buffer, lenp, ppos); -} - #ifdef CONFIG_SYSCTL -static ctl_table_t obd_table[] = { +static struct ctl_table obd_table[] = { { .procname = "timeout", .data = &obd_timeout, @@ -363,40 +343,40 @@ static ctl_table_t obd_table[] = { .data = &at_min, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_min + .proc_handler = &proc_dointvec, }, { .procname = "at_max", .data = &at_max, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_max + .proc_handler = &proc_dointvec, }, { .procname = "at_extra", .data = &at_extra, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_extra + .proc_handler = &proc_dointvec, }, { .procname = "at_early_margin", .data = &at_early_margin, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_early_margin + .proc_handler = &proc_dointvec, }, { .procname = "at_history", .data = &at_history, .maxlen = sizeof(int), .mode = 0644, - .proc_handler = &proc_at_history + .proc_handler = &proc_dointvec, }, {} }; -static ctl_table_t parent_table[] = { +static struct ctl_table parent_table[] = { { .procname = "lustre", .data = NULL, @@ -408,18 +388,18 @@ static ctl_table_t parent_table[] = { }; #endif -void obd_sysctl_init (void) +void obd_sysctl_init(void) { #ifdef CONFIG_SYSCTL - if ( !obd_table_header ) + if (!obd_table_header) obd_table_header = register_sysctl_table(parent_table); #endif } -void obd_sysctl_clean (void) +void obd_sysctl_clean(void) { #ifdef CONFIG_SYSCTL - if ( obd_table_header ) + if (obd_table_header) unregister_sysctl_table(obd_table_header); obd_table_header = NULL; #endif diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index e0dfb089dd90..cce86890c563 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -48,8 +48,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd_class.h> -#include <lustre_log.h> +#include "../include/obd_class.h" +#include "../include/lustre_log.h" #include "llog_internal.h" /* @@ -188,7 +188,7 @@ static int llog_read_header(const struct lu_env *env, llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC; llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0; - llh->llh_timestamp = cfs_time_current_sec(); + llh->llh_timestamp = get_seconds(); if (uuid) memcpy(&llh->llh_tgtuuid, uuid, sizeof(llh->llh_tgtuuid)); diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index 1d999310ec92..ca9927ccde68 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -49,7 +49,7 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd_class.h> +#include "../include/obd_class.h" #include "llog_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/llog_internal.h b/drivers/staging/lustre/lustre/obdclass/llog_internal.h index 539e1d4f9d4c..5332131a2a2e 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/llog_internal.h @@ -37,7 +37,7 @@ #ifndef __LLOG_INTERNAL_H__ #define __LLOG_INTERNAL_H__ -#include <lustre_log.h> +#include "../include/lustre_log.h" struct llog_process_info { struct llog_handle *lpi_loghandle; diff --git a/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c b/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c index e192aab193bb..9b7fa1d5e79a 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_ioctl.c @@ -36,8 +36,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd_class.h> -#include <lustre_log.h> +#include "../include/obd_class.h" +#include "../include/lustre_log.h" #include "llog_internal.h" static int str2logid(struct llog_logid *logid, char *str, int len) diff --git a/drivers/staging/lustre/lustre/obdclass/llog_lvfs.c b/drivers/staging/lustre/lustre/obdclass/llog_lvfs.c index d86bb8c60354..fd48d59cf315 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_lvfs.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_lvfs.c @@ -46,20 +46,20 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd.h> -#include <obd_class.h> -#include <lustre_log.h> -#include <obd_ost.h> +#include "../include/obd.h" +#include "../include/obd_class.h" +#include "../include/lustre_log.h" +#include "../include/obd_ost.h" #include <linux/list.h> -#include <lvfs.h> -#include <lustre_fsfilt.h> -#include <lustre_disk.h> +#include "../include/lvfs.h" +#include "../include/lustre_fsfilt.h" +#include "../include/lustre_disk.h" #include "llog_internal.h" #if defined(LLOG_LVFS) -static int llog_lvfs_pad(struct obd_device *obd, struct l_file *file, - int len, int index) +static int llog_lvfs_pad(struct obd_device *obd, struct file *file, int len, + int index) { struct llog_rec_hdr rec = { 0 }; struct llog_rec_tail tail; @@ -88,7 +88,7 @@ static int llog_lvfs_pad(struct obd_device *obd, struct l_file *file, return rc; } -static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file, +static int llog_lvfs_write_blob(struct obd_device *obd, struct file *file, struct llog_rec_hdr *rec, void *buf, loff_t off) { int rc; @@ -140,7 +140,7 @@ static int llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file, return rc; } -static int llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file, +static int llog_lvfs_read_blob(struct obd_device *obd, struct file *file, void *buf, int size, loff_t off) { loff_t offset = off; @@ -389,7 +389,7 @@ static int llog_lvfs_next_block(const struct lu_env *env, if (len == 0 || len & (LLOG_CHUNK_SIZE - 1)) return -EINVAL; - CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n", + CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off %llu)\n", next_idx, *cur_idx, *cur_offset); while (*cur_offset < i_size_read(loghandle->lgh_file->f_dentry->d_inode)) { @@ -408,7 +408,7 @@ static int llog_lvfs_next_block(const struct lu_env *env, cur_offset); if (rc < 0) { CERROR("Cant read llog block at log id "DOSTID - "/%u offset "LPU64"\n", + "/%u offset %llu\n", POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, *cur_offset); @@ -426,8 +426,8 @@ static int llog_lvfs_next_block(const struct lu_env *env, return 0; if (rc < sizeof(*tail)) { - CERROR("Invalid llog block at log id "DOSTID"/%u offset" - LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi), + CERROR("Invalid llog block at log id "DOSTID"/%u offset%llu\n", + POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, *cur_offset); return -EINVAL; } @@ -451,8 +451,8 @@ static int llog_lvfs_next_block(const struct lu_env *env, /* this shouldn't happen */ if (tail->lrt_index == 0) { - CERROR("Invalid llog tail at log id "DOSTID"/%u offset " - LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi), + CERROR("Invalid llog tail at log id "DOSTID"/%u offset %llu\n", + POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, *cur_offset); return -EINVAL; } @@ -496,7 +496,7 @@ static int llog_lvfs_prev_block(const struct lu_env *env, &cur_offset); if (rc < 0) { CERROR("Cant read llog block at log id "DOSTID - "/%u offset "LPU64"\n", + "/%u offset %llu\n", POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, cur_offset); @@ -510,8 +510,8 @@ static int llog_lvfs_prev_block(const struct lu_env *env, return 0; if (rc < sizeof(*tail)) { - CERROR("Invalid llog block at log id "DOSTID"/%u offset" - LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi), + CERROR("Invalid llog block at log id "DOSTID"/%u offset%llu\n", + POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, cur_offset); return -EINVAL; } @@ -533,8 +533,8 @@ static int llog_lvfs_prev_block(const struct lu_env *env, /* this shouldn't happen */ if (tail->lrt_index == 0) { - CERROR("Invalid llog tail at log id "DOSTID"/%u offset" - LPU64"\n", POSTID(&loghandle->lgh_id.lgl_oi), + CERROR("Invalid llog tail at log id "DOSTID"/%u offset%llu\n", + POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, cur_offset); return -EINVAL; } @@ -567,7 +567,7 @@ static struct file *llog_filp_open(char *dir, char *name, int flags, int mode) if (len >= PATH_MAX - 1) { filp = ERR_PTR(-ENAMETOOLONG); } else { - filp = l_filp_open(logname, flags, mode); + filp = filp_open(logname, flags, mode); if (IS_ERR(filp) && PTR_ERR(filp) != -ENOENT) CERROR("logfile creation %s: %ld\n", logname, PTR_ERR(filp)); @@ -581,7 +581,7 @@ static int llog_lvfs_open(const struct lu_env *env, struct llog_handle *handle, enum llog_open_param open_param) { struct llog_ctxt *ctxt = handle->lgh_ctxt; - struct l_dentry *dchild = NULL; + struct dentry *dchild = NULL; struct obd_device *obd; int rc = 0; @@ -672,7 +672,7 @@ static int llog_lvfs_create(const struct lu_env *env, { struct llog_ctxt *ctxt = handle->lgh_ctxt; struct obd_device *obd; - struct l_dentry *dchild = NULL; + struct dentry *dchild = NULL; struct file *file; struct obdo *oa = NULL; int rc = 0; diff --git a/drivers/staging/lustre/lustre/obdclass/llog_obd.c b/drivers/staging/lustre/lustre/obdclass/llog_obd.c index 2c6d81eb5c65..8ff01d3f90b4 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_obd.c @@ -37,8 +37,8 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd_class.h> -#include <lustre_log.h> +#include "../include/obd_class.h" +#include "../include/lustre_log.h" #include "llog_internal.h" /* helper functions for calling the llog obd methods */ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_osd.c b/drivers/staging/lustre/lustre/obdclass/llog_osd.c index 682279de8bea..2c6a51e90697 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_osd.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_osd.c @@ -41,10 +41,10 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <obd.h> -#include <obd_class.h> -#include <lustre_fid.h> -#include <dt_object.h> +#include "../include/obd.h" +#include "../include/obd_class.h" +#include "../include/lustre_fid.h" +#include "../include/dt_object.h" #include "llog_internal.h" #include "local_storage.h" @@ -533,7 +533,7 @@ static int llog_osd_next_block(const struct lu_env *env, if (len == 0 || len & (LLOG_CHUNK_SIZE - 1)) return -EINVAL; - CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n", + CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off %llu)\n", next_idx, *cur_idx, *cur_offset); LASSERT(loghandle); @@ -574,7 +574,7 @@ static int llog_osd_next_block(const struct lu_env *env, dt_read_unlock(env, o); if (rc < 0) { CERROR("%s: can't read llog block from log "DFID - " offset "LPU64": rc = %d\n", + " offset %llu: rc = %d\n", o->do_lu.lo_dev->ld_obd->obd_name, PFID(lu_object_fid(&o->do_lu)), *cur_offset, rc); @@ -592,7 +592,7 @@ static int llog_osd_next_block(const struct lu_env *env, if (rc < sizeof(*tail)) { CERROR("%s: invalid llog block at log id "DOSTID"/%u " - "offset "LPU64"\n", + "offset %llu\n", o->do_lu.lo_dev->ld_obd->obd_name, POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, *cur_offset); @@ -618,7 +618,7 @@ static int llog_osd_next_block(const struct lu_env *env, /* this shouldn't happen */ if (tail->lrt_index == 0) { CERROR("%s: invalid llog tail at log id "DOSTID"/%u " - "offset "LPU64"\n", + "offset %llu\n", o->do_lu.lo_dev->ld_obd->obd_name, POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, *cur_offset); @@ -687,7 +687,7 @@ static int llog_osd_prev_block(const struct lu_env *env, dt_read_unlock(env, o); if (rc < 0) { CERROR("%s: can't read llog block from log "DFID - " offset "LPU64": rc = %d\n", + " offset %llu: rc = %d\n", o->do_lu.lo_dev->ld_obd->obd_name, PFID(lu_object_fid(&o->do_lu)), cur_offset, rc); GOTO(out, rc); @@ -698,7 +698,7 @@ static int llog_osd_prev_block(const struct lu_env *env, if (rc < sizeof(*tail)) { CERROR("%s: invalid llog block at log id "DOSTID"/%u " - "offset "LPU64"\n", + "offset %llu\n", o->do_lu.lo_dev->ld_obd->obd_name, POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, cur_offset); @@ -722,7 +722,7 @@ static int llog_osd_prev_block(const struct lu_env *env, /* this shouldn't happen */ if (tail->lrt_index == 0) { CERROR("%s: invalid llog tail at log id "DOSTID"/%u " - "offset "LPU64"\n", + "offset %llu\n", o->do_lu.lo_dev->ld_obd->obd_name, POSTID(&loghandle->lgh_id.lgl_oi), loghandle->lgh_id.lgl_ogen, cur_offset); diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index 24ca099b01da..b3247fb7a35a 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -43,7 +43,7 @@ #define DEBUG_SUBSYSTEM S_LOG -#include <lustre_log.h> +#include "../include/lustre_log.h" static void print_llogd_body(struct llogd_body *d) { @@ -56,7 +56,7 @@ static void print_llogd_body(struct llogd_body *d) CDEBUG(D_OTHER, "\tlgd_index: %#x\n", d->lgd_index); CDEBUG(D_OTHER, "\tlgd_saved_index: %#x\n", d->lgd_saved_index); CDEBUG(D_OTHER, "\tlgd_len: %#x\n", d->lgd_len); - CDEBUG(D_OTHER, "\tlgd_cur_offset: "LPX64"\n", d->lgd_cur_offset); + CDEBUG(D_OTHER, "\tlgd_cur_offset: %#llx\n", d->lgd_cur_offset); } void lustre_swab_lu_fid(struct lu_fid *fid) @@ -284,7 +284,7 @@ static void print_llog_hdr(struct llog_log_hdr *h) CDEBUG(D_OTHER, "\tllh_hdr.lrh_index: %#x\n", h->llh_hdr.lrh_index); CDEBUG(D_OTHER, "\tllh_hdr.lrh_len: %#x\n", h->llh_hdr.lrh_len); CDEBUG(D_OTHER, "\tllh_hdr.lrh_type: %#x\n", h->llh_hdr.lrh_type); - CDEBUG(D_OTHER, "\tllh_timestamp: "LPX64"\n", h->llh_timestamp); + CDEBUG(D_OTHER, "\tllh_timestamp: %#llx\n", h->llh_timestamp); CDEBUG(D_OTHER, "\tllh_count: %#x\n", h->llh_count); CDEBUG(D_OTHER, "\tllh_bitmap_offset: %#x\n", h->llh_bitmap_offset); CDEBUG(D_OTHER, "\tllh_flags: %#x\n", h->llh_flags); diff --git a/drivers/staging/lustre/lustre/obdclass/llog_test.c b/drivers/staging/lustre/lustre/obdclass/llog_test.c index 764068fc4ef7..ef008abd331c 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_test.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_test.c @@ -44,9 +44,9 @@ #include <linux/module.h> #include <linux/init.h> -#include <obd_class.h> -#include <lustre_fid.h> -#include <lustre_log.h> +#include "../include/obd_class.h" +#include "../include/lustre_fid.h" +#include "../include/lustre_log.h" /* This is slightly more than the number of records that can fit into a * single llog file, because the llog_log_header takes up some of the @@ -939,9 +939,9 @@ cleanup_ctxt: return rc; } -#ifdef LPROCFS -static struct lprocfs_vars lprocfs_llog_test_obd_vars[] = { {0} }; -static struct lprocfs_vars lprocfs_llog_test_module_vars[] = { {0} }; +#if defined (CONFIG_PROC_FS) +static struct lprocfs_vars lprocfs_llog_test_obd_vars[] = { { NULL } }; +static struct lprocfs_vars lprocfs_llog_test_module_vars[] = { { NULL } }; static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars) { lvars->module_vars = lprocfs_llog_test_module_vars; diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.c b/drivers/staging/lustre/lustre/obdclass/local_storage.c index e76f7d044231..78190225ac7a 100644 --- a/drivers/staging/lustre/lustre/obdclass/local_storage.c +++ b/drivers/staging/lustre/lustre/obdclass/local_storage.c @@ -670,7 +670,7 @@ int lastid_compat_check(const struct lu_env *env, struct dt_device *dev, return PTR_ERR(root); /* find old last_id file */ - snprintf(dti->dti_buf, sizeof(dti->dti_buf), "seq-"LPX64"-lastid", + snprintf(dti->dti_buf, sizeof(dti->dti_buf), "seq-%#llx-lastid", lastid_seq); rc = dt_lookup_dir(env, root, dti->dti_buf, &dti->dti_fid); lu_object_put_nocache(env, &root->do_lu); @@ -693,7 +693,7 @@ int lastid_compat_check(const struct lu_env *env, struct dt_device *dev, } else if (rc < 0) { return rc; } else { - CDEBUG(D_INFO, "Found old lastid file for sequence "LPX64"\n", + CDEBUG(D_INFO, "Found old lastid file for sequence %#llx\n", lastid_seq); o = ls_locate(env, ls, &dti->dti_fid); if (IS_ERR(o)) @@ -709,12 +709,12 @@ int lastid_compat_check(const struct lu_env *env, struct dt_device *dev, dt_read_unlock(env, o); lu_object_put_nocache(env, &o->do_lu); if (rc == 0 && le32_to_cpu(losd.lso_magic) != LOS_MAGIC) { - CERROR("%s: wrong content of seq-"LPX64"-lastid file, magic %x\n", + CERROR("%s: wrong content of seq-%#llx-lastid file, magic %x\n", o->do_lu.lo_dev->ld_obd->obd_name, lastid_seq, le32_to_cpu(losd.lso_magic)); return -EINVAL; } else if (rc < 0) { - CERROR("%s: failed to read seq-"LPX64"-lastid: rc = %d\n", + CERROR("%s: failed to read seq-%#llx-lastid: rc = %d\n", o->do_lu.lo_dev->ld_obd->obd_name, lastid_seq, rc); return rc; } @@ -837,7 +837,7 @@ out_trans: rc = dt_record_read(env, o, &dti->dti_lb, &dti->dti_off); dt_read_unlock(env, o); if (rc == 0 && le64_to_cpu(lastid) > OBIF_MAX_OID) { - CERROR("%s: bad oid "LPU64" is read from LAST_ID\n", + CERROR("%s: bad oid %llu is read from LAST_ID\n", o->do_lu.lo_dev->ld_obd->obd_name, le64_to_cpu(lastid)); rc = -EINVAL; diff --git a/drivers/staging/lustre/lustre/obdclass/local_storage.h b/drivers/staging/lustre/lustre/obdclass/local_storage.h index 0f63b8c073b4..0b9ad33d1152 100644 --- a/drivers/staging/lustre/lustre/obdclass/local_storage.h +++ b/drivers/staging/lustre/lustre/obdclass/local_storage.h @@ -32,10 +32,10 @@ #ifndef __LOCAL_STORAGE_H #define __LOCAL_STORAGE_H -#include <dt_object.h> -#include <obd.h> -#include <lustre_fid.h> -#include <lustre_disk.h> +#include "../include/dt_object.h" +#include "../include/obd.h" +#include "../include/lustre_fid.h" +#include "../include/lustre_disk.h" struct ls_device { struct dt_device ls_top_dev; diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 1432dd74fe95..8309d4ce6d60 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -41,9 +41,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> -#include <lprocfs_status.h> -#include <lustre/lustre_idl.h> +#include "../include/obd_class.h" +#include "../include/lprocfs_status.h" +#include "../include/lustre/lustre_idl.h" #include <linux/seq_file.h> static const char * const obd_connect_names[] = { @@ -116,7 +116,7 @@ int obd_connect_flags2str(char *page, int count, __u64 flags, char *sep) } if (flags & ~(mask - 1)) ret += snprintf(page + ret, count - ret, - "%sunknown flags "LPX64, + "%sunknown flags %#llx", ret ? sep : "", flags & ~(mask - 1)); return ret; } @@ -220,7 +220,7 @@ int lprocfs_write_frac_helper(const char *buffer, unsigned long count, } EXPORT_SYMBOL(lprocfs_write_frac_helper); -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) static int lprocfs_no_percpu_stats = 0; module_param(lprocfs_no_percpu_stats, int, 0644); @@ -400,7 +400,7 @@ EXPORT_SYMBOL(lprocfs_wr_uint); int lprocfs_rd_u64(struct seq_file *m, void *data) { - return seq_printf(m, LPU64"\n", *(__u64 *)data); + return seq_printf(m, "%llu\n", *(__u64 *)data); } EXPORT_SYMBOL(lprocfs_rd_u64); @@ -476,7 +476,7 @@ int lprocfs_rd_kbytestotal(struct seq_file *m, void *data) while (blk_size >>= 1) result <<= 1; - rc = seq_printf(m, LPU64"\n", result); + rc = seq_printf(m, "%llu\n", result); } return rc; } @@ -496,7 +496,7 @@ int lprocfs_rd_kbytesfree(struct seq_file *m, void *data) while (blk_size >>= 1) result <<= 1; - rc = seq_printf(m, LPU64"\n", result); + rc = seq_printf(m, "%llu\n", result); } return rc; } @@ -516,7 +516,7 @@ int lprocfs_rd_kbytesavail(struct seq_file *m, void *data) while (blk_size >>= 1) result <<= 1; - rc = seq_printf(m, LPU64"\n", result); + rc = seq_printf(m, "%llu\n", result); } return rc; } @@ -530,7 +530,7 @@ int lprocfs_rd_filestotal(struct seq_file *m, void *data) cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) - rc = seq_printf(m, LPU64"\n", osfs.os_files); + rc = seq_printf(m, "%llu\n", osfs.os_files); return rc; } @@ -544,7 +544,7 @@ int lprocfs_rd_filesfree(struct seq_file *m, void *data) cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS), OBD_STATFS_NODELAY); if (!rc) - rc = seq_printf(m, LPU64"\n", osfs.os_ffree); + rc = seq_printf(m, "%llu\n", osfs.os_ffree); return rc; } EXPORT_SYMBOL(lprocfs_rd_filesfree); @@ -667,7 +667,7 @@ static void obd_connect_seq_flags2str(struct seq_file *m, __u64 flags, char *sep } } if (flags & ~(mask - 1)) - seq_printf(m, "%sunknown flags "LPX64, + seq_printf(m, "%sunknown flags %#llx", first ? sep : "", flags & ~(mask - 1)); } @@ -744,7 +744,7 @@ int lprocfs_rd_import(struct seq_file *m, void *data) " inflight: %u\n" " unregistering: %u\n" " timeouts: %u\n" - " avg_waittime: "LPU64" %s\n", + " avg_waittime: %llu %s\n", atomic_read(&imp->imp_inflight), atomic_read(&imp->imp_unregistering), atomic_read(&imp->imp_timeouts), @@ -766,9 +766,9 @@ int lprocfs_rd_import(struct seq_file *m, void *data) seq_printf(m, " transactions:\n" - " last_replay: "LPU64"\n" - " peer_committed: "LPU64"\n" - " last_checked: "LPU64"\n", + " last_replay: %llu\n" + " peer_committed: %llu\n" + " last_checked: %llu\n", imp->imp_last_replay_transno, imp->imp_peer_committed_transno, imp->imp_last_transno_checked); @@ -785,7 +785,7 @@ int lprocfs_rd_import(struct seq_file *m, void *data) ret.lc_sum = sum; seq_printf(m, " %s_data_averages:\n" - " bytes_per_rpc: "LPU64"\n", + " bytes_per_rpc: %llu\n", rw ? "write" : "read", ret.lc_sum); } @@ -799,7 +799,7 @@ int lprocfs_rd_import(struct seq_file *m, void *data) do_div(sum, ret.lc_count); ret.lc_sum = sum; seq_printf(m, - " %s_per_rpc: "LPU64"\n", + " %s_per_rpc: %llu\n", header->lc_units, ret.lc_sum); j = (int)ret.lc_sum; if (j > 0) @@ -868,7 +868,7 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) LPROCFS_CLIMP_CHECK(obd); imp = obd->u.cli.cl_import; - now = cfs_time_current_sec(); + now = get_seconds(); /* Some network health info for kicks */ s2dhms(&ts, now - imp->imp_last_reply_time); @@ -908,7 +908,7 @@ int lprocfs_rd_connect_flags(struct seq_file *m, void *data) LPROCFS_CLIMP_CHECK(obd); flags = obd->u.cli.cl_import->imp_connect_data.ocd_connect_flags; - seq_printf(m, "flags="LPX64"\n", flags); + seq_printf(m, "flags=%#llx\n", flags); obd_connect_seq_flags2str(m, flags, "\n"); seq_printf(m, "\n"); LPROCFS_CLIMP_EXIT(obd); @@ -1175,19 +1175,19 @@ static int lprocfs_stats_seq_show(struct seq_file *p, void *v) if (ctr.lc_count == 0) goto out; - rc = seq_printf(p, "%-25s "LPD64" samples [%s]", hdr->lc_name, + rc = seq_printf(p, "%-25s %lld samples [%s]", hdr->lc_name, ctr.lc_count, hdr->lc_units); if (rc < 0) goto out; if ((hdr->lc_config & LPROCFS_CNTR_AVGMINMAX) && (ctr.lc_count > 0)) { - rc = seq_printf(p, " "LPD64" "LPD64" "LPD64, + rc = seq_printf(p, " %lld %lld %lld", ctr.lc_min, ctr.lc_max, ctr.lc_sum); if (rc < 0) goto out; if (hdr->lc_config & LPROCFS_CNTR_STDDEV) - rc = seq_printf(p, " "LPD64, ctr.lc_sumsquare); + rc = seq_printf(p, " %lld", ctr.lc_sumsquare); if (rc < 0) goto out; } @@ -1196,7 +1196,7 @@ out: return (rc < 0) ? rc : 0; } -struct seq_operations lprocfs_stats_seq_sops = { +static const struct seq_operations lprocfs_stats_seq_sops = { .start = lprocfs_stats_seq_start, .stop = lprocfs_stats_seq_stop, .next = lprocfs_stats_seq_next, diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 92e8a15a5e5d..2fc037cfb62f 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -44,18 +44,18 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <linux/libcfs/libcfs.h> +#include "../../include/linux/libcfs/libcfs.h" # include <linux/module.h> /* hash_long() */ -#include <linux/libcfs/libcfs_hash.h> -#include <obd_class.h> -#include <obd_support.h> -#include <lustre_disk.h> -#include <lustre_fid.h> -#include <lu_object.h> -#include <lu_ref.h> +#include "../../include/linux/libcfs/libcfs_hash.h" +#include "../include/obd_class.h" +#include "../include/obd_support.h" +#include "../include/lustre_disk.h" +#include "../include/lustre_fid.h" +#include "../include/lu_object.h" +#include "../include/lu_ref.h" #include <linux/list.h> static void lu_object_free(const struct lu_env *env, struct lu_object *o); @@ -1994,7 +1994,7 @@ void lu_global_fini(void) static __u32 ls_stats_read(struct lprocfs_stats *stats, int idx) { -#ifdef LPROCFS +#if defined (CONFIG_PROC_FS) struct lprocfs_counter ret; lprocfs_stats_collect(stats, idx, &ret); diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ref.c b/drivers/staging/lustre/lustre/obdclass/lu_ref.c index 23a76f158356..993697b660f6 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_ref.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_ref.c @@ -42,9 +42,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -# include <linux/libcfs/libcfs.h> +#include "../../include/linux/libcfs/libcfs.h" -#include <obd.h> -#include <obd_class.h> -#include <obd_support.h> -#include <lu_ref.h> +#include "../include/obd.h" +#include "../include/obd_class.h" +#include "../include/obd_support.h" +#include "../include/lu_ref.h" diff --git a/drivers/staging/lustre/lustre/obdclass/lu_ucred.c b/drivers/staging/lustre/lustre/obdclass/lu_ucred.c index e23e545b0d66..3676563ab330 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_ucred.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_ucred.c @@ -44,10 +44,10 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <linux/libcfs/libcfs.h> -#include <obd_support.h> -#include <lu_object.h> -#include <md_object.h> +#include "../../include/linux/libcfs/libcfs.h" +#include "../include/obd_support.h" +#include "../include/lu_object.h" +#include "../include/md_object.h" /* context key constructor/destructor: lu_ucred_key_init, lu_ucred_key_fini */ LU_KEY_INIT_FINI(lu_ucred, struct lu_ucred); diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index be31d32b82c8..2010463429b1 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -40,9 +40,9 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_support.h> -#include <lustre_handles.h> -#include <lustre_lib.h> +#include "../include/obd_support.h" +#include "../include/lustre_handles.h" +#include "../include/lustre_lib.h" static __u64 handle_base; @@ -97,7 +97,7 @@ void class_handle_hash(struct portals_handle *h, h->h_in = 1; spin_unlock(&bucket->lock); - CDEBUG(D_INFO, "added object %p with handle "LPX64" to hash\n", + CDEBUG(D_INFO, "added object %p with handle %#llx to hash\n", h, h->h_cookie); } EXPORT_SYMBOL(class_handle_hash); @@ -105,12 +105,12 @@ EXPORT_SYMBOL(class_handle_hash); static void class_handle_unhash_nolock(struct portals_handle *h) { if (list_empty(&h->h_link)) { - CERROR("removing an already-removed handle ("LPX64")\n", + CERROR("removing an already-removed handle (%#llx)\n", h->h_cookie); return; } - CDEBUG(D_INFO, "removing object %p with handle "LPX64" from hash\n", + CDEBUG(D_INFO, "removing object %p with handle %#llx from hash\n", h, h->h_cookie); spin_lock(&h->h_lock); @@ -230,7 +230,7 @@ static int cleanup_all_handles(void) spin_lock(&handle_hash[i].lock); list_for_each_entry_rcu(h, &(handle_hash[i].head), h_link) { - CERROR("force clean handle "LPX64" addr %p ops %p\n", + CERROR("force clean handle %#llx addr %p ops %p\n", h->h_cookie, h, h->h_ops); class_handle_unhash_nolock(h); diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c index df4936ad2375..64b2f35e224f 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c @@ -36,13 +36,13 @@ #define DEBUG_SUBSYSTEM S_RPC -#include <obd.h> -#include <obd_support.h> -#include <obd_class.h> -#include <lustre_lib.h> -#include <lustre_ha.h> -#include <lustre_net.h> -#include <lprocfs_status.h> +#include "../include/obd.h" +#include "../include/obd_support.h" +#include "../include/obd_class.h" +#include "../include/lustre_lib.h" +#include "../include/lustre_ha.h" +#include "../include/lustre_net.h" +#include "../include/lprocfs_status.h" #define NIDS_MAX 32 diff --git a/drivers/staging/lustre/lustre/obdclass/md_attrs.c b/drivers/staging/lustre/lustre/obdclass/md_attrs.c index f080cceb384c..d9e6348de4fa 100644 --- a/drivers/staging/lustre/lustre/obdclass/md_attrs.c +++ b/drivers/staging/lustre/lustre/obdclass/md_attrs.c @@ -27,9 +27,9 @@ * Author: Johann Lombardi <johann.lombardi@intel.com> */ -#include <lustre/lustre_idl.h> -#include <obd.h> -#include <md_object.h> +#include "../include/lustre/lustre_idl.h" +#include "../include/obd.h" +#include "../include/md_object.h" /** * Initialize new \a lma. Only fid is stored. diff --git a/drivers/staging/lustre/lustre/obdclass/mea.c b/drivers/staging/lustre/lustre/obdclass/mea.c index c4f0dbc23611..d6ce084da902 100644 --- a/drivers/staging/lustre/lustre/obdclass/mea.c +++ b/drivers/staging/lustre/lustre/obdclass/mea.c @@ -33,13 +33,13 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> +#include "../include/obd_class.h" #include <linux/kmod.h> /* for request_module() */ #include <linux/module.h> #include <linux/slab.h> #include <linux/pagemap.h> -#include <lprocfs_status.h> -#include <lustre/lustre_idl.h> +#include "../include/lprocfs_status.h" +#include "../include/lustre/lustre_idl.h" static int mea_last_char_hash(int count, char *name, int namelen) { diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index 2d5777699f47..0d81d3232f31 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -39,11 +39,11 @@ */ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> +#include "../include/obd_class.h" #include <linux/string.h> -#include <lustre_log.h> -#include <lprocfs_status.h> -#include <lustre_param.h> +#include "../include/lustre_log.h" +#include "../include/lprocfs_status.h" +#include "../include/lustre_param.h" #include "llog_internal.h" @@ -1093,9 +1093,9 @@ int class_process_config(struct lustre_cfg *lcfg) GOTO(out, err); } case LCFG_ADD_UUID: { - CDEBUG(D_IOCTL, "adding mapping from uuid %s to nid "LPX64 - " (%s)\n", lustre_cfg_string(lcfg, 1), - lcfg->lcfg_nid, libcfs_nid2str(lcfg->lcfg_nid)); + CDEBUG(D_IOCTL, "adding mapping from uuid %s to nid %#llx (%s)\n", + lustre_cfg_string(lcfg, 1), lcfg->lcfg_nid, + libcfs_nid2str(lcfg->lcfg_nid)); err = class_add_uuid(lustre_cfg_string(lcfg, 1), lcfg->lcfg_nid); GOTO(out, err); @@ -1161,7 +1161,7 @@ int class_process_config(struct lustre_cfg *lcfg) char *tmp; /* llite has no obd */ if ((class_match_param(lustre_cfg_string(lcfg, 1), - PARAM_LLITE, 0) == 0) && + PARAM_LLITE, NULL) == 0) && client_process_config) { err = (*client_process_config)(lcfg); GOTO(out, err); @@ -1303,8 +1303,8 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, /* Search proc entries */ while (lvars[j].name) { var = &lvars[j]; - if (class_match_param(key, (char *)var->name, 0) == 0 && - keylen == strlen(var->name)) { + if (class_match_param(key, (char *)var->name, NULL) == 0 + && keylen == strlen(var->name)) { matched++; rc = -EROFS; if (var->fops && var->fops->write) { @@ -1614,7 +1614,7 @@ int class_config_parse_rec(struct llog_rec_hdr *rec, char *buf, int size) ptr += snprintf(ptr, end-ptr, "num=%#08x ", lcfg->lcfg_num); if (lcfg->lcfg_nid) - ptr += snprintf(ptr, end-ptr, "nid=%s("LPX64")\n ", + ptr += snprintf(ptr, end-ptr, "nid=%s(%#llx)\n ", libcfs_nid2str(lcfg->lcfg_nid), lcfg->lcfg_nid); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index a034aee37fc1..d972f71c9d97 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -45,13 +45,13 @@ #define D_MOUNT (D_SUPER|D_CONFIG/*|D_WARNING */) #define PRINT_CMD CDEBUG -#include <obd.h> -#include <lvfs.h> -#include <obd_class.h> -#include <lustre/lustre_user.h> -#include <lustre_log.h> -#include <lustre_disk.h> -#include <lustre_param.h> +#include "../include/obd.h" +#include "../include/lvfs.h" +#include "../include/obd_class.h" +#include "../include/lustre/lustre_user.h" +#include "../include/lustre_log.h" +#include "../include/lustre_disk.h" +#include "../include/lustre_param.h" static int (*client_fill_super)(struct super_block *sb, struct vfsmount *mnt); @@ -219,7 +219,6 @@ int lustre_start_mgc(struct super_block *sb) lnet_nid_t nid; char *mgcname = NULL, *niduuid = NULL, *mgssec = NULL; char *ptr; - int recov_bk; int rc = 0, i = 0, j, len; LASSERT(lsi->lsi_lmd); @@ -269,6 +268,8 @@ int lustre_start_mgc(struct super_block *sb) obd = class_name2obd(mgcname); if (obd && !obd->obd_stopping) { + int recov_bk; + rc = obd_set_info_async(NULL, obd->obd_self_export, strlen(KEY_MGSSEC), KEY_MGSSEC, strlen(mgssec), mgssec, NULL); @@ -429,16 +430,6 @@ int lustre_start_mgc(struct super_block *sb) so we know when we can get rid of the mgc. */ atomic_set(&obd->u.cli.cl_mgc_refcount, 1); - /* Try all connections, but only once. */ - recov_bk = 1; - rc = obd_set_info_async(NULL, obd->obd_self_export, - sizeof(KEY_INIT_RECOV_BACKUP), - KEY_INIT_RECOV_BACKUP, - sizeof(recov_bk), &recov_bk, NULL); - if (rc) - /* nonfatal */ - CWARN("can't set %s %d\n", KEY_INIT_RECOV_BACKUP, rc); - /* We connect to the MGS at setup, and don't disconnect until cleanup */ data->ocd_connect_flags = OBD_CONNECT_VERSION | OBD_CONNECT_AT | OBD_CONNECT_FULL20 | OBD_CONNECT_IMP_RECOV | @@ -1225,7 +1216,9 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent) if (lmd_is_client(lmd)) { CDEBUG(D_MOUNT, "Mounting client %s\n", lmd->lmd_profile); - if (!client_fill_super) { + if (client_fill_super == NULL) + request_module("lustre"); + if (client_fill_super == NULL) { LCONSOLE_ERROR_MSG(0x165, "Nothing registered for " "client mount! Is the 'lustre' " "module loaded?\n"); @@ -1308,6 +1301,7 @@ struct file_system_type lustre_fs_type = { .fs_flags = FS_BINARY_MOUNTDATA | FS_REQUIRES_DEV | FS_HAS_FIEMAP | FS_RENAME_DOES_D_MOVE, }; +MODULE_ALIAS_FS("lustre"); int lustre_register_fs(void) { diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c index 3b1b28afd6b1..c9fa36b17919 100644 --- a/drivers/staging/lustre/lustre/obdclass/obdo.c +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c @@ -42,8 +42,8 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <obd_class.h> -#include <lustre/lustre_idl.h> +#include "../include/obd_class.h" +#include "../include/lustre/lustre_idl.h" void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent) { @@ -117,7 +117,7 @@ EXPORT_SYMBOL(obdo_from_inode); void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid) { - CDEBUG(D_INODE, "src obdo "DOSTID" valid "LPX64", dst obdo "DOSTID"\n", + CDEBUG(D_INODE, "src obdo "DOSTID" valid %#llx, dst obdo "DOSTID"\n", POSTID(&src->o_oi), src->o_valid, POSTID(&dst->o_oi)); if (valid & OBD_MD_FLATIME) dst->o_atime = src->o_atime; @@ -252,7 +252,7 @@ void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid) valid &= oa->o_valid; if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME)) - CDEBUG(D_INODE, "valid "LPX64", new time "LPU64"/"LPU64"\n", + CDEBUG(D_INODE, "valid %#llx, new time %llu/%llu\n", oa->o_valid, oa->o_mtime, oa->o_ctime); attr->ia_valid = 0; diff --git a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c index c3b7a78dba50..33b1a83f4014 100644 --- a/drivers/staging/lustre/lustre/obdclass/statfs_pack.c +++ b/drivers/staging/lustre/lustre/obdclass/statfs_pack.c @@ -41,10 +41,10 @@ #define DEBUG_SUBSYSTEM S_CLASS -#include <lustre_export.h> -#include <lustre_net.h> -#include <obd_support.h> -#include <obd_class.h> +#include "../include/lustre_export.h" +#include "../include/lustre_net.h" +#include "../include/obd_support.h" +#include "../include/obd_class.h" void statfs_pack(struct obd_statfs *osfs, struct kstatfs *sfs) { diff --git a/drivers/staging/lustre/lustre/obdclass/uuid.c b/drivers/staging/lustre/lustre/obdclass/uuid.c index e87a19900770..ff0a01bcf8da 100644 --- a/drivers/staging/lustre/lustre/obdclass/uuid.c +++ b/drivers/staging/lustre/lustre/obdclass/uuid.c @@ -38,10 +38,10 @@ #define DEBUG_SUBSYSTEM S_CLASS -# include <linux/libcfs/libcfs.h> +#include "../../include/linux/libcfs/libcfs.h" -#include <obd_support.h> -#include <obd_class.h> +#include "../include/obd_support.h" +#include "../include/obd_class.h" static inline __u32 consume(int nob, __u8 **ptr) |