diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/include')
52 files changed, 281 insertions, 3192 deletions
diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index e51cd690f907..d56c8bea89c4 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -98,7 +98,7 @@ * super-class definitions. */ #include "lu_object.h" -#include "lvfs.h" +#include "linux/lustre_compat25.h" #include <linux/mutex.h> #include <linux/radix-tree.h> @@ -2508,7 +2508,7 @@ struct cl_req_operations { void (*cro_attr_set)(const struct lu_env *env, const struct cl_req_slice *slice, const struct cl_object *obj, - struct cl_req_attr *attr, obd_valid flags); + struct cl_req_attr *attr, u64 flags); /** * Called top-to-bottom from cl_req_completion() to notify layers that * transfer completed. Has to free all state allocated by @@ -3182,7 +3182,7 @@ void cl_req_page_add (const struct lu_env *env, struct cl_req *req, void cl_req_page_done (const struct lu_env *env, struct cl_page *page); int cl_req_prep (const struct lu_env *env, struct cl_req *req); void cl_req_attr_set (const struct lu_env *env, struct cl_req *req, - struct cl_req_attr *attr, obd_valid flags); + struct cl_req_attr *attr, u64 flags); void cl_req_completion(const struct lu_env *env, struct cl_req *req, int ioret); /** \defgroup cl_sync_io cl_sync_io diff --git a/drivers/staging/lustre/lustre/include/interval_tree.h b/drivers/staging/lustre/lustre/include/interval_tree.h index 1815783edae6..bf9027d5f773 100644 --- a/drivers/staging/lustre/lustre/include/interval_tree.h +++ b/drivers/staging/lustre/lustre/include/interval_tree.h @@ -112,7 +112,7 @@ enum interval_iter interval_search(struct interval_node *root, enum interval_iter interval_iterate(struct interval_node *root, interval_callback_t func, void *data); enum interval_iter interval_iterate_reverse(struct interval_node *root, - interval_callback_t func,void *data); + interval_callback_t func, void *data); void interval_expand(struct interval_node *root, struct interval_node_extent *ext, diff --git a/drivers/staging/lustre/lustre/include/lclient.h b/drivers/staging/lustre/lustre/include/lclient.h index 386a36c00f57..b3b841f4d6e6 100644 --- a/drivers/staging/lustre/lustre/include/lclient.h +++ b/drivers/staging/lustre/lustre/include/lclient.h @@ -279,7 +279,7 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev, void ccc_umount(const struct lu_env *env, struct cl_device *dev); int ccc_global_init(struct lu_device_type *device_type); void ccc_global_fini(struct lu_device_type *device_type); -int ccc_object_init0(const struct lu_env *env,struct ccc_object *vob, +int ccc_object_init0(const struct lu_env *env, struct ccc_object *vob, const struct cl_object_conf *conf); int ccc_object_init(const struct lu_env *env, struct lu_object *obj, const struct lu_object_conf *conf); @@ -319,11 +319,12 @@ int ccc_transient_page_prep(const struct lu_env *env, struct cl_io *io); void ccc_lock_delete(const struct lu_env *env, const struct cl_lock_slice *slice); -void ccc_lock_fini(const struct lu_env *env,struct cl_lock_slice *slice); -int ccc_lock_enqueue(const struct lu_env *env,const struct cl_lock_slice *slice, +void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice); +int ccc_lock_enqueue(const struct lu_env *env, + const struct cl_lock_slice *slice, struct cl_io *io, __u32 enqflags); -int ccc_lock_unuse(const struct lu_env *env,const struct cl_lock_slice *slice); -int ccc_lock_wait(const struct lu_env *env,const struct cl_lock_slice *slice); +int ccc_lock_unuse(const struct lu_env *env, const struct cl_lock_slice *slice); +int ccc_lock_wait(const struct lu_env *env, const struct cl_lock_slice *slice); int ccc_lock_fits_into(const struct lu_env *env, const struct cl_lock_slice *slice, const struct cl_lock_descr *need, @@ -348,9 +349,10 @@ int ccc_prep_size(const struct lu_env *env, struct cl_object *obj, struct cl_io *io, loff_t start, size_t count, int *exceed); void ccc_req_completion(const struct lu_env *env, const struct cl_req_slice *slice, int ioret); -void ccc_req_attr_set(const struct lu_env *env,const struct cl_req_slice *slice, +void ccc_req_attr_set(const struct lu_env *env, + const struct cl_req_slice *slice, const struct cl_object *obj, - struct cl_req_attr *oa, obd_valid flags); + struct cl_req_attr *oa, u64 flags); struct lu_device *ccc2lu_dev (struct ccc_device *vdv); struct lu_object *ccc2lu (struct ccc_object *vob); diff --git a/drivers/staging/lustre/lustre/include/linux/lprocfs_status.h b/drivers/staging/lustre/lustre/include/linux/lprocfs_status.h deleted file mode 100644 index cb76b5d6f71a..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lprocfs_status.h +++ /dev/null @@ -1,57 +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) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2011, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lprocfs_status.h - * - * Top level header file for LProc SNMP - * - * Author: Hariharan Thantry thantry@users.sourceforge.net - */ -#ifndef _LINUX_LPROCFS_SNMP_H -#define _LINUX_LPROCFS_SNMP_H - -#ifndef _LPROCFS_SNMP_H -#error Do not #include this file directly. #include <lprocfs_status.h> instead -#endif - -#include <linux/proc_fs.h> -#include <linux/seq_file.h> -#include <linux/smp.h> -#include <linux/rwsem.h> -#include "../../../include/linux/libcfs/libcfs.h" -#include <linux/statfs.h> - - -#endif /* LPROCFS_SNMP_H */ diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_acl.h b/drivers/staging/lustre/lustre/include/linux/lustre_acl.h deleted file mode 100644 index b17273d403bb..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_acl.h +++ /dev/null @@ -1,66 +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) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * Copyright (c) 2011, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/lustre/include/lustre_acl.h - * - * MDS data structures. - * See also lustre_idl.h for wire formats of requests. - */ - -#ifndef _LUSTRE_LINUX_ACL_H -#define _LUSTRE_LINUX_ACL_H - -#ifndef _LUSTRE_ACL_H -#error Should not include directly. use #include <lustre_acl.h> instead -#endif - -#include <linux/fs.h> -#include <linux/dcache.h> - -#include <linux/posix_acl_xattr.h> -#define LUSTRE_POSIX_ACL_MAX_ENTRIES 32 -#define LUSTRE_POSIX_ACL_MAX_SIZE \ - (sizeof(posix_acl_xattr_header) + \ - LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(posix_acl_xattr_entry)) - -#include "lustre_intent.h" -#include <linux/xattr.h> /* XATTR_{REPLACE,CREATE} */ - -#ifndef LUSTRE_POSIX_ACL_MAX_SIZE -# define LUSTRE_POSIX_ACL_MAX_SIZE 0 -#endif - -#endif /* _LUSTRE_LINUX_ACL_H */ diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_common.h b/drivers/staging/lustre/lustre/include/linux/lustre_common.h deleted file mode 100644 index d1783a33d8ca..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_common.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef LUSTRE_COMMON_H -#define LUSTRE_COMMON_H - -#include <linux/sched.h> - -static inline int cfs_cleanup_group_info(void) -{ - struct group_info *ginfo; - - ginfo = groups_alloc(0); - if (!ginfo) - return -ENOMEM; - - set_current_groups(ginfo); - put_group_info(ginfo); - - return 0; -} - -#define ll_inode_blksize(a) (1<<(a)->i_blkbits) - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index 8621bac5058b..e94ab343ab25 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h @@ -39,7 +39,6 @@ #include <linux/fs_struct.h> #include <linux/namei.h> -#include "../../../include/linux/libcfs/linux/portals_compat25.h" #include "lustre_patchless_compat.h" @@ -99,17 +98,19 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, #define FS_HAS_FIEMAP (0) #endif -#define ll_vfs_rmdir(dir,entry,mnt) vfs_rmdir(dir,entry) -#define ll_vfs_mkdir(inode,dir,mnt,mode) vfs_mkdir(inode,dir,mode) -#define ll_vfs_link(old,mnt,dir,new,mnt1) vfs_link(old,dir,new) -#define ll_vfs_unlink(inode,entry,mnt) vfs_unlink(inode,entry) -#define ll_vfs_mknod(dir,entry,mnt,mode,dev) vfs_mknod(dir,entry,mode,dev) -#define ll_security_inode_unlink(dir,entry,mnt) security_inode_unlink(dir,entry) +#define ll_vfs_rmdir(dir, entry, mnt) vfs_rmdir(dir, entry) +#define ll_vfs_mkdir(inode, dir, mnt, mode) vfs_mkdir(inode, dir, mode) +#define ll_vfs_link(old, mnt, dir, new, mnt1) vfs_link(old, dir, new) +#define ll_vfs_unlink(inode, entry, mnt) vfs_unlink(inode, entry) +#define ll_vfs_mknod(dir, entry, mnt, mode, dev) \ + vfs_mknod(dir, entry, mode, dev) +#define ll_security_inode_unlink(dir, entry, mnt) \ + security_inode_unlink(dir, entry) #define ll_vfs_rename(old, old_dir, mnt, new, new_dir, mnt1) \ vfs_rename(old, old_dir, new, new_dir, NULL, 0) -#define cfs_bio_io_error(a,b) bio_io_error((a)) -#define cfs_bio_endio(a,b,c) bio_endio((a),(c)) +#define cfs_bio_io_error(a, b) bio_io_error((a)) +#define cfs_bio_endio(a, b, c) bio_endio((a), (c)) #define cfs_fs_pwd(fs) ((fs)->pwd.dentry) #define cfs_fs_mnt(fs) ((fs)->pwd.mnt) diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_dlm.h b/drivers/staging/lustre/lustre/include/linux/lustre_dlm.h deleted file mode 100644 index 207df03f6149..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_dlm.h +++ /dev/null @@ -1,46 +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) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef _LINUX_LUSTRE_DLM_H__ -#define _LINUX_LUSTRE_DLM_H__ - -#ifndef _LUSTRE_DLM_H__ -#error Do not #include this file directly. #include <lprocfs_status.h> instead -#endif - -# include <linux/proc_fs.h> -# include <asm/processor.h> -# include <linux/bit_spinlock.h> - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_fsfilt.h b/drivers/staging/lustre/lustre/include/linux/lustre_fsfilt.h deleted file mode 100644 index d5c97beb66f5..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_fsfilt.h +++ /dev/null @@ -1,171 +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) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 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_fsfilt.h - * - * Filesystem interface helper. - */ - -#ifndef _LINUX_LUSTRE_FSFILT_H -#define _LINUX_LUSTRE_FSFILT_H - -#ifndef _LUSTRE_FSFILT_H -#error Do not #include this file directly. #include <lustre_fsfilt.h> instead -#endif - - -#include "../obd.h" -#include "../obd_class.h" - -typedef void (*fsfilt_cb_t)(struct obd_device *obd, __u64 last_rcvd, - void *data, int error); - -struct fsfilt_operations { - struct list_head fs_list; - struct module *fs_owner; - char *fs_type; - char *(* fs_getlabel)(struct super_block *sb); - void *(* fs_start)(struct inode *inode, int op, void *desc_private, - int logs); - int (* fs_commit)(struct inode *inode, void *handle,int force_sync); - int (* fs_map_inode_pages)(struct inode *inode, struct page **page, - int pages, unsigned long *blocks, - int create, struct mutex *sem); - int (* fs_write_record)(struct file *, void *, int size, loff_t *, - int force_sync); - int (* fs_read_record)(struct file *, void *, int size, loff_t *); - int (* fs_setup)(struct super_block *sb); -}; - -extern int fsfilt_register_ops(struct fsfilt_operations *fs_ops); -extern void fsfilt_unregister_ops(struct fsfilt_operations *fs_ops); -extern struct fsfilt_operations *fsfilt_get_ops(const char *type); -extern void fsfilt_put_ops(struct fsfilt_operations *fs_ops); - -static inline char *fsfilt_get_label(struct obd_device *obd, - struct super_block *sb) -{ - if (obd->obd_fsops->fs_getlabel == NULL) - return NULL; - if (obd->obd_fsops->fs_getlabel(sb)[0] == '\0') - return NULL; - - return obd->obd_fsops->fs_getlabel(sb); -} - -#define FSFILT_OP_UNLINK 1 -#define FSFILT_OP_CANCEL_UNLINK 10 - -#define __fsfilt_check_slow(obd, start, msg) \ -do { \ - if (time_before(jiffies, start + 15 * HZ)) \ - break; \ - else if (time_before(jiffies, start + 30 * HZ)) \ - CDEBUG(D_VFSTRACE, "%s: slow %s %lus\n", obd->obd_name, \ - msg, (jiffies-start) / HZ); \ - else if (time_before(jiffies, start + DISK_TIMEOUT * HZ)) \ - CWARN("%s: slow %s %lus\n", obd->obd_name, msg, \ - (jiffies - start) / HZ); \ - else \ - CERROR("%s: slow %s %lus\n", obd->obd_name, msg, \ - (jiffies - start) / HZ); \ -} while (0) - -#define fsfilt_check_slow(obd, start, msg) \ -do { \ - __fsfilt_check_slow(obd, start, msg); \ - start = jiffies; \ -} while (0) - -static inline void *fsfilt_start_log(struct obd_device *obd, - struct inode *inode, int op, - struct obd_trans_info *oti, int logs) -{ - unsigned long now = jiffies; - void *parent_handle = oti ? oti->oti_handle : NULL; - void *handle; - - handle = obd->obd_fsops->fs_start(inode, op, parent_handle, logs); - CDEBUG(D_INFO, "started handle %p (%p)\n", handle, parent_handle); - - if (oti != NULL) { - if (parent_handle == NULL) { - oti->oti_handle = handle; - } else if (handle != parent_handle) { - CERROR("mismatch: parent %p, handle %p, oti %p\n", - parent_handle, handle, oti); - LBUG(); - } - } - fsfilt_check_slow(obd, now, "journal start"); - return handle; -} - -static inline int fsfilt_commit(struct obd_device *obd, struct inode *inode, - void *handle, int force_sync) -{ - unsigned long now = jiffies; - int rc = obd->obd_fsops->fs_commit(inode, handle, force_sync); - CDEBUG(D_INFO, "committing handle %p\n", handle); - - fsfilt_check_slow(obd, now, "journal start"); - - return rc; -} - -static inline int fsfilt_read_record(struct obd_device *obd, struct file *file, - void *buf, loff_t size, loff_t *offs) -{ - return obd->obd_fsops->fs_read_record(file, buf, size, offs); -} - -static inline int fsfilt_write_record(struct obd_device *obd, struct file *file, - void *buf, loff_t size, loff_t *offs, - int force_sync) -{ - return obd->obd_fsops->fs_write_record(file, buf, size,offs,force_sync); -} - -static inline int fsfilt_setup(struct obd_device *obd, struct super_block *fs) -{ - if (obd->obd_fsops->fs_setup) - return obd->obd_fsops->fs_setup(fs); - return 0; -} - - - - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_handles.h b/drivers/staging/lustre/lustre/include/linux/lustre_handles.h deleted file mode 100644 index 459b2380600f..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_handles.h +++ /dev/null @@ -1,52 +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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef __LINUX_LUSTRE_HANDLES_H_ -#define __LINUX_LUSTRE_HANDLES_H_ - -#ifndef __LUSTRE_HANDLES_H_ -#error Do not #include this file directly. #include <lustre_handles.h> instead -#endif - -#include <asm/types.h> -#include <asm/atomic.h> -#include <linux/list.h> -#include <linux/spinlock.h> -#include <linux/types.h> - -#include <linux/rcupdate.h> /* for rcu_head{} */ -typedef struct rcu_head cfs_rcu_head_t; - - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_lib.h b/drivers/staging/lustre/lustre/include/linux/lustre_lib.h deleted file mode 100644 index 0a4c65ae9242..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_lib.h +++ /dev/null @@ -1,85 +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, 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 <lustre_lib.h> instead -#endif - -# include <linux/rwsem.h> -# include <linux/sched.h> -# include <linux/signal.h> -# include <linux/types.h> -#include "lustre_compat25.h" -#include "lustre_common.h" - -#ifndef LP_POISON -# define LI_POISON 0x5a5a5a5a -#if BITS_PER_LONG > 32 -# define LL_POISON 0x5a5a5a5a5a5a5a5aL -#else -# define LL_POISON 0x5a5a5a5aL -#endif -# define LP_POISON ((void *)LL_POISON) -#endif - -/* This macro is only for compatibility reasons with older Linux Lustre user - * tools. New ioctls should NOT use this macro as the ioctl "size". Instead - * the ioctl should get a "size" argument which is the actual data type used - * by the ioctl, to ensure the ioctl interface is versioned correctly. */ -#define OBD_IOC_DATA_TYPE long - -#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/drivers/staging/lustre/lustre/include/linux/lustre_lite.h b/drivers/staging/lustre/lustre/include/linux/lustre_lite.h index 99eed4987635..a7658a99a08d 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_lite.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_lite.h @@ -52,7 +52,6 @@ #include <linux/rbtree.h> #include "../../include/linux/lustre_compat25.h" -#include "../../include/linux/lustre_common.h" #include <linux/pagemap.h> /* lprocfs.c */ diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_log.h b/drivers/staging/lustre/lustre/include/linux/lustre_log.h deleted file mode 100644 index e9c8e56737d2..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_log.h +++ /dev/null @@ -1,57 +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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lustre_log.h - * - * Generic infrastructure for managing a collection of logs. - * These logs are used for: - * - orphan recovery: OST adds record on create - * - mtime/size consistency: the OST adds a record on first write - * - open/unlinked objects: OST adds a record on destroy - * - * - mds unlink log: the MDS adds an entry upon delete - * - * - raid1 replication log between OST's - * - MDS replication logs - */ - -#ifndef _LINUX_LUSTRE_LOG_H -#define _LINUX_LUSTRE_LOG_H - -#ifndef _LUSTRE_LOG_H -#error Do not #include this file directly. #include <lustre_log.h> instead -#endif - -#define LUSTRE_LOG_SERVER - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_net.h b/drivers/staging/lustre/lustre/include/linux/lustre_net.h deleted file mode 100644 index 05de4d87db9a..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_net.h +++ /dev/null @@ -1,49 +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) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef _LINUX_LUSTRE_NET_H -#define _LINUX_LUSTRE_NET_H - -#ifndef _LUSTRE_NET_H -#error Do not #include this file directly. #include <lustre_net.h> instead -#endif - -#include <linux/workqueue.h> - -/* XXX Liang: should be moved to other header instead of here */ -#ifndef WITH_GROUP_INFO -#define WITH_GROUP_INFO -#endif - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_quota.h b/drivers/staging/lustre/lustre/include/linux/lustre_quota.h deleted file mode 100644 index a39505014c82..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lustre_quota.h +++ /dev/null @@ -1,46 +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) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef _LINUX_LUSTRE_QUOTA_H -#define _LINUX_LUSTRE_QUOTA_H - -#ifndef _LUSTRE_QUOTA_H -#error Do not #include this file directly. #include <lustre_quota.h> instead -#endif - -#include <linux/fs.h> -#include <linux/quota.h> -#include <linux/quotaops.h> - -#endif /* _LUSTRE_QUOTA_H */ diff --git a/drivers/staging/lustre/lustre/include/linux/lvfs.h b/drivers/staging/lustre/lustre/include/linux/lvfs.h deleted file mode 100644 index dd1be9c39829..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lvfs.h +++ /dev/null @@ -1,134 +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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/linux/lvfs.h - * - * lustre VFS/process permission interface - */ - -#ifndef __LINUX_LVFS_H__ -#define __LINUX_LVFS_H__ - -#ifndef __LVFS_H__ -#error Do not #include this file directly. #include <lvfs.h> instead -#endif - -#include "lustre_compat25.h" -#include "lustre_common.h" -#include "lvfs_linux.h" - -#define LLOG_LVFS - -/* simple.c */ - -struct lvfs_ucred { - kuid_t luc_uid; - kgid_t luc_gid; - kuid_t luc_fsuid; - kgid_t luc_fsgid; - kernel_cap_t luc_cap; - __u32 luc_umask; - struct group_info *luc_ginfo; - struct md_identity *luc_identity; -}; - -struct lvfs_callback_ops { - struct dentry *(*l_fid2dentry)(__u64 id_ino, __u32 gen, __u64 gr, void *data); -}; - -#define OBD_RUN_CTXT_MAGIC 0xC0FFEEAA -#define OBD_CTXT_DEBUG /* development-only debugging */ -struct lvfs_run_ctxt { - struct vfsmount *pwdmnt; - struct dentry *pwd; - mm_segment_t fs; - struct lvfs_ucred luc; - int ngroups; - struct lvfs_callback_ops cb_ops; - struct group_info *group_info; - struct dt_device *dt; -#ifdef OBD_CTXT_DEBUG - __u32 magic; -#endif -}; - -#ifdef OBD_CTXT_DEBUG -#define OBD_SET_CTXT_MAGIC(ctxt) (ctxt)->magic = OBD_RUN_CTXT_MAGIC -#else -#define OBD_SET_CTXT_MAGIC(ctxt) do {} while(0) -#endif - - -int lustre_rename(struct dentry *dir, struct vfsmount *mnt, char *oldname, - char *newname); - -static inline void l_dput(struct dentry *de) -{ - if (!de || IS_ERR(de)) - return; - //shrink_dcache_parent(de); - LASSERT(d_count(de) > 0); - dput(de); -} - -/* We need to hold the inode semaphore over the dcache lookup itself, or we - * run the risk of entering the filesystem lookup path concurrently on SMP - * systems, and instantiating two inodes for the same entry. We still - * protect against concurrent addition/removal races with the DLM locking. - */ -static inline struct dentry *ll_lookup_one_len(const char *fid_name, - struct dentry *dparent, - int fid_namelen) -{ - struct dentry *dchild; - - mutex_lock(&dparent->d_inode->i_mutex); - dchild = lookup_one_len(fid_name, dparent, fid_namelen); - mutex_unlock(&dparent->d_inode->i_mutex); - - if (IS_ERR(dchild) || dchild->d_inode == NULL) - return dchild; - - if (is_bad_inode(dchild->d_inode)) { - CERROR("bad inode returned %lu/%u\n", - dchild->d_inode->i_ino, dchild->d_inode->i_generation); - dput(dchild); - dchild = ERR_PTR(-ENOENT); - } - return dchild; -} - - -#endif diff --git a/drivers/staging/lustre/lustre/include/linux/lvfs_linux.h b/drivers/staging/lustre/lustre/include/linux/lvfs_linux.h deleted file mode 100644 index fff22ec1f869..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/lvfs_linux.h +++ /dev/null @@ -1,61 +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) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef __LVFS_LINUX_H__ -#define __LVFS_LINUX_H__ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/fs.h> -#include <linux/namei.h> -#include <linux/sched.h> - -#include "../lvfs.h" - -struct lvfs_run_ctxt; -struct file *l_dentry_open(struct lvfs_run_ctxt *, struct dentry *, - int flags); - -struct l_linux_dirent { - struct list_head lld_list; - ino_t lld_ino; - unsigned long lld_off; - char lld_name[LL_FID_NAMELEN]; -}; -struct l_readdir_callback { - struct l_linux_dirent *lrc_dirent; - struct list_head *lrc_list; -}; - -#endif /* __LVFS_LINUX_H__ */ diff --git a/drivers/staging/lustre/lustre/include/linux/obd.h b/drivers/staging/lustre/lustre/include/linux/obd.h index 2a3a88cbb192..9d7e28ace42d 100644 --- a/drivers/staging/lustre/lustre/include/linux/obd.h +++ b/drivers/staging/lustre/lustre/include/linux/obd.h @@ -48,7 +48,7 @@ # include <linux/sched.h> /* for struct task_struct, for current.h */ # include <linux/proc_fs.h> # include <linux/mount.h> -#include "lustre_intent.h" +#include "../lustre_intent.h" struct ll_iattr { struct iattr iattr; diff --git a/drivers/staging/lustre/lustre/include/linux/obd_class.h b/drivers/staging/lustre/lustre/include/linux/obd_class.h deleted file mode 100644 index 021ead6639fc..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/obd_class.h +++ /dev/null @@ -1,58 +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) 1999, 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. - */ - -#ifndef __LINUX_CLASS_OBD_H -#define __LINUX_CLASS_OBD_H - -#ifndef __CLASS_OBD_H -#error Do not #include this file directly. #include <obd_class.h> instead -#endif - -#include <asm/uaccess.h> -#include <linux/types.h> -#include <linux/fs.h> -#include <linux/time.h> -#include <linux/timer.h> - -/* obdo.c */ -void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid); -void la_from_obdo(struct lu_attr *la, struct obdo *dst, obd_flag valid); -void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid); -void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid); -#define ll_inode_flags(inode) (inode->i_flags) - - -#endif /* __LINUX_OBD_CLASS_H */ diff --git a/drivers/staging/lustre/lustre/include/linux/obd_support.h b/drivers/staging/lustre/lustre/include/linux/obd_support.h deleted file mode 100644 index ea03b8434f62..000000000000 --- a/drivers/staging/lustre/lustre/include/linux/obd_support.h +++ /dev/null @@ -1,63 +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) 1999, 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. - */ - -#ifndef _LINUX_OBD_SUPPORT -#define _LINUX_OBD_SUPPORT - -#ifndef _OBD_SUPPORT -#error Do not #include this file directly. #include <obd_support.h> instead -#endif - -#ifdef CONFIG_X86 -#include <asm/cpufeature.h> -#endif -#include <asm/processor.h> -#include <linux/seq_file.h> -#include <linux/module.h> -#include <linux/slab.h> -#include <linux/highmem.h> -#include <linux/swap.h> -#include "../../include/linux/lustre_compat25.h" -#include "lustre_common.h" -#include "../../../include/linux/libcfs/libcfs.h" -#include "../lustre/lustre_idl.h" - - -# include <linux/types.h> -# include <linux/blkdev.h> -# include "../lvfs.h" - -#endif diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 16b3d6887ff6..ccb6cd42a67d 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -42,7 +42,11 @@ #ifndef _LPROCFS_SNMP_H #define _LPROCFS_SNMP_H -#include "linux/lprocfs_status.h" +#include <linux/proc_fs.h> +#include <linux/seq_file.h> +#include <linux/spinlock.h> +#include <linux/types.h> + #include "lustre/lustre_idl.h" struct lprocfs_vars { @@ -351,7 +355,7 @@ struct obd_histogram; /* Days / hours / mins / seconds format */ struct dhms { - int d,h,m,s; + int d, h, m, s; }; static inline void s2dhms(struct dhms *ts, time_t secs) { @@ -607,7 +611,7 @@ extern int lprocfs_rd_atomic(struct seq_file *m, void *data); extern int lprocfs_wr_atomic(struct file *file, const char __user *buffer, unsigned long count, void *data); extern int lprocfs_rd_uint(struct seq_file *m, void *data); -extern int lprocfs_wr_uint(struct file *file, const char *buffer, +extern int lprocfs_wr_uint(struct file *file, const char __user *buffer, unsigned long count, void *data); extern int lprocfs_rd_uuid(struct seq_file *m, void *data); extern int lprocfs_rd_name(struct seq_file *m, void *data); @@ -673,7 +677,7 @@ extern int lprocfs_seq_release(struct inode *, struct file *); up_read(&(obd)->u.cli.cl_sem); \ return -ENODEV; \ } \ -} while(0) +} while (0) #define LPROCFS_CLIMP_EXIT(obd) \ up_read(&(obd)->u.cli.cl_sem); @@ -864,7 +868,8 @@ static inline void lprocfs_free_md_stats(struct obd_device *obddev) struct obd_export; static inline int lprocfs_add_clear_entry(struct obd_export *exp) { return 0; } -static inline int lprocfs_exp_setup(struct obd_export *exp,lnet_nid_t *peer_nid, +static inline int lprocfs_exp_setup(struct obd_export *exp, + lnet_nid_t *peer_nid, int *newnid) { return 0; } static inline int lprocfs_exp_cleanup(struct obd_export *exp) diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index d5c368bab5bd..6015ee5c4b64 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -404,11 +404,11 @@ struct lu_attr { /** size in bytes */ __u64 la_size; /** modification time in seconds since Epoch */ - obd_time la_mtime; + s64 la_mtime; /** access time in seconds since Epoch */ - obd_time la_atime; + s64 la_atime; /** change time in seconds since Epoch */ - obd_time la_ctime; + s64 la_ctime; /** 512-byte blocks allocated to object */ __u64 la_blocks; /** permission bits and file type */ @@ -1146,8 +1146,8 @@ struct lu_context_key { struct __##mod##__dummy_fini {;} /* semicolon catcher */ #define LU_KEY_INIT_FINI(mod, type) \ - LU_KEY_INIT(mod,type); \ - LU_KEY_FINI(mod,type) + LU_KEY_INIT(mod, type); \ + LU_KEY_FINI(mod, type) #define LU_CONTEXT_KEY_DEFINE(mod, tags) \ struct lu_context_key mod##_thread_key = { \ diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 757146273724..7b7457cf70e3 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -128,7 +128,7 @@ //#define PTLBD_BULK_PORTAL 21 #define MDS_SETATTR_PORTAL 22 #define MDS_READPAGE_PORTAL 23 -#define MDS_MDS_PORTAL 24 +#define OUT_PORTAL 24 #define MGC_REPLY_PORTAL 25 #define MGS_REQUEST_PORTAL 26 @@ -165,22 +165,6 @@ #define LUSTRE_LOG_VERSION 0x00050000 #define LUSTRE_MGS_VERSION 0x00060000 -typedef __u32 mdsno_t; -typedef __u64 seqno_t; -typedef __u64 obd_id; -typedef __u64 obd_seq; -typedef __s64 obd_time; -typedef __u64 obd_size; -typedef __u64 obd_off; -typedef __u64 obd_blocks; -typedef __u64 obd_valid; -typedef __u32 obd_blksize; -typedef __u32 obd_mode; -typedef __u32 obd_uid; -typedef __u32 obd_gid; -typedef __u32 obd_flag; -typedef __u32 obd_count; - /** * Describes a range of sequence, lsr_start is included but lsr_end is * not in the range. @@ -337,49 +321,6 @@ enum lma_incompat { }; #define LMA_INCOMPAT_SUPP (LMAI_AGENT | LMAI_REMOTE_PARENT) -extern void lustre_lma_swab(struct lustre_mdt_attrs *lma); -extern void lustre_lma_init(struct lustre_mdt_attrs *lma, - const struct lu_fid *fid, __u32 incompat); -/** - * SOM on-disk attributes stored in a separate xattr. - */ -struct som_attrs { - /** Bitfield for supported data in this structure. For future use. */ - __u32 som_compat; - - /** Incompat feature list. The supported feature mask is available in - * SOM_INCOMPAT_SUPP */ - __u32 som_incompat; - - /** IO Epoch SOM attributes belongs to */ - __u64 som_ioepoch; - /** total file size in objects */ - __u64 som_size; - /** total fs blocks in objects */ - __u64 som_blocks; - /** mds mount id the size is valid for */ - __u64 som_mountid; -}; -extern void lustre_som_swab(struct som_attrs *attrs); - -#define SOM_INCOMPAT_SUPP 0x0 - -/** - * HSM on-disk attributes stored in a separate xattr. - */ -struct hsm_attrs { - /** Bitfield for supported data in this structure. For future use. */ - __u32 hsm_compat; - - /** HSM flags, see hsm_flags enum below */ - __u32 hsm_flags; - /** backend archive id associated with the file */ - __u64 hsm_arch_id; - /** version associated with the last archiving, if any */ - __u64 hsm_arch_ver; -}; -extern void lustre_hsm_swab(struct hsm_attrs *attrs); - /** * fid constants */ @@ -413,7 +354,7 @@ static inline void fid_zero(struct lu_fid *fid) memset(fid, 0, sizeof(*fid)); } -static inline obd_id fid_ver_oid(const struct lu_fid *fid) +static inline __u64 fid_ver_oid(const struct lu_fid *fid) { return ((__u64)fid_ver(fid) << 32 | fid_oid(fid)); } @@ -477,7 +418,7 @@ enum dot_lustre_oid { FID_OID_DOT_LUSTRE_OBF = 2UL, }; -static inline int fid_seq_is_mdt0(obd_seq seq) +static inline int fid_seq_is_mdt0(__u64 seq) { return (seq == FID_SEQ_OST_MDT0); } @@ -487,7 +428,7 @@ static inline int fid_seq_is_mdt(const __u64 seq) return seq == FID_SEQ_OST_MDT0 || seq >= FID_SEQ_NORMAL; }; -static inline int fid_seq_is_echo(obd_seq seq) +static inline int fid_seq_is_echo(__u64 seq) { return (seq == FID_SEQ_ECHO); } @@ -497,7 +438,7 @@ static inline int fid_is_echo(const struct lu_fid *fid) return fid_seq_is_echo(fid_seq(fid)); } -static inline int fid_seq_is_llog(obd_seq seq) +static inline int fid_seq_is_llog(__u64 seq) { return (seq == FID_SEQ_LLOG); } @@ -597,13 +538,13 @@ static inline int fid_is_norm(const struct lu_fid *fid) } /* convert an OST objid into an IDIF FID SEQ number */ -static inline obd_seq fid_idif_seq(obd_id id, __u32 ost_idx) +static inline __u64 fid_idif_seq(__u64 id, __u32 ost_idx) { return FID_SEQ_IDIF | (ost_idx << 16) | ((id >> 32) & 0xffff); } /* convert a packed IDIF FID into an OST objid */ -static inline obd_id fid_idif_id(obd_seq seq, __u32 oid, __u32 ver) +static inline __u64 fid_idif_id(__u64 seq, __u32 oid, __u32 ver) { return ((__u64)ver << 48) | ((seq & 0xffff) << 32) | oid; } @@ -615,7 +556,7 @@ static inline __u32 fid_idif_ost_idx(const struct lu_fid *fid) } /* extract OST sequence (group) from a wire ost_id (id/seq) pair */ -static inline obd_seq ostid_seq(const struct ost_id *ostid) +static inline __u64 ostid_seq(const struct ost_id *ostid) { if (fid_seq_is_mdt0(ostid->oi.oi_seq)) return FID_SEQ_OST_MDT0; @@ -630,7 +571,7 @@ static inline obd_seq ostid_seq(const struct ost_id *ostid) } /* extract OST objid from a wire ost_id (id/seq) pair */ -static inline obd_id ostid_id(const struct ost_id *ostid) +static inline __u64 ostid_id(const struct ost_id *ostid) { if (fid_seq_is_mdt0(ostid_seq(ostid))) return ostid->oi.oi_id & IDIF_OID_MASK; @@ -1371,8 +1312,9 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); #define CLIENT_CONNECT_MDT_REQD (OBD_CONNECT_IBITS | OBD_CONNECT_FID | \ OBD_CONNECT_FULL20) -#define OBD_OCD_VERSION(major,minor,patch,fix) (((major)<<24) + ((minor)<<16) +\ - ((patch)<<8) + (fix)) +#define OBD_OCD_VERSION(major, minor, patch, fix) (((major)<<24) + \ + ((minor)<<16) + \ + ((patch)<<8) + (fix)) #define OBD_OCD_VERSION_MAJOR(version) ((int)((version)>>24)&255) #define OBD_OCD_VERSION_MINOR(version) ((int)((version)>>16)&255) #define OBD_OCD_VERSION_PATCH(version) ((int)((version)>>8)&255) @@ -1857,9 +1799,9 @@ extern void lustre_swab_niobuf_remote (struct niobuf_remote *nbr); struct ost_lvb_v1 { __u64 lvb_size; - obd_time lvb_mtime; - obd_time lvb_atime; - obd_time lvb_ctime; + __s64 lvb_mtime; + __s64 lvb_atime; + __s64 lvb_ctime; __u64 lvb_blocks; }; @@ -1867,9 +1809,9 @@ extern void lustre_swab_ost_lvb_v1(struct ost_lvb_v1 *lvb); struct ost_lvb { __u64 lvb_size; - obd_time lvb_mtime; - obd_time lvb_atime; - obd_time lvb_ctime; + __s64 lvb_mtime; + __s64 lvb_atime; + __s64 lvb_ctime; __u64 lvb_blocks; __u32 lvb_mtime_ns; __u32 lvb_atime_ns; @@ -2250,9 +2192,9 @@ struct mdt_body { struct lustre_handle handle; __u64 valid; __u64 size; /* Offset, in the case of MDS_READPAGE */ - obd_time mtime; - obd_time atime; - obd_time ctime; + __s64 mtime; + __s64 atime; + __s64 ctime; __u64 blocks; /* XID, in the case of MDS_READPAGE */ __u64 ioepoch; __u64 t_state; /* transient file state defined in @@ -2335,9 +2277,9 @@ struct mdt_rec_setattr { __u32 sa_gid; __u64 sa_size; __u64 sa_blocks; - obd_time sa_mtime; - obd_time sa_atime; - obd_time sa_ctime; + __s64 sa_mtime; + __s64 sa_atime; + __s64 sa_ctime; __u32 sa_attr_flags; __u32 sa_mode; __u32 sa_bias; /* some operation flags */ @@ -2466,7 +2408,7 @@ struct mdt_rec_create { struct lu_fid cr_fid1; struct lu_fid cr_fid2; struct lustre_handle cr_old_handle; /* handle in case of open replay */ - obd_time cr_time; + __s64 cr_time; __u64 cr_rdev; __u64 cr_ioepoch; __u64 cr_padding_1; /* rr_blocks */ @@ -2506,7 +2448,7 @@ struct mdt_rec_link { __u32 lk_suppgid2_h; struct lu_fid lk_fid1; struct lu_fid lk_fid2; - obd_time lk_time; + __s64 lk_time; __u64 lk_padding_1; /* rr_atime */ __u64 lk_padding_2; /* rr_ctime */ __u64 lk_padding_3; /* rr_size */ @@ -2533,7 +2475,7 @@ struct mdt_rec_unlink { __u32 ul_suppgid2_h; struct lu_fid ul_fid1; struct lu_fid ul_fid2; - obd_time ul_time; + __s64 ul_time; __u64 ul_padding_2; /* rr_atime */ __u64 ul_padding_3; /* rr_ctime */ __u64 ul_padding_4; /* rr_size */ @@ -2560,7 +2502,7 @@ struct mdt_rec_rename { __u32 rn_suppgid2_h; struct lu_fid rn_fid1; struct lu_fid rn_fid2; - obd_time rn_time; + __s64 rn_time; __u64 rn_padding_1; /* rr_atime */ __u64 rn_padding_2; /* rr_ctime */ __u64 rn_padding_3; /* rr_size */ @@ -2590,7 +2532,7 @@ struct mdt_rec_setxattr { __u32 sx_padding_2; __u32 sx_padding_3; __u64 sx_valid; - obd_time sx_time; + __s64 sx_time; __u64 sx_padding_5; /* rr_ctime */ __u64 sx_padding_6; /* rr_size */ __u64 sx_padding_7; /* rr_blocks */ @@ -2623,9 +2565,9 @@ struct mdt_rec_reint { __u32 rr_suppgid2_h; struct lu_fid rr_fid1; struct lu_fid rr_fid2; - obd_time rr_mtime; - obd_time rr_atime; - obd_time rr_ctime; + __s64 rr_mtime; + __s64 rr_atime; + __s64 rr_ctime; __u64 rr_size; __u64 rr_blocks; __u32 rr_bias; @@ -2871,7 +2813,7 @@ extern void lustre_swab_ldlm_request (struct ldlm_request *rq); /* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available. * Otherwise, 2 are available. */ -#define ldlm_request_bufsize(count,type) \ +#define ldlm_request_bufsize(count, type) \ ({ \ int _avail = LDLM_LOCKREQ_HANDLES; \ _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \ @@ -2979,8 +2921,8 @@ struct cfg_marker { __u32 cm_flags; __u32 cm_vers; /* lustre release version number */ __u32 cm_padding; /* 64 bit align */ - obd_time cm_createtime; /*when this record was first created */ - obd_time cm_canceltime; /*when this record is no longer valid*/ + __s64 cm_createtime; /*when this record was first created */ + __s64 cm_canceltime; /*when this record is no longer valid*/ char cm_tgtname[MTI_NAME_MAXLEN]; char cm_comment[MTI_NAME_MAXLEN]; }; @@ -3084,16 +3026,16 @@ struct llog_logid_rec { struct llog_unlink_rec { struct llog_rec_hdr lur_hdr; - obd_id lur_oid; - obd_count lur_oseq; - obd_count lur_count; + __u64 lur_oid; + __u32 lur_oseq; + __u32 lur_count; struct llog_rec_tail lur_tail; } __attribute__((packed)); struct llog_unlink64_rec { struct llog_rec_hdr lur_hdr; struct lu_fid lur_fid; - obd_count lur_count; /* to destroy the lost precreated */ + __u32 lur_count; /* to destroy the lost precreated */ __u32 lur_padding1; __u64 lur_padding2; __u64 lur_padding3; @@ -3238,7 +3180,7 @@ enum llog_flag { struct llog_log_hdr { struct llog_rec_hdr llh_hdr; - obd_time llh_timestamp; + __s64 llh_timestamp; __u32 llh_count; __u32 llh_bitmap_offset; __u32 llh_size; @@ -3296,25 +3238,25 @@ struct llogd_conn_body { /* Note: 64-bit types are 64-bit aligned in structure */ struct obdo { - obd_valid o_valid; /* hot fields in this obdo */ - struct ost_id o_oi; - obd_id o_parent_seq; - obd_size o_size; /* o_size-o_blocks == ost_lvb */ - obd_time o_mtime; - obd_time o_atime; - obd_time o_ctime; - obd_blocks o_blocks; /* brw: cli sent cached bytes */ - obd_size o_grant; + __u64 o_valid; /* hot fields in this obdo */ + struct ost_id o_oi; + __u64 o_parent_seq; + __u64 o_size; /* o_size-o_blocks == ost_lvb */ + __s64 o_mtime; + __s64 o_atime; + __s64 o_ctime; + __u64 o_blocks; /* brw: cli sent cached bytes */ + __u64 o_grant; /* 32-bit fields start here: keep an even number of them via padding */ - obd_blksize o_blksize; /* optimal IO blocksize */ - obd_mode o_mode; /* brw: cli sent cache remain */ - obd_uid o_uid; - obd_gid o_gid; - obd_flag o_flags; - obd_count o_nlink; /* brw: checksum */ - obd_count o_parent_oid; - obd_count o_misc; /* brw: o_dropped */ + __u32 o_blksize; /* optimal IO blocksize */ + __u32 o_mode; /* brw: cli sent cache remain */ + __u32 o_uid; + __u32 o_gid; + __u32 o_flags; + __u32 o_nlink; /* brw: checksum */ + __u32 o_parent_oid; + __u32 o_misc; /* brw: o_dropped */ __u64 o_ioepoch; /* epoch in ost writes */ __u32 o_stripe_idx; /* holds stripe idx */ @@ -3363,7 +3305,7 @@ static inline void lustre_get_wire_obdo(struct obd_connect_data *ocd, struct obdo *lobdo, const struct obdo *wobdo) { - obd_flag local_flags = 0; + __u32 local_flags = 0; if (lobdo->o_valid & OBD_MD_FLFLAGS) local_flags = lobdo->o_flags & OBD_FL_LOCAL_MASK; @@ -3401,7 +3343,7 @@ struct ll_fiemap_info_key { }; extern void lustre_swab_ost_body (struct ost_body *b); -extern void lustre_swab_ost_last_id(obd_id *id); +extern void lustre_swab_ost_last_id(__u64 *id); extern void lustre_swab_fiemap(struct ll_user_fiemap *fiemap); extern void lustre_swab_lov_user_md_v1(struct lov_user_md_v1 *lum); diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index a69b27a78042..89794fdfec9d 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -841,7 +841,7 @@ struct ioc_data_version { version. Dirty caches are left unchanged. */ #ifndef offsetof -# define offsetof(typ,memb) ((unsigned long)((char *)&(((typ *)0)->memb))) +# define offsetof(typ, memb) ((unsigned long)((char *)&(((typ *)0)->memb))) #endif #define dot_lustre_name ".lustre" @@ -997,12 +997,25 @@ static inline void *hur_data(struct hsm_user_request *hur) return &(hur->hur_user_item[hur->hur_request.hr_itemcount]); } -/** Compute the current length of the provided hsm_user_request. */ -static inline int hur_len(struct hsm_user_request *hur) +/** + * Compute the current length of the provided hsm_user_request. This returns -1 + * instead of an errno because ssize_t is defined to be only [ -1, SSIZE_MAX ] + * + * return -1 on bounds check error. + */ +static inline ssize_t hur_len(struct hsm_user_request *hur) { - return offsetof(struct hsm_user_request, - hur_user_item[hur->hur_request.hr_itemcount]) + - hur->hur_request.hr_data_len; + __u64 size; + + /* can't overflow a __u64 since hr_itemcount is only __u32 */ + size = offsetof(struct hsm_user_request, hur_user_item[0]) + + (__u64)hur->hur_request.hr_itemcount * + sizeof(hur->hur_user_item[0]) + hur->hur_request.hr_data_len; + + if (size != (ssize_t)size) + return -1; + + return size; } /****** HSM RPCs to copytool *****/ @@ -1061,8 +1074,7 @@ static inline char *hai_dump_data_field(struct hsm_action_item *hai, ptr = buffer; sz = len; data_len = hai->hai_len - sizeof(*hai); - for (i = 0 ; (i < data_len) && (sz > 0) ; i++) - { + for (i = 0 ; (i < data_len) && (sz > 0) ; i++) { int cnt; cnt = snprintf(ptr, sz, "%.2X", @@ -1098,7 +1110,7 @@ static inline int cfs_size_round (int val) #endif /* Return pointer to first hai in action list */ -static inline struct hsm_action_item * hai_zero(struct hsm_action_list *hal) +static inline struct hsm_action_item *hai_zero(struct hsm_action_list *hal) { return (struct hsm_action_item *)(hal->hal_fsname + cfs_size_round(strlen(hal-> \ @@ -1106,7 +1118,7 @@ static inline struct hsm_action_item * hai_zero(struct hsm_action_list *hal) + 1)); } /* Return pointer to next hai */ -static inline struct hsm_action_item * hai_next(struct hsm_action_item *hai) +static inline struct hsm_action_item *hai_next(struct hsm_action_item *hai) { return (struct hsm_action_item *)((char *)hai + cfs_size_round(hai->hai_len)); diff --git a/drivers/staging/lustre/lustre/include/lustre_acl.h b/drivers/staging/lustre/lustre/include/lustre_acl.h index 0b6ea0782229..aa4cfa7b749d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_acl.h +++ b/drivers/staging/lustre/lustre/include/lustre_acl.h @@ -37,6 +37,13 @@ #ifndef _LUSTRE_ACL_H #define _LUSTRE_ACL_H -#include "linux/lustre_acl.h" +#include <linux/fs.h> +#include <linux/dcache.h> +#include <linux/posix_acl_xattr.h> + +#define LUSTRE_POSIX_ACL_MAX_ENTRIES 32 +#define LUSTRE_POSIX_ACL_MAX_SIZE \ + (sizeof(posix_acl_xattr_header) + \ + LUSTRE_POSIX_ACL_MAX_ENTRIES * sizeof(posix_acl_xattr_entry)) #endif diff --git a/drivers/staging/lustre/lustre/include/lustre_cfg.h b/drivers/staging/lustre/lustre/include/lustre_cfg.h index 03017fe49d46..7b385b87261a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_cfg.h +++ b/drivers/staging/lustre/lustre/include/lustre_cfg.h @@ -290,4 +290,4 @@ static inline int lustre_cfg_sanity_check(void *buf, int len) /** @} cfg */ -#endif // _LUSTRE_CFG_H +#endif /* _LUSTRE_CFG_H */ diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 7f191eed2a81..515b835ce14d 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -545,4 +545,4 @@ int mgc_fsname2resid(char *fsname, struct ldlm_res_id *res_id, int type); /** @} disk */ -#endif // _LUSTRE_DISK_H +#endif /* _LUSTRE_DISK_H */ diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 30b1812f4bf6..14ac46f45fd1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -48,8 +48,6 @@ #ifndef _LUSTRE_DLM_H__ #define _LUSTRE_DLM_H__ -#include "linux/lustre_dlm.h" - #include "lustre_lib.h" #include "lustre_net.h" #include "lustre_import.h" @@ -1072,7 +1070,7 @@ extern char *ldlm_it2str(int it); ((libcfs_debug & (mask)) != 0 && \ (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \ _ldlm_lock_debug(lock, msgdata, fmt, ##a); \ -} while(0) +} while (0) void _ldlm_lock_debug(struct ldlm_lock *lock, struct libcfs_debug_msg_data *data, diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index e5f8e86cd887..9c06a49f12a4 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -125,14 +125,14 @@ struct nid_stat { #define nidstat_getref(nidstat) \ do { \ atomic_inc(&(nidstat)->nid_exp_ref_count); \ -} while(0) +} while (0) #define nidstat_putref(nidstat) \ do { \ atomic_dec(&(nidstat)->nid_exp_ref_count); \ LASSERTF(atomic_read(&(nidstat)->nid_exp_ref_count) >= 0, \ "stat %p nid_exp_ref_count < 0\n", nidstat); \ -} while(0) +} while (0) enum obd_option { OBD_OPT_FORCE = 0x0001, diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index ffb00f171240..2d6fbb4b1b39 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -469,7 +469,7 @@ void seq_client_flush(struct lu_client_seq *seq); int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq, struct lu_fid *fid); int seq_client_get_seq(const struct lu_env *env, struct lu_client_seq *seq, - seqno_t *seqnr); + u64 *seqnr); int seq_site_fini(const struct lu_env *env, struct seq_server_site *ss); /* Fids common stuff */ int fid_is_local(const struct lu_env *env, diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index ce6330f9bb50..64c504849a22 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -137,15 +137,14 @@ void fld_client_fini(struct lu_client_fld *fld); void fld_client_flush(struct lu_client_fld *fld); -int fld_client_lookup(struct lu_client_fld *fld, seqno_t seq, mdsno_t *mds, +int fld_client_lookup(struct lu_client_fld *fld, u64 seq, u32 *mds, __u32 flags, const struct lu_env *env); int fld_client_create(struct lu_client_fld *fld, struct lu_seq_range *range, const struct lu_env *env); -int fld_client_delete(struct lu_client_fld *fld, - seqno_t seq, +int fld_client_delete(struct lu_client_fld *fld, u64 seq, const struct lu_env *env); int fld_client_add_target(struct lu_client_fld *fld, diff --git a/drivers/staging/lustre/lustre/include/lustre_fsfilt.h b/drivers/staging/lustre/lustre/include/lustre_fsfilt.h deleted file mode 100644 index 9749c3f5568e..000000000000 --- a/drivers/staging/lustre/lustre/include/lustre_fsfilt.h +++ /dev/null @@ -1,48 +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) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/lustre_fsfilt.h - * - * Filesystem interface helper. - */ - -#ifndef _LUSTRE_FSFILT_H -#define _LUSTRE_FSFILT_H - -#include "../include/linux/lustre_fsfilt.h" - -#define LU221_BAD_TIME (0x80000000U + 24 * 3600) - -#endif diff --git a/drivers/staging/lustre/lustre/include/lustre_handles.h b/drivers/staging/lustre/lustre/include/lustre_handles.h index 94989c5e361f..726bbd3eaf55 100644 --- a/drivers/staging/lustre/lustre/include/lustre_handles.h +++ b/drivers/staging/lustre/lustre/include/lustre_handles.h @@ -42,7 +42,11 @@ * @{ */ -#include "linux/lustre_handles.h" +#include <linux/atomic.h> +#include <linux/list.h> +#include <linux/rcupdate.h> +#include <linux/spinlock.h> +#include <linux/types.h> #include "../../include/linux/libcfs/libcfs.h" @@ -69,7 +73,7 @@ struct portals_handle { struct portals_handle_ops *h_ops; /* newly added fields to handle the RCU issue. -jxiong */ - cfs_rcu_head_t h_rcu; + struct rcu_head h_rcu; spinlock_t h_lock; unsigned int h_size:31; unsigned int h_in:1; @@ -84,7 +88,7 @@ void class_handle_hash(struct portals_handle *, void class_handle_unhash(struct portals_handle *); void class_handle_hash_back(struct portals_handle *); void *class_handle2object(__u64 cookie); -void class_handle_free_cb(cfs_rcu_head_t *); +void class_handle_free_cb(struct rcu_head *rcu); int class_handle_init(void); void class_handle_cleanup(void); diff --git a/drivers/staging/lustre/lustre/include/lustre_idmap.h b/drivers/staging/lustre/lustre/include/lustre_idmap.h deleted file mode 100644 index 5624b8bae919..000000000000 --- a/drivers/staging/lustre/lustre/include/lustre_idmap.h +++ /dev/null @@ -1,104 +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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/lustre/include/lustre_idmap.h - * - * MDS data structures. - * See also lustre_idl.h for wire formats of requests. - */ - -#ifndef _LUSTRE_IDMAP_H -#define _LUSTRE_IDMAP_H - -/** \defgroup idmap idmap - * - * @{ - */ - -#include "../../include/linux/libcfs/libcfs.h" - -#define CFS_NGROUPS_PER_BLOCK ((int)(PAGE_CACHE_SIZE / sizeof(gid_t))) - -#define CFS_GROUP_AT(gi, i) \ - ((gi)->blocks[(i) / CFS_NGROUPS_PER_BLOCK][(i) % CFS_NGROUPS_PER_BLOCK]) - -enum { - CFS_IC_NOTHING = 0, /* convert nothing */ - CFS_IC_ALL = 1, /* convert all items */ - CFS_IC_MAPPED = 2, /* convert mapped uid/gid */ - CFS_IC_UNMAPPED = 3 /* convert unmapped uid/gid */ -}; - -#define CFS_IDMAP_NOTFOUND (-1) - -#define CFS_IDMAP_HASHSIZE 32 - -enum lustre_idmap_idx { - RMT_UIDMAP_IDX, - LCL_UIDMAP_IDX, - RMT_GIDMAP_IDX, - LCL_GIDMAP_IDX, - CFS_IDMAP_N_HASHES -}; - -struct lustre_idmap_table { - spinlock_t lit_lock; - struct list_head lit_idmaps[CFS_IDMAP_N_HASHES][CFS_IDMAP_HASHSIZE]; -}; - -struct lu_ucred; - -extern void lustre_groups_from_list(struct group_info *ginfo, gid_t *glist); -extern void lustre_groups_sort(struct group_info *group_info); -extern int lustre_in_group_p(struct lu_ucred *mu, gid_t grp); - -extern int lustre_idmap_add(struct lustre_idmap_table *t, - uid_t ruid, uid_t luid, - gid_t rgid, gid_t lgid); -extern int lustre_idmap_del(struct lustre_idmap_table *t, - uid_t ruid, uid_t luid, - gid_t rgid, gid_t lgid); -extern int lustre_idmap_lookup_uid(struct lu_ucred *mu, - struct lustre_idmap_table *t, - int reverse, uid_t uid); -extern int lustre_idmap_lookup_gid(struct lu_ucred *mu, - struct lustre_idmap_table *t, - int reverse, gid_t gid); -extern struct lustre_idmap_table *lustre_idmap_init(void); -extern void lustre_idmap_fini(struct lustre_idmap_table *t); - -/** @} idmap */ - -#endif diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h index 8304a55b92f9..51f3e98f94e2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_import.h +++ b/drivers/staging/lustre/lustre/include/lustre_import.h @@ -103,9 +103,9 @@ enum lustre_imp_state { }; /** Returns test string representation of numeric import state \a state */ -static inline char * ptlrpc_import_state_name(enum lustre_imp_state state) +static inline char *ptlrpc_import_state_name(enum lustre_imp_state state) { - static char* import_state_names[] = { + static char *import_state_names[] = { "<UNKNOWN>", "CLOSED", "NEW", "DISCONN", "CONNECTING", "REPLAY", "REPLAY_LOCKS", "REPLAY_WAIT", "RECOVER", "FULL", "EVICTED", @@ -346,21 +346,24 @@ static inline unsigned int at_timeout2est(unsigned int val) return (max((val << 2) / 5, 5U) - 4); } -static inline void at_reset(struct adaptive_timeout *at, int val) { +static inline void at_reset(struct adaptive_timeout *at, int val) +{ spin_lock(&at->at_lock); at->at_current = val; at->at_worst_ever = val; at->at_worst_time = get_seconds(); spin_unlock(&at->at_lock); } -static inline void at_init(struct adaptive_timeout *at, int val, int flags) { +static inline void at_init(struct adaptive_timeout *at, int val, int flags) +{ memset(at, 0, sizeof(*at)); spin_lock_init(&at->at_lock); at->at_flags = flags; at_reset(at, val); } extern unsigned int at_min; -static inline int at_get(struct adaptive_timeout *at) { +static inline int at_get(struct adaptive_timeout *at) +{ return (at->at_current > at_min) ? at->at_current : at_min; } int at_measured(struct adaptive_timeout *at, unsigned int val); diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_intent.h b/drivers/staging/lustre/lustre/include/lustre_intent.h index c491d52d86a2..c491d52d86a2 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_intent.h +++ b/drivers/staging/lustre/lustre/include/lustre_intent.h diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index de493fabab46..12c7590e61fa 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -46,27 +46,36 @@ * @{ */ +#include <linux/sched.h> +#include <linux/signal.h> +#include <linux/types.h> #include "../../include/linux/libcfs/libcfs.h" #include "lustre/lustre_idl.h" #include "lustre_ver.h" #include "lustre_cfg.h" -#include "linux/lustre_lib.h" /* target.c */ +struct kstatfs; struct ptlrpc_request; struct obd_export; struct lu_target; struct l_wait_info; #include "lustre_ha.h" #include "lustre_net.h" -#include "lvfs.h" +#define LI_POISON 0x5a5a5a5a +#if BITS_PER_LONG > 32 +# define LL_POISON 0x5a5a5a5a5a5a5a5aL +#else +# define LL_POISON 0x5a5a5a5aL +#endif +#define LP_POISON ((void *)LL_POISON) int target_pack_pool_reply(struct ptlrpc_request *req); int do_set_info_async(struct obd_import *imp, int opcode, int version, - obd_count keylen, void *key, - obd_count vallen, void *val, + u32 keylen, void *key, + u32 vallen, void *val, struct ptlrpc_request_set *set); #define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */ @@ -133,8 +142,8 @@ struct obd_ioctl_data { struct obdo ioc_obdo1; struct obdo ioc_obdo2; - obd_size ioc_count; - obd_off ioc_offset; + u64 ioc_count; + u64 ioc_offset; __u32 ioc_dev; __u32 ioc_command; @@ -269,6 +278,8 @@ static inline void obd_ioctl_freedata(char *buf, int len) * we change _IOR to _IOWR so BSD will copyin obd_ioctl_data * for us. Does this change affect Linux? (XXX Liang) */ +#define OBD_IOC_DATA_TYPE long + #define OBD_IOC_CREATE _IOWR('f', 101, OBD_IOC_DATA_TYPE) #define OBD_IOC_DESTROY _IOW ('f', 104, OBD_IOC_DATA_TYPE) #define OBD_IOC_PREALLOCATE _IOWR('f', 105, OBD_IOC_DATA_TYPE) @@ -508,6 +519,10 @@ 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/drivers/staging/lustre/lustre/include/lustre_linkea.h b/drivers/staging/lustre/lustre/include/lustre_linkea.h deleted file mode 100644 index 500ace30cfbf..000000000000 --- a/drivers/staging/lustre/lustre/include/lustre_linkea.h +++ /dev/null @@ -1,57 +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, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 021110-1307, USA - * - * GPL HEADER END - */ -/* - * Copyright (c) 2013, Intel Corporation. - * Use is subject to license terms. - * - * Author: di wang <di.wang@intel.com> - */ - -struct linkea_data { - /** - * Buffer to keep link EA body. - */ - struct lu_buf *ld_buf; - /** - * The matched header, entry and its length in the EA - */ - struct link_ea_header *ld_leh; - struct link_ea_entry *ld_lee; - int ld_reclen; -}; - -int linkea_data_new(struct linkea_data *ldata, struct lu_buf *buf); -int linkea_init(struct linkea_data *ldata); -void linkea_entry_unpack(const struct link_ea_entry *lee, int *reclen, - struct lu_name *lname, struct lu_fid *pfid); -int linkea_add_buf(struct linkea_data *ldata, const struct lu_name *lname, - const struct lu_fid *pfid); -void linkea_del_buf(struct linkea_data *ldata, const struct lu_name *lname); -int linkea_links_find(struct linkea_data *ldata, const struct lu_name *lname, - const struct lu_fid *pfid); - -#define LINKEA_NEXT_ENTRY(ldata) \ - (struct link_ea_entry *)((char *)ldata.ld_lee + ldata.ld_reclen) - -#define LINKEA_FIRST_ENTRY(ldata) \ - (struct link_ea_entry *)(ldata.ld_leh + 1) diff --git a/drivers/staging/lustre/lustre/include/lustre_lite.h b/drivers/staging/lustre/lustre/include/lustre_lite.h index eee900638720..df557c22abbe 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lite.h +++ b/drivers/staging/lustre/lustre/include/lustre_lite.h @@ -45,7 +45,6 @@ #include "linux/lustre_lite.h" #include "obd_class.h" -#include "obd_ost.h" #include "lustre_net.h" #include "lustre_mds.h" #include "lustre_ha.h" @@ -60,7 +59,7 @@ struct lustre_rw_params { int lrp_lock_mode; ldlm_policy_data_t lrp_policy; - obd_flag lrp_brw_flags; + u32 lrp_brw_flags; int lrp_ast_flags; }; diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index d02ea24a7e40..2187fb615e9a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -56,10 +56,7 @@ * @{ */ -#include "linux/lustre_log.h" - #include "obd_class.h" -#include "obd_ost.h" #include "lustre/lustre_idl.h" #include "dt_object.h" @@ -209,15 +206,6 @@ int llog_sync(struct llog_ctxt *ctxt, struct obd_export *exp, int flags); int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, struct llog_cookie *cookies, int flags); -int obd_llog_init(struct obd_device *obd, struct obd_llog_group *olg, - struct obd_device *disk_obd, int *idx); - -int obd_llog_finish(struct obd_device *obd, int count); - -/* llog_ioctl.c */ -int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd, - struct obd_ioctl_data *data); - /* llog_net.c */ int llog_initiator_connect(struct llog_ctxt *ctxt); @@ -315,18 +303,6 @@ struct llog_handle { atomic_t lgh_refcount; }; -/* llog_lvfs.c */ -extern struct llog_operations llog_lvfs_ops; - -/* llog_osd.c */ -extern struct llog_operations llog_osd_ops; -int llog_osd_get_cat_list(const struct lu_env *env, struct dt_device *d, - int idx, int count, - struct llog_catid *idarray); -int llog_osd_put_cat_list(const struct lu_env *env, struct dt_device *d, - int idx, int count, - struct llog_catid *idarray); - #define LLOG_CTXT_FLAG_UNINITIALIZED 0x00000001 #define LLOG_CTXT_FLAG_STOP 0x00000002 @@ -461,7 +437,7 @@ static inline int llog_group_ctxt_null(struct obd_llog_group *olg, int index) static inline int llog_ctxt_null(struct obd_device *obd, int index) { - return (llog_group_ctxt_null(&obd->obd_olg, index)); + return llog_group_ctxt_null(&obd->obd_olg, index); } static inline int llog_destroy(const struct lu_env *env, diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h b/drivers/staging/lustre/lustre/include/lustre_mdc.h index 39bbc3634b06..b1b05c8a371a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mdc.h +++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h @@ -50,7 +50,7 @@ #include <linux/fs.h> #include <linux/dcache.h> -#include "linux/lustre_intent.h" +#include "lustre_intent.h" #include "lustre_handles.h" #include "../../include/linux/libcfs/libcfs.h" #include "obd_class.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index d6af2ca3acdb..0a024d3cfeb7 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -55,8 +55,6 @@ * @{ */ -#include "linux/lustre_net.h" - #include "../../include/linux/libcfs/libcfs.h" // #include <obd.h> #include "../../include/linux/lnet/lnet.h" @@ -1183,276 +1181,6 @@ struct nrs_fifo_req { /** @} fifo */ /** - * \name CRR-N - * - * CRR-N, Client Round Robin over NIDs - * @{ - */ - -/** - * private data structure for CRR-N NRS - */ -struct nrs_crrn_net { - struct ptlrpc_nrs_resource cn_res; - cfs_binheap_t *cn_binheap; - struct cfs_hash *cn_cli_hash; - /** - * Used when a new scheduling round commences, in order to synchronize - * all clients with the new round number. - */ - __u64 cn_round; - /** - * Determines the relevant ordering amongst request batches within a - * scheduling round. - */ - __u64 cn_sequence; - /** - * Round Robin quantum; the maximum number of RPCs that each request - * batch for each client can have in a scheduling round. - */ - __u16 cn_quantum; -}; - -/** - * Object representing a client in CRR-N, as identified by its NID - */ -struct nrs_crrn_client { - struct ptlrpc_nrs_resource cc_res; - struct hlist_node cc_hnode; - lnet_nid_t cc_nid; - /** - * The round number against which this client is currently scheduling - * requests. - */ - __u64 cc_round; - /** - * The sequence number used for requests scheduled by this client during - * the current round number. - */ - __u64 cc_sequence; - atomic_t cc_ref; - /** - * Round Robin quantum; the maximum number of RPCs the client is allowed - * to schedule in a single batch of each round. - */ - __u16 cc_quantum; - /** - * # of pending requests for this client, on all existing rounds - */ - __u16 cc_active; -}; - -/** - * CRR-N NRS request definition - */ -struct nrs_crrn_req { - /** - * Round number for this request; shared with all other requests in the - * same batch. - */ - __u64 cr_round; - /** - * Sequence number for this request; shared with all other requests in - * the same batch. - */ - __u64 cr_sequence; -}; - -/** - * CRR-N policy operations. - */ -enum nrs_ctl_crr { - /** - * Read the RR quantum size of a CRR-N policy. - */ - NRS_CTL_CRRN_RD_QUANTUM = PTLRPC_NRS_CTL_1ST_POL_SPEC, - /** - * Write the RR quantum size of a CRR-N policy. - */ - NRS_CTL_CRRN_WR_QUANTUM, -}; - -/** @} CRR-N */ - -/** - * \name ORR/TRR - * - * ORR/TRR (Object-based Round Robin/Target-based Round Robin) NRS policies - * @{ - */ - -/** - * Lower and upper byte offsets of a brw RPC - */ -struct nrs_orr_req_range { - __u64 or_start; - __u64 or_end; -}; - -/** - * RPC types supported by the ORR/TRR policies - */ -enum nrs_orr_supp { - NOS_OST_READ = (1 << 0), - NOS_OST_WRITE = (1 << 1), - NOS_OST_RW = (NOS_OST_READ | NOS_OST_WRITE), - /** - * Default value for policies. - */ - NOS_DFLT = NOS_OST_READ -}; - -/** - * As unique keys for grouping RPCs together, we use the object's OST FID for - * the ORR policy, and the OST index for the TRR policy. - * - * XXX: We waste some space for TRR policy instances by using a union, but it - * allows to consolidate some of the code between ORR and TRR, and these - * policies will probably eventually merge into one anyway. - */ -struct nrs_orr_key { - union { - /** object FID for ORR */ - struct lu_fid ok_fid; - /** OST index for TRR */ - __u32 ok_idx; - }; -}; - -/** - * The largest base string for unique hash/slab object names is - * "nrs_orr_reg_", so 13 characters. We add 3 to this to be used for the CPT - * id number, so this _should_ be more than enough for the maximum number of - * CPTs on any system. If it does happen that this statement is incorrect, - * nrs_orr_genobjname() will inevitably yield a non-unique name and cause - * kmem_cache_create() to complain (on Linux), so the erroneous situation - * will hopefully not go unnoticed. - */ -#define NRS_ORR_OBJ_NAME_MAX (sizeof("nrs_orr_reg_") + 3) - -/** - * private data structure for ORR and TRR NRS - */ -struct nrs_orr_data { - struct ptlrpc_nrs_resource od_res; - cfs_binheap_t *od_binheap; - struct cfs_hash *od_obj_hash; - struct kmem_cache *od_cache; - /** - * Used when a new scheduling round commences, in order to synchronize - * all object or OST batches with the new round number. - */ - __u64 od_round; - /** - * Determines the relevant ordering amongst request batches within a - * scheduling round. - */ - __u64 od_sequence; - /** - * RPC types that are currently supported. - */ - enum nrs_orr_supp od_supp; - /** - * Round Robin quantum; the maximum number of RPCs that each request - * batch for each object or OST can have in a scheduling round. - */ - __u16 od_quantum; - /** - * Whether to use physical disk offsets or logical file offsets. - */ - bool od_physical; - /** - * XXX: We need to provide a persistently allocated string to hold - * unique object names for this policy, since in currently supported - * versions of Linux by Lustre, kmem_cache_create() just sets a pointer - * to the name string provided. kstrdup() is used in the version of - * kmeme_cache_create() in current Linux mainline, so we may be able to - * remove this in the future. - */ - char od_objname[NRS_ORR_OBJ_NAME_MAX]; -}; - -/** - * Represents a backend-fs object or OST in the ORR and TRR policies - * respectively - */ -struct nrs_orr_object { - struct ptlrpc_nrs_resource oo_res; - struct hlist_node oo_hnode; - /** - * The round number against which requests are being scheduled for this - * object or OST - */ - __u64 oo_round; - /** - * The sequence number used for requests scheduled for this object or - * OST during the current round number. - */ - __u64 oo_sequence; - /** - * The key of the object or OST for which this structure instance is - * scheduling RPCs - */ - struct nrs_orr_key oo_key; - atomic_t oo_ref; - /** - * Round Robin quantum; the maximum number of RPCs that are allowed to - * be scheduled for the object or OST in a single batch of each round. - */ - __u16 oo_quantum; - /** - * # of pending requests for this object or OST, on all existing rounds - */ - __u16 oo_active; -}; - -/** - * ORR/TRR NRS request definition - */ -struct nrs_orr_req { - /** - * The offset range this request covers - */ - struct nrs_orr_req_range or_range; - /** - * Round number for this request; shared with all other requests in the - * same batch. - */ - __u64 or_round; - /** - * Sequence number for this request; shared with all other requests in - * the same batch. - */ - __u64 or_sequence; - /** - * For debugging purposes. - */ - struct nrs_orr_key or_key; - /** - * An ORR policy instance has filled in request information while - * enqueueing the request on the service partition's regular NRS head. - */ - unsigned int or_orr_set:1; - /** - * A TRR policy instance has filled in request information while - * enqueueing the request on the service partition's regular NRS head. - */ - unsigned int or_trr_set:1; - /** - * Request offset ranges have been filled in with logical offset - * values. - */ - unsigned int or_logical_set:1; - /** - * Request offset ranges have been filled in with physical offset - * values. - */ - unsigned int or_physical_set:1; -}; - -/** @} ORR/TRR */ - -/** * NRS request * * Instances of this object exist embedded within ptlrpc_request; the main @@ -1476,7 +1204,6 @@ struct ptlrpc_nrs_request { unsigned nr_enqueued:1; unsigned nr_started:1; unsigned nr_finalized:1; - cfs_binheap_node_t nr_node; /** * Policy-specific fields, used for determining a request's scheduling @@ -1487,12 +1214,6 @@ struct ptlrpc_nrs_request { * Fields for the FIFO policy */ struct nrs_fifo_req fifo; - /** - * CRR-N request definition - */ - struct nrs_crrn_req crr; - /** ORR and TRR share the same request definition */ - struct nrs_orr_req orr; } nr_u; /** * Externally-registering policies may want to use this to allocate @@ -1966,7 +1687,7 @@ do { \ ((libcfs_debug & (mask)) != 0 && \ (libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) \ _debug_req((req), msgdata, fmt, ##a); \ -} while(0) +} while (0) /** * This is the debug print function you need to use to print request structure @@ -2912,11 +2633,13 @@ __u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18); # warning "remove checksum compatibility support for b1_8" __u32 lustre_msg_calc_cksum(struct lustre_msg *msg); #endif -void lustre_msg_set_handle(struct lustre_msg *msg,struct lustre_handle *handle); +void lustre_msg_set_handle(struct lustre_msg *msg, + struct lustre_handle *handle); void lustre_msg_set_type(struct lustre_msg *msg, __u32 type); void lustre_msg_set_opc(struct lustre_msg *msg, __u32 opc); void lustre_msg_set_last_xid(struct lustre_msg *msg, __u64 last_xid); -void lustre_msg_set_last_committed(struct lustre_msg *msg,__u64 last_committed); +void lustre_msg_set_last_committed(struct lustre_msg *msg, + __u64 last_committed); void lustre_msg_set_versions(struct lustre_msg *msg, __u64 *versions); void lustre_msg_set_transno(struct lustre_msg *msg, __u64 transno); void lustre_msg_set_status(struct lustre_msg *msg, __u32 status); @@ -3173,7 +2896,7 @@ int ptlrpc_add_timeout_client(int time, enum timeout_event event, struct list_head *obd_list); int ptlrpc_del_timeout_client(struct list_head *obd_list, enum timeout_event event); -struct ptlrpc_request * ptlrpc_prep_ping(struct obd_import *imp); +struct ptlrpc_request *ptlrpc_prep_ping(struct obd_import *imp); int ptlrpc_obd_ping(struct obd_device *obd); void ping_evictor_start(void); void ping_evictor_stop(void); diff --git a/drivers/staging/lustre/lustre/include/lustre_quota.h b/drivers/staging/lustre/lustre/include/lustre_quota.h index 1ae72e3ff1bf..2643f28070a2 100644 --- a/drivers/staging/lustre/lustre/include/lustre_quota.h +++ b/drivers/staging/lustre/lustre/include/lustre_quota.h @@ -32,7 +32,9 @@ * */ -#include "linux/lustre_quota.h" +#include <linux/fs.h> +#include <linux/quota.h> +#include <linux/quotaops.h> #include "dt_object.h" #include "lustre_fid.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h index dc31bf93a1d7..dff70a5b9bc4 100644 --- a/drivers/staging/lustre/lustre/include/lustre_sec.h +++ b/drivers/staging/lustre/lustre/include/lustre_sec.h @@ -347,9 +347,6 @@ void sptlrpc_conf_log_stop(const char *logname); void sptlrpc_conf_log_update_begin(const char *logname); void sptlrpc_conf_log_update_end(const char *logname); void sptlrpc_conf_client_adapt(struct obd_device *obd); -int sptlrpc_conf_target_get_rules(struct obd_device *obd, - struct sptlrpc_rule_set *rset, - int initial); void sptlrpc_target_choose_flavor(struct sptlrpc_rule_set *rset, enum lustre_sec_part from, lnet_nid_t nid, @@ -885,7 +882,7 @@ enum sptlrpc_bulk_hash_alg { BULK_HASH_ALG_MAX }; -const char * sptlrpc_get_hash_name(__u8 hash_alg); +const char *sptlrpc_get_hash_name(__u8 hash_alg); __u8 sptlrpc_get_hash_alg(const char *algname); enum { @@ -1060,7 +1057,7 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec); void sptlrpc_gc_add_ctx(struct ptlrpc_cli_ctx *ctx); /* misc */ -const char * sec2target_str(struct ptlrpc_sec *sec); +const char *sec2target_str(struct ptlrpc_sec *sec); /* * lprocfs */ diff --git a/drivers/staging/lustre/lustre/include/lustre_ver.h b/drivers/staging/lustre/lustre/include/lustre_ver.h index dc187b8f741f..caa4da12f37a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_ver.h +++ b/drivers/staging/lustre/lustre/include/lustre_ver.h @@ -10,7 +10,9 @@ #define LUSTRE_FIX 0 #define LUSTRE_VERSION_STRING "2.3.64" -#define LUSTRE_VERSION_CODE OBD_OCD_VERSION(LUSTRE_MAJOR,LUSTRE_MINOR,LUSTRE_PATCH,LUSTRE_FIX) +#define LUSTRE_VERSION_CODE OBD_OCD_VERSION(LUSTRE_MAJOR, \ + LUSTRE_MINOR, LUSTRE_PATCH, \ + LUSTRE_FIX) /* liblustre clients are only allowed to connect if their LUSTRE_FIX mismatches * by this amount (set in lustre/autoconf/lustre-version.ac). */ diff --git a/drivers/staging/lustre/lustre/include/lvfs.h b/drivers/staging/lustre/lustre/include/lvfs.h deleted file mode 100644 index 32dcd57c47cc..000000000000 --- a/drivers/staging/lustre/lustre/include/lvfs.h +++ /dev/null @@ -1,57 +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) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/lvfs.h - * - * lustre VFS/process permission interface - */ - -#ifndef __LVFS_H__ -#define __LVFS_H__ - -#define LL_FID_NAMELEN (16 + 1 + 8 + 1) - -#include "../../include/linux/libcfs/libcfs.h" -#include "linux/lvfs.h" - -#include "../../include/linux/libcfs/lucache.h" - - -/* lvfs_common.c */ -struct dentry *lvfs_fid2dentry(struct lvfs_run_ctxt *, __u64, __u32, __u64 ,void *data); - -void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx, - struct lvfs_ucred *cred); -void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx, - struct lvfs_ucred *cred); -#endif diff --git a/drivers/staging/lustre/lustre/include/md_object.h b/drivers/staging/lustre/lustre/include/md_object.h deleted file mode 100644 index 2e5d55030a63..000000000000 --- a/drivers/staging/lustre/lustre/include/md_object.h +++ /dev/null @@ -1,903 +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) 2007, 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/md_object.h - * - * Extension of lu_object.h for metadata objects - */ - -#ifndef _LUSTRE_MD_OBJECT_H -#define _LUSTRE_MD_OBJECT_H - -/** \defgroup md md - * Sub-class of lu_object with methods common for "meta-data" objects in MDT - * stack. - * - * Meta-data objects implement namespace operations: you can link, unlink - * them, and treat them as directories. - * - * Examples: mdt, cmm, and mdt are implementations of md interface. - * @{ - */ - - -/* - * super-class definitions. - */ -#include "dt_object.h" - -struct md_device; -struct md_device_operations; -struct md_object; -struct obd_export; - -enum { - UCRED_INVALID = -1, - UCRED_INIT = 0, - UCRED_OLD = 1, - UCRED_NEW = 2 -}; - -enum { - MD_CAPAINFO_MAX = 5 -}; - -/** there are at most 5 fids in one operation, see rename, NOTE the last one - * is a temporary one used for is_subdir() */ -struct md_capainfo { - __u32 mc_auth; - __u32 mc_padding; - struct lu_fid mc_fid[MD_CAPAINFO_MAX]; - struct lustre_capa *mc_capa[MD_CAPAINFO_MAX]; -}; - -struct md_quota { - struct obd_export *mq_exp; -}; - -/** - * Implemented in mdd/mdd_handler.c. - * - * XXX should be moved into separate .h/.c together with all md security - * related definitions. - */ -struct md_capainfo *md_capainfo(const struct lu_env *env); -struct md_quota *md_quota(const struct lu_env *env); - -/** metadata attributes */ -enum ma_valid { - MA_INODE = (1 << 0), - MA_LOV = (1 << 1), - MA_COOKIE = (1 << 2), - MA_FLAGS = (1 << 3), - MA_LMV = (1 << 4), - MA_ACL_DEF = (1 << 5), - MA_LOV_DEF = (1 << 6), - MA_LAY_GEN = (1 << 7), - MA_HSM = (1 << 8), - MA_SOM = (1 << 9), - MA_PFID = (1 << 10) -}; - -typedef enum { - MDL_MINMODE = 0, - MDL_EX = 1, - MDL_PW = 2, - MDL_PR = 4, - MDL_CW = 8, - MDL_CR = 16, - MDL_NL = 32, - MDL_GROUP = 64, - MDL_MAXMODE -} mdl_mode_t; - -typedef enum { - MDT_NUL_LOCK = 0, - MDT_REG_LOCK = (1 << 0), - MDT_PDO_LOCK = (1 << 1) -} mdl_type_t; - -/* memory structure for hsm attributes - * for fields description see the on disk structure hsm_attrs - * which is defined in lustre_idl.h - */ -struct md_hsm { - __u32 mh_compat; - __u32 mh_flags; - __u64 mh_arch_id; - __u64 mh_arch_ver; -}; - -#define IOEPOCH_INVAL 0 - -/* memory structure for som attributes - * for fields description see the on disk structure som_attrs - * which is defined in lustre_idl.h - */ -struct md_som_data { - __u32 msd_compat; - __u32 msd_incompat; - __u64 msd_ioepoch; - __u64 msd_size; - __u64 msd_blocks; - __u64 msd_mountid; -}; - -struct md_attr { - __u64 ma_valid; - __u64 ma_need; - __u64 ma_attr_flags; - struct lu_attr ma_attr; - struct lu_fid ma_pfid; - struct md_hsm ma_hsm; - struct lov_mds_md *ma_lmm; - struct lmv_stripe_md *ma_lmv; - void *ma_acl; - struct llog_cookie *ma_cookie; - struct lustre_capa *ma_capa; - struct md_som_data *ma_som; - int ma_lmm_size; - int ma_lmv_size; - int ma_acl_size; - int ma_cookie_size; - __u16 ma_layout_gen; -}; - -/** Additional parameters for create */ -struct md_op_spec { - union { - /** symlink target */ - const char *sp_symname; - /** parent FID for cross-ref mkdir */ - const struct lu_fid *sp_pfid; - /** eadata for regular files */ - struct md_spec_reg { - /** lov objs exist already */ - const struct lu_fid *fid; - const void *eadata; - int eadatalen; - } sp_ea; - } u; - - /** Create flag from client: such as MDS_OPEN_CREAT, and others. */ - __u64 sp_cr_flags; - - /** don't create lov objects or llog cookie - this replay */ - unsigned int no_create:1, - sp_cr_lookup:1, /* do lookup sanity check or not. */ - sp_rm_entry:1; /* only remove name entry */ - - /** Current lock mode for parent dir where create is performing. */ - mdl_mode_t sp_cr_mode; - - /** to create directory */ - const struct dt_index_features *sp_feat; -}; - -/** - * Operations implemented for each md object (both directory and leaf). - */ -struct md_object_operations { - int (*moo_permission)(const struct lu_env *env, - struct md_object *pobj, struct md_object *cobj, - struct md_attr *attr, int mask); - - int (*moo_attr_get)(const struct lu_env *env, struct md_object *obj, - struct md_attr *attr); - - int (*moo_attr_set)(const struct lu_env *env, struct md_object *obj, - const struct md_attr *attr); - - int (*moo_xattr_get)(const struct lu_env *env, struct md_object *obj, - struct lu_buf *buf, const char *name); - - int (*moo_xattr_list)(const struct lu_env *env, struct md_object *obj, - struct lu_buf *buf); - - int (*moo_xattr_set)(const struct lu_env *env, struct md_object *obj, - const struct lu_buf *buf, const char *name, - int fl); - - int (*moo_xattr_del)(const struct lu_env *env, struct md_object *obj, - const char *name); - - /** This method is used to swap the layouts between 2 objects */ - int (*moo_swap_layouts)(const struct lu_env *env, - struct md_object *obj1, struct md_object *obj2, - __u64 flags); - - /** \retval number of bytes actually read upon success */ - int (*moo_readpage)(const struct lu_env *env, struct md_object *obj, - const struct lu_rdpg *rdpg); - - int (*moo_readlink)(const struct lu_env *env, struct md_object *obj, - struct lu_buf *buf); - int (*moo_changelog)(const struct lu_env *env, - enum changelog_rec_type type, int flags, - struct md_object *obj); - /** part of cross-ref operation */ - int (*moo_object_create)(const struct lu_env *env, - struct md_object *obj, - const struct md_op_spec *spec, - struct md_attr *ma); - - int (*moo_ref_add)(const struct lu_env *env, - struct md_object *obj, - const struct md_attr *ma); - - int (*moo_ref_del)(const struct lu_env *env, - struct md_object *obj, - struct md_attr *ma); - - int (*moo_open)(const struct lu_env *env, - struct md_object *obj, int flag); - - int (*moo_close)(const struct lu_env *env, struct md_object *obj, - struct md_attr *ma, int mode); - - int (*moo_capa_get)(const struct lu_env *, struct md_object *, - struct lustre_capa *, int renewal); - - int (*moo_object_sync)(const struct lu_env *, struct md_object *); - - int (*moo_file_lock)(const struct lu_env *env, struct md_object *obj, - struct lov_mds_md *lmm, struct ldlm_extent *extent, - struct lustre_handle *lockh); - int (*moo_file_unlock)(const struct lu_env *env, struct md_object *obj, - struct lov_mds_md *lmm, - struct lustre_handle *lockh); - int (*moo_object_lock)(const struct lu_env *env, struct md_object *obj, - struct lustre_handle *lh, - struct ldlm_enqueue_info *einfo, - void *policy); -}; - -/** - * Operations implemented for each directory object. - */ -struct md_dir_operations { - int (*mdo_is_subdir) (const struct lu_env *env, struct md_object *obj, - const struct lu_fid *fid, struct lu_fid *sfid); - - int (*mdo_lookup)(const struct lu_env *env, struct md_object *obj, - const struct lu_name *lname, struct lu_fid *fid, - struct md_op_spec *spec); - - mdl_mode_t (*mdo_lock_mode)(const struct lu_env *env, - struct md_object *obj, - mdl_mode_t mode); - - int (*mdo_create)(const struct lu_env *env, struct md_object *pobj, - const struct lu_name *lname, struct md_object *child, - struct md_op_spec *spec, - struct md_attr *ma); - - /** This method is used for creating data object for this meta object*/ - int (*mdo_create_data)(const struct lu_env *env, struct md_object *p, - struct md_object *o, - const struct md_op_spec *spec, - struct md_attr *ma); - - int (*mdo_rename)(const struct lu_env *env, struct md_object *spobj, - struct md_object *tpobj, const struct lu_fid *lf, - const struct lu_name *lsname, struct md_object *tobj, - const struct lu_name *ltname, struct md_attr *ma); - - int (*mdo_link)(const struct lu_env *env, struct md_object *tgt_obj, - struct md_object *src_obj, const struct lu_name *lname, - struct md_attr *ma); - - int (*mdo_unlink)(const struct lu_env *env, struct md_object *pobj, - struct md_object *cobj, const struct lu_name *lname, - struct md_attr *ma, int no_name); - - /** This method is used to compare a requested layout to an existing - * layout (struct lov_mds_md_v1/3 vs struct lov_mds_md_v1/3) */ - int (*mdo_lum_lmm_cmp)(const struct lu_env *env, - struct md_object *cobj, - const struct md_op_spec *spec, - struct md_attr *ma); - - /** partial ops for cross-ref case */ - int (*mdo_name_insert)(const struct lu_env *env, - struct md_object *obj, - const struct lu_name *lname, - const struct lu_fid *fid, - const struct md_attr *ma); - - int (*mdo_name_remove)(const struct lu_env *env, - struct md_object *obj, - const struct lu_name *lname, - const struct md_attr *ma); - - int (*mdo_rename_tgt)(const struct lu_env *env, struct md_object *pobj, - struct md_object *tobj, const struct lu_fid *fid, - const struct lu_name *lname, struct md_attr *ma); -}; - -struct md_device_operations { - /** meta-data device related handlers. */ - int (*mdo_root_get)(const struct lu_env *env, struct md_device *m, - struct lu_fid *f); - - int (*mdo_maxeasize_get)(const struct lu_env *env, struct md_device *m, - int *easize); - - int (*mdo_statfs)(const struct lu_env *env, struct md_device *m, - struct obd_statfs *sfs); - - int (*mdo_init_capa_ctxt)(const struct lu_env *env, struct md_device *m, - int mode, unsigned long timeout, __u32 alg, - struct lustre_capa_key *keys); - - int (*mdo_update_capa_key)(const struct lu_env *env, - struct md_device *m, - struct lustre_capa_key *key); - - int (*mdo_llog_ctxt_get)(const struct lu_env *env, - struct md_device *m, int idx, void **h); - - int (*mdo_iocontrol)(const struct lu_env *env, struct md_device *m, - unsigned int cmd, int len, void *data); -}; - -enum md_upcall_event { - /** Sync the md layer*/ - MD_LOV_SYNC = (1 << 0), - /** Just for split, no need trans, for replay */ - MD_NO_TRANS = (1 << 1), - MD_LOV_CONFIG = (1 << 2), - /** Trigger quota recovery */ - MD_LOV_QUOTA = (1 << 3) -}; - -struct md_upcall { - /** this lock protects upcall using against its removal - * read lock is for usage the upcall, write - for init/fini */ - struct rw_semaphore mu_upcall_sem; - /** device to call, upper layer normally */ - struct md_device *mu_upcall_dev; - /** upcall function */ - int (*mu_upcall)(const struct lu_env *env, struct md_device *md, - enum md_upcall_event ev, void *data); -}; - -struct md_device { - struct lu_device md_lu_dev; - const struct md_device_operations *md_ops; - struct md_upcall md_upcall; -}; - -static inline void md_upcall_init(struct md_device *m, void *upcl) -{ - init_rwsem(&m->md_upcall.mu_upcall_sem); - m->md_upcall.mu_upcall_dev = NULL; - m->md_upcall.mu_upcall = upcl; -} - -static inline void md_upcall_dev_set(struct md_device *m, struct md_device *up) -{ - down_write(&m->md_upcall.mu_upcall_sem); - m->md_upcall.mu_upcall_dev = up; - up_write(&m->md_upcall.mu_upcall_sem); -} - -static inline void md_upcall_fini(struct md_device *m) -{ - down_write(&m->md_upcall.mu_upcall_sem); - m->md_upcall.mu_upcall_dev = NULL; - m->md_upcall.mu_upcall = NULL; - up_write(&m->md_upcall.mu_upcall_sem); -} - -static inline int md_do_upcall(const struct lu_env *env, struct md_device *m, - enum md_upcall_event ev, void *data) -{ - int rc = 0; - down_read(&m->md_upcall.mu_upcall_sem); - if (m->md_upcall.mu_upcall_dev != NULL && - m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall != NULL) { - rc = m->md_upcall.mu_upcall_dev->md_upcall.mu_upcall(env, - m->md_upcall.mu_upcall_dev, - ev, data); - } - up_read(&m->md_upcall.mu_upcall_sem); - return rc; -} - -struct md_object { - struct lu_object mo_lu; - const struct md_object_operations *mo_ops; - const struct md_dir_operations *mo_dir_ops; -}; - -/** - * seq-server site. - */ -struct seq_server_site { - struct lu_site *ss_lu; - /** - * mds number of this site. - */ - mdsno_t ss_node_id; - /** - * Fid location database - */ - struct lu_server_fld *ss_server_fld; - struct lu_client_fld *ss_client_fld; - - /** - * Server Seq Manager - */ - struct lu_server_seq *ss_server_seq; - - /** - * Controller Seq Manager - */ - struct lu_server_seq *ss_control_seq; - struct obd_export *ss_control_exp; - - /** - * Client Seq Manager - */ - struct lu_client_seq *ss_client_seq; -}; - -static inline struct md_device *lu2md_dev(const struct lu_device *d) -{ - LASSERT(IS_ERR(d) || lu_device_is_md(d)); - return container_of0(d, struct md_device, md_lu_dev); -} - -static inline struct lu_device *md2lu_dev(struct md_device *d) -{ - return &d->md_lu_dev; -} - -static inline struct md_object *lu2md(const struct lu_object *o) -{ - LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->lo_dev)); - return container_of0(o, struct md_object, mo_lu); -} - -static inline struct md_object *md_object_next(const struct md_object *obj) -{ - return (obj ? lu2md(lu_object_next(&obj->mo_lu)) : NULL); -} - -static inline struct md_device *md_obj2dev(const struct md_object *o) -{ - LASSERT(o == NULL || IS_ERR(o) || lu_device_is_md(o->mo_lu.lo_dev)); - return container_of0(o->mo_lu.lo_dev, struct md_device, md_lu_dev); -} - -static inline int md_device_init(struct md_device *md, struct lu_device_type *t) -{ - return lu_device_init(&md->md_lu_dev, t); -} - -static inline void md_device_fini(struct md_device *md) -{ - lu_device_fini(&md->md_lu_dev); -} - -static inline struct md_object *md_object_find_slice(const struct lu_env *env, - struct md_device *md, - const struct lu_fid *f) -{ - return lu2md(lu_object_find_slice(env, md2lu_dev(md), f, NULL)); -} - - -/** md operations */ -static inline int mo_permission(const struct lu_env *env, - struct md_object *p, - struct md_object *c, - struct md_attr *at, - int mask) -{ - LASSERT(c->mo_ops->moo_permission); - return c->mo_ops->moo_permission(env, p, c, at, mask); -} - -static inline int mo_attr_get(const struct lu_env *env, - struct md_object *m, - struct md_attr *at) -{ - LASSERT(m->mo_ops->moo_attr_get); - return m->mo_ops->moo_attr_get(env, m, at); -} - -static inline int mo_readlink(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf) -{ - LASSERT(m->mo_ops->moo_readlink); - return m->mo_ops->moo_readlink(env, m, buf); -} - -static inline int mo_changelog(const struct lu_env *env, - enum changelog_rec_type type, - int flags, struct md_object *m) -{ - LASSERT(m->mo_ops->moo_changelog); - return m->mo_ops->moo_changelog(env, type, flags, m); -} - -static inline int mo_attr_set(const struct lu_env *env, - struct md_object *m, - const struct md_attr *at) -{ - LASSERT(m->mo_ops->moo_attr_set); - return m->mo_ops->moo_attr_set(env, m, at); -} - -static inline int mo_xattr_get(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf, - const char *name) -{ - LASSERT(m->mo_ops->moo_xattr_get); - return m->mo_ops->moo_xattr_get(env, m, buf, name); -} - -static inline int mo_xattr_del(const struct lu_env *env, - struct md_object *m, - const char *name) -{ - LASSERT(m->mo_ops->moo_xattr_del); - return m->mo_ops->moo_xattr_del(env, m, name); -} - -static inline int mo_xattr_set(const struct lu_env *env, - struct md_object *m, - const struct lu_buf *buf, - const char *name, - int flags) -{ - LASSERT(m->mo_ops->moo_xattr_set); - return m->mo_ops->moo_xattr_set(env, m, buf, name, flags); -} - -static inline int mo_xattr_list(const struct lu_env *env, - struct md_object *m, - struct lu_buf *buf) -{ - LASSERT(m->mo_ops->moo_xattr_list); - return m->mo_ops->moo_xattr_list(env, m, buf); -} - -static inline int mo_swap_layouts(const struct lu_env *env, - struct md_object *o1, - struct md_object *o2, __u64 flags) -{ - LASSERT(o1->mo_ops->moo_swap_layouts); - LASSERT(o2->mo_ops->moo_swap_layouts); - if (o1->mo_ops->moo_swap_layouts != o2->mo_ops->moo_swap_layouts) - return -EPERM; - return o1->mo_ops->moo_swap_layouts(env, o1, o2, flags); -} - -static inline int mo_open(const struct lu_env *env, - struct md_object *m, - int flags) -{ - LASSERT(m->mo_ops->moo_open); - return m->mo_ops->moo_open(env, m, flags); -} - -static inline int mo_close(const struct lu_env *env, - struct md_object *m, - struct md_attr *ma, - int mode) -{ - LASSERT(m->mo_ops->moo_close); - return m->mo_ops->moo_close(env, m, ma, mode); -} - -static inline int mo_readpage(const struct lu_env *env, - struct md_object *m, - const struct lu_rdpg *rdpg) -{ - LASSERT(m->mo_ops->moo_readpage); - return m->mo_ops->moo_readpage(env, m, rdpg); -} - -static inline int mo_object_create(const struct lu_env *env, - struct md_object *m, - const struct md_op_spec *spc, - struct md_attr *at) -{ - LASSERT(m->mo_ops->moo_object_create); - return m->mo_ops->moo_object_create(env, m, spc, at); -} - -static inline int mo_ref_add(const struct lu_env *env, - struct md_object *m, - const struct md_attr *ma) -{ - LASSERT(m->mo_ops->moo_ref_add); - return m->mo_ops->moo_ref_add(env, m, ma); -} - -static inline int mo_ref_del(const struct lu_env *env, - struct md_object *m, - struct md_attr *ma) -{ - LASSERT(m->mo_ops->moo_ref_del); - return m->mo_ops->moo_ref_del(env, m, ma); -} - -static inline int mo_capa_get(const struct lu_env *env, - struct md_object *m, - struct lustre_capa *c, - int renewal) -{ - LASSERT(m->mo_ops->moo_capa_get); - return m->mo_ops->moo_capa_get(env, m, c, renewal); -} - -static inline int mo_object_sync(const struct lu_env *env, struct md_object *m) -{ - LASSERT(m->mo_ops->moo_object_sync); - return m->mo_ops->moo_object_sync(env, m); -} - -static inline int mo_file_lock(const struct lu_env *env, struct md_object *m, - struct lov_mds_md *lmm, - struct ldlm_extent *extent, - struct lustre_handle *lockh) -{ - LASSERT(m->mo_ops->moo_file_lock); - return m->mo_ops->moo_file_lock(env, m, lmm, extent, lockh); -} - -static inline int mo_file_unlock(const struct lu_env *env, struct md_object *m, - struct lov_mds_md *lmm, - struct lustre_handle *lockh) -{ - LASSERT(m->mo_ops->moo_file_unlock); - return m->mo_ops->moo_file_unlock(env, m, lmm, lockh); -} - -static inline int mo_object_lock(const struct lu_env *env, - struct md_object *m, - struct lustre_handle *lh, - struct ldlm_enqueue_info *einfo, - void *policy) -{ - LASSERT(m->mo_ops->moo_object_lock); - return m->mo_ops->moo_object_lock(env, m, lh, einfo, policy); -} - -static inline int mdo_lookup(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lname, - struct lu_fid *f, - struct md_op_spec *spec) -{ - LASSERT(p->mo_dir_ops->mdo_lookup); - return p->mo_dir_ops->mdo_lookup(env, p, lname, f, spec); -} - -static inline mdl_mode_t mdo_lock_mode(const struct lu_env *env, - struct md_object *mo, - mdl_mode_t lm) -{ - if (mo->mo_dir_ops->mdo_lock_mode == NULL) - return MDL_MINMODE; - return mo->mo_dir_ops->mdo_lock_mode(env, mo, lm); -} - -static inline int mdo_create(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lchild_name, - struct md_object *c, - struct md_op_spec *spc, - struct md_attr *at) -{ - LASSERT(p->mo_dir_ops->mdo_create); - return p->mo_dir_ops->mdo_create(env, p, lchild_name, c, spc, at); -} - -static inline int mdo_create_data(const struct lu_env *env, - struct md_object *p, - struct md_object *c, - const struct md_op_spec *spec, - struct md_attr *ma) -{ - LASSERT(c->mo_dir_ops->mdo_create_data); - return c->mo_dir_ops->mdo_create_data(env, p, c, spec, ma); -} - -static inline int mdo_rename(const struct lu_env *env, - struct md_object *sp, - struct md_object *tp, - const struct lu_fid *lf, - const struct lu_name *lsname, - struct md_object *t, - const struct lu_name *ltname, - struct md_attr *ma) -{ - LASSERT(tp->mo_dir_ops->mdo_rename); - return tp->mo_dir_ops->mdo_rename(env, sp, tp, lf, lsname, t, ltname, - ma); -} - -static inline int mdo_is_subdir(const struct lu_env *env, - struct md_object *mo, - const struct lu_fid *fid, - struct lu_fid *sfid) -{ - LASSERT(mo->mo_dir_ops->mdo_is_subdir); - return mo->mo_dir_ops->mdo_is_subdir(env, mo, fid, sfid); -} - -static inline int mdo_link(const struct lu_env *env, - struct md_object *p, - struct md_object *s, - const struct lu_name *lname, - struct md_attr *ma) -{ - LASSERT(s->mo_dir_ops->mdo_link); - return s->mo_dir_ops->mdo_link(env, p, s, lname, ma); -} - -static inline int mdo_unlink(const struct lu_env *env, - struct md_object *p, - struct md_object *c, - const struct lu_name *lname, - struct md_attr *ma, int no_name) -{ - LASSERT(p->mo_dir_ops->mdo_unlink); - return p->mo_dir_ops->mdo_unlink(env, p, c, lname, ma, no_name); -} - -static inline int mdo_lum_lmm_cmp(const struct lu_env *env, - struct md_object *c, - const struct md_op_spec *spec, - struct md_attr *ma) -{ - LASSERT(c->mo_dir_ops->mdo_lum_lmm_cmp); - return c->mo_dir_ops->mdo_lum_lmm_cmp(env, c, spec, ma); -} - -static inline int mdo_name_insert(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lname, - const struct lu_fid *f, - const struct md_attr *ma) -{ - LASSERT(p->mo_dir_ops->mdo_name_insert); - return p->mo_dir_ops->mdo_name_insert(env, p, lname, f, ma); -} - -static inline int mdo_name_remove(const struct lu_env *env, - struct md_object *p, - const struct lu_name *lname, - const struct md_attr *ma) -{ - LASSERT(p->mo_dir_ops->mdo_name_remove); - return p->mo_dir_ops->mdo_name_remove(env, p, lname, ma); -} - -static inline int mdo_rename_tgt(const struct lu_env *env, - struct md_object *p, - struct md_object *t, - const struct lu_fid *lf, - const struct lu_name *lname, - struct md_attr *ma) -{ - if (t) { - LASSERT(t->mo_dir_ops->mdo_rename_tgt); - return t->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, lname, ma); - } else { - LASSERT(p->mo_dir_ops->mdo_rename_tgt); - return p->mo_dir_ops->mdo_rename_tgt(env, p, t, lf, lname, ma); - } -} - -/** - * Used in MDD/OUT layer for object lock rule - **/ -enum mdd_object_role { - MOR_SRC_PARENT, - MOR_SRC_CHILD, - MOR_TGT_PARENT, - MOR_TGT_CHILD, - MOR_TGT_ORPHAN -}; - -struct dt_device; -/** - * Structure to hold object information. This is used to create object - * \pre llod_dir exist - */ -struct lu_local_obj_desc { - const char *llod_dir; - const char *llod_name; - __u32 llod_oid; - int llod_is_index; - const struct dt_index_features *llod_feat; - struct list_head llod_linkage; -}; - -int lustre_buf2som(void *buf, int rc, struct md_som_data *msd); -int lustre_buf2hsm(void *buf, int rc, struct md_hsm *mh); -void lustre_hsm2buf(void *buf, struct md_hsm *mh); - -struct lu_ucred { - __u32 uc_valid; - __u32 uc_o_uid; - __u32 uc_o_gid; - __u32 uc_o_fsuid; - __u32 uc_o_fsgid; - __u32 uc_uid; - __u32 uc_gid; - __u32 uc_fsuid; - __u32 uc_fsgid; - __u32 uc_suppgids[2]; - cfs_cap_t uc_cap; - __u32 uc_umask; - struct group_info *uc_ginfo; - struct md_identity *uc_identity; -}; - -struct lu_ucred *lu_ucred(const struct lu_env *env); - -struct lu_ucred *lu_ucred_check(const struct lu_env *env); - -struct lu_ucred *lu_ucred_assert(const struct lu_env *env); - -int lu_ucred_global_init(void); - -void lu_ucred_global_fini(void); - -#define md_cap_t(x) (x) - -#define MD_CAP_TO_MASK(x) (1 << (x)) - -#define md_cap_raised(c, flag) (md_cap_t(c) & MD_CAP_TO_MASK(flag)) - -/* capable() is copied from linux kernel! */ -static inline int md_capable(struct lu_ucred *uc, cfs_cap_t cap) -{ - if (md_cap_raised(uc->uc_cap, cap)) - return 1; - return 0; -} - -/** @} md */ -#endif /* _LINUX_MD_OBJECT_H */ diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 489bdd399627..2a88b806fca5 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -212,7 +212,7 @@ static inline int lov_lum_swab_if_needed(struct lov_user_md_v3 *lumv3, int *lmm_magic, struct lov_user_md *lum) { - if (lum && copy_from_user(lumv3, lum,sizeof(struct lov_user_md_v1))) + if (lum && copy_from_user(lumv3, lum, sizeof(struct lov_user_md_v1))) return -EFAULT; *lmm_magic = lumv3->lmm_magic; @@ -252,10 +252,10 @@ struct obd_type { }; struct brw_page { - obd_off off; + u64 off; struct page *pg; int count; - obd_flag flag; + u32 flag; }; /* llog contexts */ @@ -336,10 +336,10 @@ struct client_obd { * grant before trying to dirty a page and unreserve the rest. * See osc_{reserve|unreserve}_grant for details. */ long cl_reserved_grant; - struct list_head cl_cache_waiters; /* waiting for cache/grant */ - unsigned long cl_next_shrink_grant; /* jiffies */ - struct list_head cl_grant_shrink_list; /* Timeout event list */ - int cl_grant_shrink_interval; /* seconds */ + struct list_head cl_cache_waiters; /* waiting for cache/grant */ + unsigned long cl_next_shrink_grant; /* jiffies */ + struct list_head cl_grant_shrink_list; /* Timeout event list */ + int cl_grant_shrink_interval; /* seconds */ /* A chunk is an optimal size used by osc_extent to determine * the extent size. A chunk is max(PAGE_CACHE_SIZE, OST block size) */ @@ -389,12 +389,12 @@ struct client_obd { /* lru for osc caching pages */ struct cl_client_cache *cl_cache; - struct list_head cl_lru_osc; /* member of cl_cache->ccc_lru */ + struct list_head cl_lru_osc; /* member of cl_cache->ccc_lru */ atomic_t *cl_lru_left; atomic_t cl_lru_busy; atomic_t cl_lru_shrinkers; atomic_t cl_lru_in_list; - struct list_head cl_lru_list; /* lru page list */ + struct list_head cl_lru_list; /* lru page list */ client_obd_lock_t cl_lru_list_lock; /* page list protector */ /* number of in flight destroy rpcs is limited to max_rpcs_in_flight */ @@ -442,7 +442,7 @@ struct client_obd { struct obd_id_info { __u32 idx; - obd_id *data; + u64 *data; }; struct echo_client_obd { @@ -500,9 +500,9 @@ struct lov_statfs_data { }; /* Stripe placement optimization */ struct lov_qos { - struct list_head lq_oss_list; /* list of OSSs that targets use */ + struct list_head lq_oss_list; /* list of OSSs that targets use */ struct rw_semaphore lq_rw_sem; - __u32 lq_active_oss_count; + __u32 lq_active_oss_count; unsigned int lq_prio_free; /* priority for free space */ unsigned int lq_threshold_rr;/* priority for rr */ struct lov_qos_rr lq_rr; /* round robin qos data */ @@ -545,8 +545,8 @@ struct pool_desc { struct hlist_node pool_hash; /* access by poolname */ struct list_head pool_list; /* serial access */ struct proc_dir_entry *pool_proc_entry; /* file in /proc */ - struct obd_device *pool_lobd; /* obd of the lov/lod to which - * this pool belongs */ + struct obd_device *pool_lobd; /* obd of the lov/lod to which + * this pool belongs */ }; struct lov_obd { @@ -564,7 +564,7 @@ struct lov_obd { int lov_connects; int lov_pool_count; struct cfs_hash *lov_pools_hash_body; /* used for key access */ - struct list_head lov_pool_list; /* used for sequential access */ + struct list_head lov_pool_list; /* used for sequential access */ struct proc_dir_entry *lov_pool_proc_entry; enum lustre_sec_part lov_sp_me; @@ -589,13 +589,11 @@ enum placement_policy { PLACEMENT_MAX_POLICY }; -typedef enum placement_policy placement_policy_t; - struct lmv_obd { int refcount; struct lu_client_fld lmv_fld; spinlock_t lmv_lock; - placement_policy_t lmv_placement; + enum placement_policy lmv_placement; struct lmv_desc desc; struct obd_uuid cluuid; struct obd_export *exp; @@ -660,35 +658,6 @@ struct niobuf_local { #define LUSTRE_MGS_OBDNAME "MGS" #define LUSTRE_MGC_OBDNAME "MGC" -static inline int is_osp_on_mdt(char *name) -{ - char *ptr; - - ptr = strrchr(name, '-'); - if (ptr == NULL) { - CERROR("%s is not a obdname\n", name); - return 0; - } - - /* 1.8 OSC/OSP name on MDT is fsname-OSTxxxx-osc */ - if (strncmp(ptr + 1, "osc", 3) == 0) - return 1; - - if (strncmp(ptr + 1, "MDT", 3) != 0) - return 0; - - while (*(--ptr) != '-' && ptr != name); - - if (ptr == name) - return 0; - - if (strncmp(ptr + 1, LUSTRE_OSP_NAME, strlen(LUSTRE_OSP_NAME)) != 0 && - strncmp(ptr + 1, LUSTRE_OSC_NAME, strlen(LUSTRE_OSC_NAME)) != 0) - return 0; - - return 1; -} - /* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */ #define N_LOCAL_TEMP_PAGE 0x10000000 @@ -708,7 +677,7 @@ struct obd_trans_info { unsigned long oti_sync_write:1; /* initial thread handling transaction */ - struct ptlrpc_thread * oti_thread; + struct ptlrpc_thread *oti_thread; __u32 oti_conn_cnt; /** VBR: versions */ __u64 oti_pre_version; @@ -733,6 +702,7 @@ static inline void oti_init(struct obd_trans_info *oti, if (req->rq_reqmsg != NULL && lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) { __u64 *pre_version = lustre_msg_get_versions(req->rq_reqmsg); + oti->oti_pre_version = pre_version ? pre_version[0] : 0; oti->oti_transno = lustre_msg_get_transno(req->rq_reqmsg); } @@ -745,7 +715,8 @@ static inline void oti_init(struct obd_trans_info *oti, oti->oti_conn_cnt = lustre_msg_get_conn_cnt(req->rq_reqmsg); } -static inline void oti_alloc_cookies(struct obd_trans_info *oti,int num_cookies) +static inline void oti_alloc_cookies(struct obd_trans_info *oti, + int num_cookies) { if (!oti) return; @@ -829,6 +800,10 @@ struct obd_llog_group { #define OBD_DEVICE_MAGIC 0XAB5CD6EF #define OBD_DEV_BY_DEVNAME 0xffffd0de +struct lvfs_run_ctxt { + struct dt_device *dt; +}; + struct obd_device { struct obd_type *obd_type; __u32 obd_magic; @@ -882,7 +857,6 @@ struct obd_device { spinlock_t obd_dev_lock; /* protect OBD bitfield above */ struct mutex obd_dev_mutex; __u64 obd_last_committed; - struct fsfilt_operations *obd_fsops; spinlock_t obd_osfs_lock; struct obd_statfs obd_osfs; /* locked by obd_osfs_lock */ __u64 obd_osfs_age; @@ -908,9 +882,9 @@ struct obd_device { int obd_requests_queued_for_recovery; wait_queue_head_t obd_next_transno_waitq; /* protected by obd_recovery_task_lock */ - struct timer_list obd_recovery_timer; - time_t obd_recovery_start; /* seconds */ - time_t obd_recovery_end; /* seconds, for lprocfs_status */ + struct timer_list obd_recovery_timer; + time_t obd_recovery_start; /* seconds */ + time_t obd_recovery_end; /* seconds, for lprocfs_status */ int obd_recovery_time_hard; int obd_recovery_timeout; int obd_recovery_ir_factor; @@ -946,7 +920,7 @@ struct obd_device { struct lprocfs_stats *obd_svc_stats; atomic_t obd_evict_inprogress; wait_queue_head_t obd_evict_inprogress_waitq; - struct list_head obd_evict_list; /* protected with pet_lock */ + struct list_head obd_evict_list; /* protected with pet_lock */ /** * Ldlm pool part. Save last calculated SLV and Limit. @@ -1057,9 +1031,9 @@ struct md_op_data { struct lu_fid op_fid2; /* operation fid2 (usually child) */ struct lu_fid op_fid3; /* 2 extra fids to find conflicting */ struct lu_fid op_fid4; /* to the operation locks. */ - mdsno_t op_mds; /* what mds server open will go to */ + u32 op_mds; /* what mds server open will go to */ struct lustre_handle op_handle; - obd_time op_mod_time; + s64 op_mod_time; const char *op_name; int op_namelen; __u32 op_mode; @@ -1113,16 +1087,14 @@ enum op_cli_flags { struct md_enqueue_info; /* metadata stat-ahead */ -typedef int (* md_enqueue_cb_t)(struct ptlrpc_request *req, - struct md_enqueue_info *minfo, - int rc); struct md_enqueue_info { struct md_op_data mi_data; struct lookup_intent mi_it; struct lustre_handle mi_lockh; struct inode *mi_dir; - md_enqueue_cb_t mi_cb; + int (*mi_cb)(struct ptlrpc_request *req, + struct md_enqueue_info *minfo, int rc); __u64 mi_cbdata; unsigned int mi_generation; }; @@ -1138,14 +1110,13 @@ struct obd_ops { __u32 keylen, void *key, __u32 vallen, void *val, struct ptlrpc_request_set *set); - int (*o_attach)(struct obd_device *dev, obd_count len, void *data); + int (*o_attach)(struct obd_device *dev, u32 len, void *data); int (*o_detach)(struct obd_device *dev); - int (*o_setup) (struct obd_device *dev, struct lustre_cfg *cfg); + int (*o_setup)(struct obd_device *dev, struct lustre_cfg *cfg); int (*o_precleanup)(struct obd_device *dev, enum obd_cleanup_stage cleanup_stage); int (*o_cleanup)(struct obd_device *dev); - int (*o_process_config)(struct obd_device *dev, obd_count len, - void *data); + int (*o_process_config)(struct obd_device *dev, u32 len, void *data); int (*o_postrecov)(struct obd_device *dev); int (*o_add_conn)(struct obd_import *imp, struct obd_uuid *uuid, int priority); @@ -1184,18 +1155,14 @@ struct obd_ops { __u64 max_age, struct ptlrpc_request_set *set); int (*o_packmd)(struct obd_export *exp, struct lov_mds_md **disk_tgt, struct lov_stripe_md *mem_src); - int (*o_unpackmd)(struct obd_export *exp,struct lov_stripe_md **mem_tgt, + int (*o_unpackmd)(struct obd_export *exp, + struct lov_stripe_md **mem_tgt, struct lov_mds_md *disk_src, int disk_len); - int (*o_preallocate)(struct lustre_handle *, obd_count *req, - obd_id *ids); + int (*o_preallocate)(struct lustre_handle *, u32 *req, u64 *ids); /* FIXME: add fid capability support for create & destroy! */ - int (*o_precreate)(struct obd_export *exp); int (*o_create)(const struct lu_env *env, struct obd_export *exp, struct obdo *oa, struct lov_stripe_md **ea, struct obd_trans_info *oti); - int (*o_create_async)(struct obd_export *exp, struct obd_info *oinfo, - struct lov_stripe_md **ea, - struct obd_trans_info *oti); int (*o_destroy)(const struct lu_env *env, struct obd_export *exp, struct obdo *oa, struct lov_stripe_md *ea, struct obd_trans_info *oti, struct obd_export *md_exp, @@ -1209,28 +1176,8 @@ struct obd_ops { struct obd_info *oinfo); int (*o_getattr_async)(struct obd_export *exp, struct obd_info *oinfo, struct ptlrpc_request_set *set); - int (*o_brw)(int rw, struct obd_export *exp, struct obd_info *oinfo, - obd_count oa_bufs, struct brw_page *pgarr, - struct obd_trans_info *oti); - int (*o_merge_lvb)(struct obd_export *exp, struct lov_stripe_md *lsm, - struct ost_lvb *lvb, int kms_only); int (*o_adjust_kms)(struct obd_export *exp, struct lov_stripe_md *lsm, - obd_off size, int shrink); - int (*o_punch)(const struct lu_env *, struct obd_export *exp, - struct obd_info *oinfo, struct obd_trans_info *oti, - struct ptlrpc_request_set *rqset); - int (*o_sync)(const struct lu_env *env, struct obd_export *exp, - struct obd_info *oinfo, obd_size start, obd_size end, - struct ptlrpc_request_set *set); - int (*o_migrate)(struct lustre_handle *conn, struct lov_stripe_md *dst, - struct lov_stripe_md *src, obd_size start, - obd_size end, struct obd_trans_info *oti); - int (*o_copy)(struct lustre_handle *dstconn, struct lov_stripe_md *dst, - struct lustre_handle *srconn, struct lov_stripe_md *src, - obd_size start, obd_size end, struct obd_trans_info *); - int (*o_iterate)(struct lustre_handle *conn, - int (*)(obd_id, obd_seq, void *), - obd_id *startid, obd_seq seq, void *data); + u64 size, int shrink); int (*o_preprw)(const struct lu_env *env, int cmd, struct obd_export *exp, struct obdo *oa, int objcount, struct obd_ioobj *obj, struct niobuf_remote *remote, @@ -1242,33 +1189,12 @@ struct obd_ops { struct niobuf_remote *remote, int pages, struct niobuf_local *local, struct obd_trans_info *oti, int rc); - int (*o_enqueue)(struct obd_export *, struct obd_info *oinfo, - struct ldlm_enqueue_info *einfo, - struct ptlrpc_request_set *rqset); - int (*o_change_cbdata)(struct obd_export *, struct lov_stripe_md *, - ldlm_iterator_t it, void *data); int (*o_find_cbdata)(struct obd_export *, struct lov_stripe_md *, ldlm_iterator_t it, void *data); - int (*o_cancel)(struct obd_export *, struct lov_stripe_md *md, - __u32 mode, struct lustre_handle *); - int (*o_cancel_unused)(struct obd_export *, struct lov_stripe_md *, - ldlm_cancel_flags_t flags, void *opaque); int (*o_init_export)(struct obd_export *exp); int (*o_destroy_export)(struct obd_export *exp); - int (*o_extent_calc)(struct obd_export *, struct lov_stripe_md *, - int cmd, obd_off *); - - /* llog related obd_methods */ - int (*o_llog_init)(struct obd_device *obd, struct obd_llog_group *grp, - struct obd_device *disk_obd, int *idx); - int (*o_llog_finish)(struct obd_device *obd, int count); - int (*o_llog_connect)(struct obd_export *, struct llogd_conn_body *); /* metadata-only methods */ - int (*o_pin)(struct obd_export *, const struct lu_fid *fid, - struct obd_capa *, struct obd_client_handle *, int flag); - int (*o_unpin)(struct obd_export *, struct obd_client_handle *, int); - int (*o_import_event)(struct obd_device *, struct obd_import *, enum obd_import_event); @@ -1276,7 +1202,7 @@ struct obd_ops { enum obd_notify_event ev, void *data); int (*o_health_check)(const struct lu_env *env, struct obd_device *); - struct obd_uuid *(*o_get_uuid) (struct obd_export *exp); + struct obd_uuid *(*o_get_uuid)(struct obd_export *exp); /* quota methods */ int (*o_quotacheck)(struct obd_device *, struct obd_export *, @@ -1284,8 +1210,6 @@ struct obd_ops { int (*o_quotactl)(struct obd_device *, struct obd_export *, struct obd_quotactl *); - int (*o_ping)(const struct lu_env *, struct obd_export *exp); - /* pools methods */ int (*o_pool_new)(struct obd_device *obd, char *poolname); int (*o_pool_del)(struct obd_device *obd, char *poolname); @@ -1385,12 +1309,12 @@ struct md_ops { struct ptlrpc_request **); int (*m_setxattr)(struct obd_export *, const struct lu_fid *, - struct obd_capa *, obd_valid, const char *, + struct obd_capa *, u64, const char *, const char *, int, int, int, __u32, struct ptlrpc_request **); int (*m_getxattr)(struct obd_export *, const struct lu_fid *, - struct obd_capa *, obd_valid, const char *, + struct obd_capa *, u64, const char *, const char *, int, int, int, struct ptlrpc_request **); @@ -1444,13 +1368,13 @@ struct lsm_operations { void (*lsm_free)(struct lov_stripe_md *); int (*lsm_destroy)(struct lov_stripe_md *, struct obdo *oa, struct obd_export *md_exp); - void (*lsm_stripe_by_index)(struct lov_stripe_md *, int *, obd_off *, - obd_off *); - void (*lsm_stripe_by_offset)(struct lov_stripe_md *, int *, obd_off *, - obd_off *); - int (*lsm_lmm_verify) (struct lov_mds_md *lmm, int lmm_bytes, + void (*lsm_stripe_by_index)(struct lov_stripe_md *, int *, u64 *, + u64 *); + void (*lsm_stripe_by_offset)(struct lov_stripe_md *, int *, u64 *, + u64 *); + int (*lsm_lmm_verify)(struct lov_mds_md *lmm, int lmm_bytes, __u16 *stripe_count); - int (*lsm_unpackmd) (struct lov_obd *lov, struct lov_stripe_md *lsm, + int (*lsm_unpackmd)(struct lov_obd *lov, struct lov_stripe_md *lsm, struct lov_mds_md *lmm); }; @@ -1458,7 +1382,7 @@ extern const struct lsm_operations lsm_v1_ops; extern const struct lsm_operations lsm_v3_ops; static inline const struct lsm_operations *lsm_op_find(int magic) { - switch(magic) { + switch (magic) { case LOV_MAGIC_V1: return &lsm_v1_ops; case LOV_MAGIC_V3: @@ -1481,6 +1405,7 @@ static inline struct lustre_capa *oinfo_capa(struct obd_info *oinfo) static inline struct md_open_data *obd_mod_alloc(void) { struct md_open_data *mod; + OBD_ALLOC_PTR(mod); if (mod == NULL) return NULL; @@ -1498,7 +1423,7 @@ static inline struct md_open_data *obd_mod_alloc(void) } \ }) -void obdo_from_inode(struct obdo *dst, struct inode *src, obd_flag valid); +void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid); void obdo_set_parent_fid(struct obdo *dst, const struct lu_fid *parent); /* return 1 if client should be resend request */ diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index 662a78062963..3a63462aa943 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -64,10 +64,10 @@ static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type) * because that is supported by all clients since 1.8 * * In case multiple algorithms are supported the best one is used. */ -static inline obd_flag cksum_type_pack(cksum_type_t cksum_type) +static inline u32 cksum_type_pack(cksum_type_t cksum_type) { unsigned int performance = 0, tmp; - obd_flag flag = OBD_FL_CKSUM_ADLER; + u32 flag = OBD_FL_CKSUM_ADLER; if (cksum_type & OBD_CKSUM_CRC32) { tmp = cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)); @@ -98,7 +98,7 @@ static inline obd_flag cksum_type_pack(cksum_type_t cksum_type) return flag; } -static inline cksum_type_t cksum_type_unpack(obd_flag o_flags) +static inline cksum_type_t cksum_type_unpack(u32 o_flags) { switch (o_flags & OBD_FL_CKSUM_ALL) { case OBD_FL_CKSUM_CRC32C: diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 1d401c9e5e8c..882e40bd584c 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -45,8 +45,6 @@ #include "lustre/lustre_idl.h" #include "lprocfs_status.h" -#include "linux/obd_class.h" - #define OBD_STATFS_NODELAY 0x0001 /* requests should be send without delay * and resends for avoid deadlocks */ #define OBD_STATFS_FROM_CACHE 0x0002 /* the statfs callback should not update @@ -88,12 +86,12 @@ struct obd_device *class_name2obd(const char *name); int class_uuid2dev(struct obd_uuid *uuid); struct obd_device *class_uuid2obd(struct obd_uuid *uuid); void class_obd_list(void); -struct obd_device * class_find_client_obd(struct obd_uuid *tgt_uuid, - const char * typ_name, +struct obd_device *class_find_client_obd(struct obd_uuid *tgt_uuid, + const char *typ_name, struct obd_uuid *grp_uuid); -struct obd_device * class_devices_in_group(struct obd_uuid *grp_uuid, +struct obd_device *class_devices_in_group(struct obd_uuid *grp_uuid, int *next); -struct obd_device * class_num2obd(int num); +struct obd_device *class_num2obd(int num); int get_devices_count(void); int class_notify_sptlrpc_conf(const char *fsname, int namelen); @@ -110,7 +108,7 @@ void obd_zombie_impexp_cull(void); void obd_zombie_barrier(void); void obd_exports_barrier(struct obd_device *obd); int kuc_len(int payload_len); -struct kuc_hdr * kuc_ptr(void *p); +struct kuc_hdr *kuc_ptr(void *p); int kuc_ispayload(void *p); void *kuc_alloc(int payload_len, int transport, int type); void kuc_free(void *p, int payload_len); @@ -207,7 +205,7 @@ struct lustre_profile { char *lp_md; }; -struct lustre_profile *class_get_profile(const char * prof); +struct lustre_profile *class_get_profile(const char *prof); void class_del_profile(const char *prof); void class_del_profiles(void); @@ -219,8 +217,8 @@ extern void (*class_export_dump_hook)(struct obd_export *); #else -#define __class_export_add_lock_ref(exp, lock) do {} while(0) -#define __class_export_del_lock_ref(exp, lock) do {} while(0) +#define __class_export_add_lock_ref(exp, lock) do {} while (0) +#define __class_export_del_lock_ref(exp, lock) do {} while (0) #endif @@ -307,13 +305,20 @@ static inline enum obd_option exp_flags_from_obd(struct obd_device *obd) 0); } +struct inode; +struct lu_attr; +struct obdo; +void obdo_from_la(struct obdo *dst, struct lu_attr *la, __u64 valid); +void la_from_obdo(struct lu_attr *la, struct obdo *dst, u32 valid); +void obdo_refresh_inode(struct inode *dst, struct obdo *src, u32 valid); +void obdo_to_inode(struct inode *dst, struct obdo *src, u32 valid); -void obdo_cpy_md(struct obdo *dst, struct obdo *src, obd_flag valid); +void obdo_cpy_md(struct obdo *dst, struct obdo *src, u32 valid); void obdo_to_ioobj(struct obdo *oa, struct obd_ioobj *ioobj); void obdo_from_iattr(struct obdo *oa, struct iattr *attr, unsigned int ia_valid); -void iattr_from_obdo(struct iattr *attr, struct obdo *oa, obd_flag valid); -void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, obd_flag valid); +void iattr_from_obdo(struct iattr *attr, struct obdo *oa, u32 valid); +void md_from_obdo(struct md_op_data *op_data, struct obdo *oa, u32 valid); void obdo_from_md(struct obdo *oa, struct md_op_data *op_data, unsigned int valid); @@ -510,8 +515,8 @@ static inline int obd_get_info(const struct lu_env *env, } static inline int obd_set_info_async(const struct lu_env *env, - struct obd_export *exp, obd_count keylen, - void *key, obd_count vallen, void *val, + struct obd_export *exp, u32 keylen, + void *key, u32 vallen, void *val, struct ptlrpc_request_set *set) { int rc; @@ -771,31 +776,6 @@ static inline int obd_free_memmd(struct obd_export *exp, return rc; } -static inline int obd_precreate(struct obd_export *exp) -{ - int rc; - - EXP_CHECK_DT_OP(exp, precreate); - OBD_COUNTER_INCREMENT(exp->exp_obd, precreate); - - rc = OBP(exp->exp_obd, precreate)(exp); - return rc; -} - -static inline int obd_create_async(struct obd_export *exp, - struct obd_info *oinfo, - struct lov_stripe_md **ea, - struct obd_trans_info *oti) -{ - int rc; - - EXP_CHECK_DT_OP(exp, create_async); - EXP_COUNTER_INCREMENT(exp, create_async); - - rc = OBP(exp->exp_obd, create_async)(exp, oinfo, ea, oti); - return rc; -} - static inline int obd_create(const struct lu_env *env, struct obd_export *exp, struct obdo *obdo, struct lov_stripe_md **ea, struct obd_trans_info *oti) @@ -943,7 +923,7 @@ static inline struct obd_uuid *obd_get_uuid(struct obd_export *exp) * by obd are returned. */ static inline int obd_connect(const struct lu_env *env, - struct obd_export **exp,struct obd_device *obd, + struct obd_export **exp, struct obd_device *obd, struct obd_uuid *cluuid, struct obd_connect_data *data, void *localdata) @@ -1032,17 +1012,6 @@ static inline int obd_fid_alloc(struct obd_export *exp, return rc; } -static inline int obd_ping(const struct lu_env *env, struct obd_export *exp) -{ - int rc; - - OBD_CHECK_DT_OP(exp->exp_obd, ping, 0); - EXP_COUNTER_INCREMENT(exp, ping); - - rc = OBP(exp->exp_obd, ping)(env, exp); - return rc; -} - static inline int obd_pool_new(struct obd_device *obd, char *poolname) { int rc; @@ -1121,27 +1090,6 @@ static inline int obd_destroy_export(struct obd_export *exp) return 0; } -static inline int obd_extent_calc(struct obd_export *exp, - struct lov_stripe_md *md, - int cmd, obd_off *offset) -{ - int rc; - - EXP_CHECK_DT_OP(exp, extent_calc); - rc = OBP(exp->exp_obd, extent_calc)(exp, md, cmd, offset); - return rc; -} - -static inline struct dentry * -obd_lvfs_fid2dentry(struct obd_export *exp, struct ost_id *oi, __u32 gen) -{ - struct lvfs_run_ctxt *ctxt = &exp->exp_obd->obd_lvfs_ctxt; - LASSERT(exp->exp_obd); - - return ctxt->cb_ops.l_fid2dentry(ostid_id(oi), gen, ostid_seq(oi), - exp->exp_obd); -} - /* @max_age is the oldest time in jiffies that we accept using a cached data. * If the cache is older than @max_age we will get a new value from the * target. Use a value of "cfs_time_current() + HZ" to guarantee freshness. */ @@ -1165,7 +1113,8 @@ static inline int obd_statfs_async(struct obd_export *exp, if (cfs_time_before_64(obd->obd_osfs_age, max_age)) { rc = OBP(obd, statfs_async)(exp, oinfo, max_age, rqset); } else { - CDEBUG(D_SUPER,"%s: use %p cache blocks %llu/%llu objects %llu/%llu\n", + CDEBUG(D_SUPER, + "%s: use %p cache blocks %llu/%llu objects %llu/%llu\n", obd->obd_name, &obd->obd_osfs, obd->obd_osfs.os_bavail, obd->obd_osfs.os_blocks, obd->obd_osfs.os_ffree, obd->obd_osfs.os_files); @@ -1238,92 +1187,6 @@ static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp, return rc; } -static inline int obd_sync_rqset(struct obd_export *exp, struct obd_info *oinfo, - obd_size start, obd_size end) -{ - struct ptlrpc_request_set *set = NULL; - int rc; - - OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP); - EXP_COUNTER_INCREMENT(exp, sync); - - set = ptlrpc_prep_set(); - if (set == NULL) - return -ENOMEM; - - rc = OBP(exp->exp_obd, sync)(NULL, exp, oinfo, start, end, set); - if (rc == 0) - rc = ptlrpc_set_wait(set); - ptlrpc_set_destroy(set); - return rc; -} - -static inline int obd_sync(const struct lu_env *env, struct obd_export *exp, - struct obd_info *oinfo, obd_size start, obd_size end, - struct ptlrpc_request_set *set) -{ - int rc; - - OBD_CHECK_DT_OP(exp->exp_obd, sync, -EOPNOTSUPP); - EXP_COUNTER_INCREMENT(exp, sync); - - rc = OBP(exp->exp_obd, sync)(env, exp, oinfo, start, end, set); - return rc; -} - -static inline int obd_punch_rqset(struct obd_export *exp, - struct obd_info *oinfo, - struct obd_trans_info *oti) -{ - struct ptlrpc_request_set *set = NULL; - int rc; - - EXP_CHECK_DT_OP(exp, punch); - EXP_COUNTER_INCREMENT(exp, punch); - - set = ptlrpc_prep_set(); - if (set == NULL) - return -ENOMEM; - - rc = OBP(exp->exp_obd, punch)(NULL, exp, oinfo, oti, set); - if (rc == 0) - rc = ptlrpc_set_wait(set); - ptlrpc_set_destroy(set); - return rc; -} - -static inline int obd_punch(const struct lu_env *env, struct obd_export *exp, - struct obd_info *oinfo, struct obd_trans_info *oti, - struct ptlrpc_request_set *rqset) -{ - int rc; - - EXP_CHECK_DT_OP(exp, punch); - EXP_COUNTER_INCREMENT(exp, punch); - - rc = OBP(exp->exp_obd, punch)(env, exp, oinfo, oti, rqset); - return rc; -} - -static inline int obd_brw(int cmd, struct obd_export *exp, - struct obd_info *oinfo, obd_count oa_bufs, - struct brw_page *pg, struct obd_trans_info *oti) -{ - int rc; - - EXP_CHECK_DT_OP(exp, brw); - EXP_COUNTER_INCREMENT(exp, brw); - - if (!(cmd & (OBD_BRW_RWMASK | OBD_BRW_CHECK))) { - CERROR("obd_brw: cmd must be OBD_BRW_READ, OBD_BRW_WRITE, " - "or OBD_BRW_CHECK\n"); - LBUG(); - } - - rc = OBP(exp->exp_obd, brw)(cmd, exp, oinfo, oa_bufs, pg, oti); - return rc; -} - static inline int obd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp, struct obdo *oa, int objcount, struct obd_ioobj *obj, @@ -1357,21 +1220,8 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd, return rc; } -static inline int obd_merge_lvb(struct obd_export *exp, - struct lov_stripe_md *lsm, - struct ost_lvb *lvb, int kms_only) -{ - int rc; - - EXP_CHECK_DT_OP(exp, merge_lvb); - EXP_COUNTER_INCREMENT(exp, merge_lvb); - - rc = OBP(exp->exp_obd, merge_lvb)(exp, lsm, lvb, kms_only); - return rc; -} - static inline int obd_adjust_kms(struct obd_export *exp, - struct lov_stripe_md *lsm, obd_off size, + struct lov_stripe_md *lsm, u64 size, int shrink) { int rc; @@ -1395,54 +1245,6 @@ static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp, return rc; } -static inline int obd_enqueue_rqset(struct obd_export *exp, - struct obd_info *oinfo, - struct ldlm_enqueue_info *einfo) -{ - struct ptlrpc_request_set *set = NULL; - int rc; - - EXP_CHECK_DT_OP(exp, enqueue); - EXP_COUNTER_INCREMENT(exp, enqueue); - - set = ptlrpc_prep_set(); - if (set == NULL) - return -ENOMEM; - - rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set); - if (rc == 0) - rc = ptlrpc_set_wait(set); - ptlrpc_set_destroy(set); - return rc; -} - -static inline int obd_enqueue(struct obd_export *exp, - struct obd_info *oinfo, - struct ldlm_enqueue_info *einfo, - struct ptlrpc_request_set *set) -{ - int rc; - - EXP_CHECK_DT_OP(exp, enqueue); - EXP_COUNTER_INCREMENT(exp, enqueue); - - rc = OBP(exp->exp_obd, enqueue)(exp, oinfo, einfo, set); - return rc; -} - -static inline int obd_change_cbdata(struct obd_export *exp, - struct lov_stripe_md *lsm, - ldlm_iterator_t it, void *data) -{ - int rc; - - EXP_CHECK_DT_OP(exp, change_cbdata); - EXP_COUNTER_INCREMENT(exp, change_cbdata); - - rc = OBP(exp->exp_obd, change_cbdata)(exp, lsm, it, data); - return rc; -} - static inline int obd_find_cbdata(struct obd_export *exp, struct lov_stripe_md *lsm, ldlm_iterator_t it, void *data) @@ -1456,59 +1258,6 @@ static inline int obd_find_cbdata(struct obd_export *exp, return rc; } -static inline int obd_cancel(struct obd_export *exp, - struct lov_stripe_md *ea, __u32 mode, - struct lustre_handle *lockh) -{ - int rc; - - EXP_CHECK_DT_OP(exp, cancel); - EXP_COUNTER_INCREMENT(exp, cancel); - - rc = OBP(exp->exp_obd, cancel)(exp, ea, mode, lockh); - return rc; -} - -static inline int obd_cancel_unused(struct obd_export *exp, - struct lov_stripe_md *ea, - ldlm_cancel_flags_t flags, - void *opaque) -{ - int rc; - - EXP_CHECK_DT_OP(exp, cancel_unused); - EXP_COUNTER_INCREMENT(exp, cancel_unused); - - rc = OBP(exp->exp_obd, cancel_unused)(exp, ea, flags, opaque); - return rc; -} - -static inline int obd_pin(struct obd_export *exp, const struct lu_fid *fid, - struct obd_capa *oc, struct obd_client_handle *handle, - int flag) -{ - int rc; - - EXP_CHECK_DT_OP(exp, pin); - EXP_COUNTER_INCREMENT(exp, pin); - - rc = OBP(exp->exp_obd, pin)(exp, fid, oc, handle, flag); - return rc; -} - -static inline int obd_unpin(struct obd_export *exp, - struct obd_client_handle *handle, int flag) -{ - int rc; - - EXP_CHECK_DT_OP(exp, unpin); - EXP_COUNTER_INCREMENT(exp, unpin); - - rc = OBP(exp->exp_obd, unpin)(exp, handle, flag); - return rc; -} - - static inline void obd_import_event(struct obd_device *obd, struct obd_import *imp, enum obd_import_event event) @@ -1523,19 +1272,6 @@ static inline void obd_import_event(struct obd_device *obd, } } -static inline int obd_llog_connect(struct obd_export *exp, - struct llogd_conn_body *body) -{ - int rc; - - OBD_CHECK_DT_OP(exp->exp_obd, llog_connect, 0); - EXP_COUNTER_INCREMENT(exp, llog_connect); - - rc = OBP(exp->exp_obd, llog_connect)(exp, body); - return rc; -} - - static inline int obd_notify(struct obd_device *obd, struct obd_device *watched, enum obd_notify_event ev, @@ -1655,25 +1391,6 @@ static inline int obd_register_observer(struct obd_device *obd, return 0; } -static inline int obd_pin_observer(struct obd_device *obd, - struct obd_device **observer) -{ - down_read(&obd->obd_observer_link_sem); - if (!obd->obd_observer) { - *observer = NULL; - up_read(&obd->obd_observer_link_sem); - return -ENOENT; - } - *observer = obd->obd_observer; - return 0; -} - -static inline int obd_unpin_observer(struct obd_device *obd) -{ - up_read(&obd->obd_observer_link_sem); - return 0; -} - #if 0 static inline int obd_register_page_removal_cb(struct obd_export *exp, obd_page_removal_cb_t cb, @@ -1962,7 +1679,7 @@ static inline int md_free_lustre_md(struct obd_export *exp, static inline int md_setxattr(struct obd_export *exp, const struct lu_fid *fid, struct obd_capa *oc, - obd_valid valid, const char *name, + u64 valid, const char *name, const char *input, int input_size, int output_size, int flags, __u32 suppgid, struct ptlrpc_request **request) @@ -1976,7 +1693,7 @@ static inline int md_setxattr(struct obd_export *exp, static inline int md_getxattr(struct obd_export *exp, const struct lu_fid *fid, struct obd_capa *oc, - obd_valid valid, const char *name, + u64 valid, const char *name, const char *input, int input_size, int output_size, int flags, struct ptlrpc_request **request) @@ -2124,12 +1841,12 @@ extern struct kmem_cache *obdo_cachep; #define OBDO_ALLOC(ptr) \ do { \ OBD_SLAB_ALLOC_PTR_GFP((ptr), obdo_cachep, GFP_NOFS); \ -} while(0) +} while (0) #define OBDO_FREE(ptr) \ do { \ OBD_SLAB_FREE_PTR((ptr), obdo_cachep); \ -} while(0) +} while (0) static inline void obdo2fid(struct obdo *oa, struct lu_fid *fid) @@ -2176,10 +1893,6 @@ int class_check_uuid(struct obd_uuid *uuid, __u64 nid); void class_init_uuidlist(void); void class_exit_uuidlist(void); -/* mea.c */ -int mea_name2idx(struct lmv_stripe_md *mea, const char *name, int namelen); -int raw_name2idx(int hashtype, int count, const char *name, int namelen); - /* class_obd.c */ extern char obd_jobid_node[]; diff --git a/drivers/staging/lustre/lustre/include/obd_ost.h b/drivers/staging/lustre/lustre/include/obd_ost.h deleted file mode 100644 index 60de42972ec9..000000000000 --- a/drivers/staging/lustre/lustre/include/obd_ost.h +++ /dev/null @@ -1,100 +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) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - * - * Copyright (c) 2012, Intel Corporation. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - * - * lustre/include/obd_ost.h - * - * Data structures for object storage targets and client: OST & OSC's - * - * See also lustre_idl.h for wire formats of requests. - */ - -#ifndef _LUSTRE_OST_H -#define _LUSTRE_OST_H - -#include "obd_class.h" - -struct osc_brw_async_args { - struct obdo *aa_oa; - int aa_requested_nob; - int aa_nio_count; - obd_count aa_page_count; - int aa_resends; - struct brw_page **aa_ppga; - struct client_obd *aa_cli; - struct list_head aa_oaps; - struct list_head aa_exts; - struct obd_capa *aa_ocapa; - struct cl_req *aa_clerq; -}; - -#define osc_grant_args osc_brw_async_args -struct osc_async_args { - struct obd_info *aa_oi; -}; - -struct osc_setattr_args { - struct obdo *sa_oa; - obd_enqueue_update_f sa_upcall; - void *sa_cookie; -}; - -struct osc_fsync_args { - struct obd_info *fa_oi; - obd_enqueue_update_f fa_upcall; - void *fa_cookie; -}; - -struct osc_enqueue_args { - struct obd_export *oa_exp; - __u64 *oa_flags; - obd_enqueue_update_f oa_upcall; - void *oa_cookie; - struct ost_lvb *oa_lvb; - struct lustre_handle *oa_lockh; - struct ldlm_enqueue_info *oa_ei; - unsigned int oa_agl:1; -}; - -extern void osc_update_enqueue(struct lustre_handle *lov_lockhp, - struct lov_oinfo *loi, __u64 flags, - struct ost_lvb *lvb, __u32 mode, int rc); - -#if 0 -int osc_extent_blocking_cb(struct ldlm_lock *lock, - struct ldlm_lock_desc *new, void *data, - int flag); -#endif - -#endif diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index 92c89925ff67..2991d2ee780b 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -37,10 +37,10 @@ #ifndef _OBD_SUPPORT #define _OBD_SUPPORT +#include <linux/slab.h> #include "../../include/linux/libcfs/libcfs.h" -#include "lvfs.h" +#include "linux/lustre_compat25.h" #include "lprocfs_status.h" -#include "linux/obd_support.h" /* global variables */ extern struct lprocfs_stats *obd_memory; @@ -127,12 +127,12 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, /* Max connect interval for nonresponsive servers; ~50s to avoid building up connect requests in the LND queues, but within obd_timeout so we don't miss the recovery window */ -#define CONNECTION_SWITCH_MAX min(50U, max(CONNECTION_SWITCH_MIN,obd_timeout)) +#define CONNECTION_SWITCH_MAX min(50U, max(CONNECTION_SWITCH_MIN, obd_timeout)) #define CONNECTION_SWITCH_INC 5 /* Connection timeout backoff */ /* In general this should be low to have quick detection of a system running on a backup server. (If it's too low, import_select_connection will increase the timeout anyhow.) */ -#define INITIAL_CONNECT_TIMEOUT max(CONNECTION_SWITCH_MIN,obd_timeout/20) +#define INITIAL_CONNECT_TIMEOUT max(CONNECTION_SWITCH_MIN, obd_timeout/20) /* The max delay between connects is SWITCH_MAX + SWITCH_INC + INITIAL */ #define RECONNECT_DELAY_MAX (CONNECTION_SWITCH_MAX + CONNECTION_SWITCH_INC + \ INITIAL_CONNECT_TIMEOUT) @@ -402,6 +402,7 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, #define OBD_FAIL_TGT_LAST_REPLAY 0x710 #define OBD_FAIL_TGT_CLIENT_ADD 0x711 #define OBD_FAIL_TGT_RCVG_FLAG 0x712 +#define OBD_FAIL_TGT_DELAY_CONDITIONAL 0x713 #define OBD_FAIL_MDC_REVALIDATE_PAUSE 0x800 #define OBD_FAIL_MDC_ENQUEUE_PAUSE 0x801 @@ -667,7 +668,7 @@ do { \ } else { \ OBD_ALLOC_POST(ptr, size, "vmalloced"); \ } \ -} while(0) +} while (0) # define OBD_VMALLOC(ptr, size) \ __OBD_VMALLOC_VEROBSE(ptr, NULL, 0, size) @@ -729,7 +730,7 @@ do { \ OBD_FREE_PRE(ptr, size, "kfreed"); \ kfree(ptr); \ POISON_PTR(ptr); \ -} while(0) +} while (0) #define OBD_FREE_RCU(ptr, size, handle) \ @@ -741,7 +742,7 @@ do { \ __h->h_size = (size); \ call_rcu(&__h->h_rcu, class_handle_free_cb); \ POISON_PTR(ptr); \ -} while(0) +} while (0) #define OBD_VFREE(ptr, size) \ @@ -775,7 +776,7 @@ do { \ OBD_SLAB_FREE_RTN0(ptr, slab)))) { \ OBD_ALLOC_POST(ptr, size, "slab-alloced"); \ } \ -} while(0) +} while (0) #define OBD_SLAB_ALLOC_GFP(ptr, slab, size, flags) \ __OBD_SLAB_ALLOC_VERBOSE(ptr, slab, NULL, 0, size, flags) @@ -789,7 +790,7 @@ do { \ OBD_FREE_PRE(ptr, size, "slab-freed"); \ kmem_cache_free(slab, ptr); \ POISON_PTR(ptr); \ -} while(0) +} while (0) #define OBD_SLAB_ALLOC(ptr, slab, size) \ OBD_SLAB_ALLOC_GFP(ptr, slab, size, GFP_NOFS) |