/*
* File system or volume support.
*/
+#ifndef SYSIO_FS_H_
+#define SYSIO_FS_H_
+
+#include <sys/queue.h>
struct filesys;
#ifdef ZERO_SUM_MEMORY
extern void _sysio_fssw_shutdown(void);
#endif
+
+#endif /* SYSIO_FS_H_ */
*/
#include <lu_object.h>
#ifdef __KERNEL__
-# include <linux/mutex.h>
-# include <linux/radix-tree.h>
+# include <linux/mutex.h>
+# include <linux/radix-tree.h>
+#else
+# include <liblustre.h>
#endif
struct inode;
#ifndef LCLIENT_H
#define LCLIENT_H
+#include <lustre/lustre_idl.h>
+#include <cl_object.h>
+
+enum obd_notify_event;
+struct inode;
+struct lov_stripe_md;
+struct lustre_md;
+struct obd_capa;
+struct obd_device;
+struct obd_export;
+struct page;
+
blkcnt_t dirty_cnt(struct inode *inode);
int cl_glimpse_size0(struct inode *inode, int agl);
#define set_page_private(page, v) ((page)->private = (v))
#endif
-
-/*
- * The inter_module_get implementation is specific to liblustre, so this needs
- * to stay here for now.
- */
-static inline void inter_module_put(void *a)
-{
- return;
-}
-void *inter_module_get(char *arg);
-
/* bits ops */
/* a long can be more than 32 bits, so use BITS_PER_LONG
* to allow the compiler to adjust the bit shifting accordingly
*/
-static __inline__ int ext2_set_bit(int nr, void *addr)
+static inline int ext2_set_bit(int nr, void *addr)
{
#if __BYTE_ORDER == __BIG_ENDIAN
- return set_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+ return set_bit((nr ^ ((BITS_PER_LONG - 1) & ~0x7)), addr);
#else
return set_bit(nr, addr);
#endif
static inline int ext2_clear_bit(int nr, void *addr)
{
#if __BYTE_ORDER == __BIG_ENDIAN
- return clear_bit((nr ^ ((BITS_PER_LONG-1) & ~0x7)), addr);
+ return clear_bit((nr ^ ((BITS_PER_LONG - 1) & ~0x7)), addr);
#else
return clear_bit(nr, addr);
#endif
}
-static __inline__ int ext2_test_bit(int nr, void *addr)
+static inline int ext2_test_bit(int nr, const void *addr)
{
#if __BYTE_ORDER == __BIG_ENDIAN
- __const__ unsigned char *tmp = (__const__ unsigned char *) addr;
- return (tmp[nr >> 3] >> (nr & 7)) & 1;
+ const unsigned char *tmp = addr;
+ return (tmp[nr >> 3] >> (nr & 7)) & 1;
#else
return test_bit(nr, addr);
#endif
}
-
/* module initialization */
extern int init_obdclass(void);
extern int ptlrpc_init(void);
extern int mdc_init(void);
extern int lmv_init(void);
extern int mgc_init(void);
-extern int echo_client_init(void);
-
-
/* general stuff */
({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
#endif
-#define simple_strtol strtol
-
/* registering symbols */
#ifndef ERESTARTSYS
#define ERESTARTSYS ERESTART
it->d.lustre.it_disposition &= ~flag;
}
-static inline void intent_init(struct lookup_intent *it, int op, int flags)
-{
- memset(it, 0, sizeof(*it));
- it->it_magic = INTENT_MAGIC;
- it->it_op = op;
- it->it_flags = flags;
-}
-
-struct dentry {
- int d_count;
-};
-
-struct vfsmount {
- void *pwd;
-};
-
-struct signal {
- int signal;
-};
-
#undef LL_TASK_CL_ENV
#define LL_TASK_CL_ENV cl_env
struct task_struct {
int state;
- struct signal pending;
char comm[32];
int uid;
int gid;
ret; \
}
-#define daemonize(l) do {} while (0)
-#define sigfillset(l) do {} while (0)
-#define recalc_sigpending(l) do {} while (0)
-
#define call_usermodehelper(path, argv, envp, wait) (0)
-#define KERN_INFO
#if HZ != 1
#error "liblustre's jiffies currently expects HZ to be 1"
cap_t cap_get_proc(void);
int cap_get_flag(cap_t, cap_value_t, cap_flag_t, cap_flag_value_t *);
-static inline void libcfs_run_lbug_upcall(char *file, const char *fn,
- const int l){}
-
-
struct liblustre_wait_callback {
cfs_list_t llwc_list;
const char *llwc_name;
void liblustre_deregister_idle_callback(void *notifier);
void liblustre_wait_idle(void);
-/* flock related */
-struct nfs_lock_info {
- __u32 state;
- __u32 flags;
- void *host;
-};
-
struct file_lock {
struct file_lock *fl_next; /* singly linked list for this inode */
cfs_list_t fl_link; /* doubly linked list of all locks */
void *fl_fasync; /* for lease break notifications */
unsigned long fl_break_time; /* for nonblocking lease breaks */
-
- union {
- struct nfs_lock_info nfs_fl;
- } fl_u;
};
#define flock_type(fl) ((fl)->fl_type)
#endif
typedef int mm_segment_t;
-enum {
- KERNEL_DS,
- USER_DS
-};
-static inline mm_segment_t get_fs(void)
-{
- return USER_DS;
-}
-
-static inline void set_fs(mm_segment_t seg)
-{
-}
#define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO)
#define S_IALLUGO (S_ISUID|S_ISGID|S_ISVTX|S_IRWXUGO)
-struct inode *igrab(struct inode *inode);
-void iput(struct inode *inode);
-
#include <obd_support.h>
#include <lustre/lustre_idl.h>
#include <lustre_lib.h>
#define DEBUG_SUBSYSTEM S_LLITE
-#include <unistd.h>
-#include <stdlib.h>
+#include <errno.h>
+#include <stddef.h>
#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/queue.h>
-
-#ifdef HAVE_LINUX_UNISTD_H
-#include <linux/unistd.h>
-#elif defined(HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-
-
+#include <sys/types.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lclient.h>
+#include <lustre_dlm.h>
+#include <lustre_lite.h>
+#include <lustre_net.h>
+#include <lustre_req_layout.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
#include "llite_lib.h"
#include <dirent.h>
return page;
}
-void *(*memmover)(void *, const void *, size_t) = memmove;
+static void *(*memmover)(void *, const void *, size_t) = memmove;
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
#define ROUND_UP64(x) (((x)+sizeof(__u64)-1) & ~(sizeof(__u64)-1))
#define DEBUG_SUBSYSTEM S_LLITE
-#include <stdlib.h>
+#include <errno.h>
+#include <fcntl.h>
#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/queue.h>
-#include <fcntl.h>
-
+#include <sys/types.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lclient.h>
+#include <lustre_lib.h>
+#include <lustre_lite.h>
+#include <lustre_mdc.h>
+#include <lustre_net.h>
+#include <lustre_req_layout.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
#include "llite_lib.h"
/* Pack the required supplementary groups into the supplied groups array.
#define DEBUG_SUBSYSTEM S_LLITE
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/types.h>
+#include <errno.h>
+#include <stdarg.h>
+#include <stddef.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/queue.h>
-#ifndef __CYGWIN__
-# include <sys/statvfs.h>
-#else
-# include <sys/statfs.h>
-#endif
-
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
#include <liblustre.h>
-
+#include <lclient.h>
+#include <cl_object.h>
+#include <lustre_export.h>
+#include <lustre_lite.h>
#include <obd.h>
#include <obd_support.h>
-#include <lustre_fid.h>
-#include <lustre_lite.h>
-#include <lustre_dlm.h>
-#include <lustre_ver.h>
-#include <lustre_mdc.h>
-#include <cl_object.h>
-
#include "llite_lib.h"
/*
static const struct cl_io_operations ccc_io_ops;
static const struct lu_device_type_operations slp_device_type_ops;
//struct lu_device_type slp_device_type;
-static const struct cl_page_operations slp_page_ops;
static const struct cl_page_operations slp_transient_page_ops;
static const struct cl_lock_operations slp_lock_ops;
*
*/
-void *slp_session_key_init(const struct lu_context *ctx,
- struct lu_context_key *key)
+static void *slp_session_key_init(const struct lu_context *ctx,
+ struct lu_context_key *key)
{
struct slp_session *session;
return session;
}
-void slp_session_key_fini(const struct lu_context *ctx,
- struct lu_context_key *key, void *data)
+static void slp_session_key_fini(const struct lu_context *ctx,
+ struct lu_context_key *key, void *data)
{
struct slp_session *session = data;
OBD_FREE_PTR(session);
.ldto_device_fini = ccc_device_fini
};
-struct lu_device_type slp_device_type = {
+static struct lu_device_type slp_device_type = {
.ldt_tags = LU_DEVICE_CL,
.ldt_name = LUSTRE_SLP_NAME,
.ldt_ops = &slp_device_type_ops,
}
static
-struct llu_io_group * get_io_group(struct inode *inode, int maxpages,
- struct lustre_rw_params *params)
+struct llu_io_group *get_io_group(struct inode *inode, int maxpages)
{
struct llu_io_group *group;
if (!group)
return ERR_PTR(-ENOMEM);
- group->lig_params = params;
-
return group;
}
loff_t pos;
long cnt;
struct llu_io_group *iogroup;
- struct lustre_rw_params p = {0};
int iovidx;
struct intnl_stat *st = llu_i2stat(inode);
struct llu_inode_info *lli = llu_i2info(inode);
pos = io->u.ci_rd.rd.crw_pos;
cnt = io->u.ci_rd.rd.crw_count;
}
- if (io->u.ci_wr.wr_append) {
- p.lrp_lock_mode = LCK_PW;
- } else {
- p.lrp_brw_flags = OBD_BRW_SRVLOCK;
- p.lrp_lock_mode = LCK_NL;
- }
- iogroup = get_io_group(inode, max_io_pages(cnt, cio->cui_nrsegs), &p);
+ iogroup = get_io_group(inode, max_io_pages(cnt, cio->cui_nrsegs));
if (IS_ERR(iogroup))
RETURN(PTR_ERR(iogroup));
* Lustre Light common routines
*/
+#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/queue.h>
-
+#include <unistd.h>
+#include <sys/mount.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
#include <liblustre.h>
-#include <lnet/lnetctl.h> /* needed for parse_dump */
+#include <lnet/lnet.h>
+#include <lustre_cfg.h>
+#include <lustre_export.h>
#include <lustre_log.h>
-
-#include "lutil.h"
+#include <lustre_ver.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
#include "llite_lib.h"
-
-int slp_global_init(void);
+#include "lutil.h"
static int lllib_init(void)
{
* to enable libsysio's processing of namespace init strings containing
* lustre filesystem operations
*/
-int _sysio_lustre_init(void)
+static int _sysio_lustre_init(void)
{
int err;
char *envstr;
#ifndef __LLU_H_
#define __LLU_H_
+
#include <fcntl.h>
-#include <sys/queue.h>
+#include <limits.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <unistd.h>
#include <sysio.h>
#ifdef HAVE_XTIO_H
-#include <xtio.h>
+# include <xtio.h>
#endif
#include <fs.h>
#include <mount.h>
#include <inode.h>
#ifdef HAVE_FILE_H
-#include <file.h>
+# include <file.h>
#endif
-
-#include <liblustre.h>
-#include <obd.h>
-#include <obd_class.h>
-#include <lustre_mdc.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <lclient.h>
+#include <lustre_lib.h>
#include <lustre_lite.h>
-#include <lustre_ver.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-/* for struct cl_lock_descr and struct cl_io */
-#include <cl_object.h>
-#include <lclient.h>
+enum cl_req_type;
/* This should not be "optimized" use ~0ULL because page->index is a long and
* 32-bit systems are therefore limited to 16TB in a mapping */
struct obd_export *ll_md_exp;
struct obd_export *ll_dt_exp;
struct lu_fid ll_root_fid;
- int ll_flags;
struct lustre_client_ocd ll_lco;
cfs_list_t ll_conn_chain;
-
- struct obd_uuid ll_mds_uuid;
- struct obd_uuid ll_mds_peer_uuid;
- char *ll_instance;
- struct lu_site *ll_site;
- struct cl_device *ll_cl;
+ struct lu_site *ll_site;
+ struct cl_device *ll_cl;
};
-#define LL_SBI_NOLCK 0x1
-
enum lli_flags {
/* MDS has an authority for the Size-on-MDS attributes. */
LLIF_MDS_SIZE_LOCK = (1 << 0),
it, inode, (long long)llu_i2stat(inode)->st_ino); \
} while(0)
-/* interpet return codes from intent lookup */
-#define LL_LOOKUP_POSITIVE 1
-#define LL_LOOKUP_NEGATIVE 2
-
static inline struct lu_fid *ll_inode2fid(struct inode *inode)
{
LASSERT(inode != NULL);
return &llu_i2info(inode)->lli_fid;
}
-struct it_cb_data {
- struct inode *icbd_parent;
- struct pnode *icbd_child;
- obd_id hash;
-};
-
void ll_i2gids(__u32 *suppgids, struct inode *i1,struct inode *i2);
-typedef int (*intent_finish_cb)(struct ptlrpc_request *,
- struct inode *parent, struct pnode *pnode,
- struct lookup_intent *, int offset, obd_id ino);
-
static inline __u64 ll_file_maxbytes(struct inode *inode)
{
return llu_i2info(inode)->lli_maxbytes;
}
-struct mount_option_s
-{
- char *md_uuid;
- char *dt_uuid;
-};
-
#define IS_BAD_PTR(ptr) \
((unsigned long)(ptr) == 0 || (unsigned long)(ptr) > -1000UL)
char *profile, int allow_recov);
int ll_parse_mount_target(const char *target, char **mgsnid,
char **fsname);
-
-extern struct mount_option_s mount_option;
+extern char *lustre_path;
/* super.c */
void llu_update_inode(struct inode *inode, struct lustre_md *md);
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid);
-int ll_it_open_error(int phase, struct lookup_intent *it);
struct inode *llu_iget(struct filesys *fs, struct lustre_md *md);
int llu_inode_getattr(struct inode *inode, struct obdo *obdo,
__u64 ioepoch, int sync);
void llu_prep_md_op_data(struct md_op_data *op_data, struct inode *i1,
struct inode *i2, const char *name, int namelen,
int mode, __u32 opc);
-int llu_create(struct inode *dir, struct pnode_base *pnode, int mode);
int llu_local_open(struct llu_inode_info *lli, struct lookup_intent *it);
int llu_iop_open(struct pnode *pnode, int flags, mode_t mode);
void llu_done_writing_attr(struct inode *inode, struct md_op_data *op_data);
int llu_som_update(struct inode *inode, struct md_op_data *op_data);
int llu_iop_close(struct inode *inode);
_SYSIO_OFF_T llu_iop_pos(struct inode *ino, _SYSIO_OFF_T off);
-int llu_vmtruncate(struct inode * inode, loff_t offset, obd_flag obd_flags);
void obdo_refresh_inode(struct inode *dst, struct obdo *src, obd_flag valid);
int llu_objects_destroy(struct ptlrpc_request *request, struct inode *dir);
void llu_ioepoch_open(struct llu_inode_info *lli, __u64 ioepoch);
struct inode **inop,
struct intent *intnt,
const char *path);
-void unhook_stale_inode(struct pnode *pno);
struct inode *llu_inode_from_resource_lock(struct ldlm_lock *lock);
-struct inode *llu_inode_from_lock(struct ldlm_lock *lock);
int llu_md_blocking_ast(struct ldlm_lock *lock,
struct ldlm_lock_desc *desc,
void *data, int flag);
ssize_t llu_iop_filldirentries(struct inode *ino, _SYSIO_OFF_T *basep,
char *buf, size_t nbytes);
-/* liblustre/llite_fid.c*/
-unsigned long llu_fid_build_ino(struct llu_sb_info *sbi,
- struct lu_fid *fid);
-
/* ext2 related */
#define EXT2_NAME_LEN (255)
char name[EXT2_NAME_LEN];
};
-#define EXT2_DIR_PAD 4
-#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
-#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) & \
- ~EXT2_DIR_ROUND)
-
static inline struct ext2_dirent *ext2_next_entry(struct ext2_dirent *p)
{
return (struct ext2_dirent*)((char*) p + le16_to_cpu(p->rec_len));
lvb->lvb_ctime = st->st_ctime;
}
-#define LLU_IO_GROUP_SIZE(x) \
- (sizeof(struct llu_io_group) + \
- (sizeof(struct ll_async_page) + \
- sizeof(struct page) + \
- llap_cookie_size) * (x))
-
struct llu_io_session {
struct inode *lis_inode;
int lis_cmd;
- int lis_max_groups;
- int lis_ngroups;
int lis_rc;
__u64 lis_rwcount;
};
struct llu_io_group
{
- struct lustre_rw_params *lig_params;
int lig_rc;
__u64 lig_rwcount;
};
struct slp_io ss_ios;
};
+int slp_global_init(void);
+void slp_global_fini(void);
+
static inline struct slp_session *slp_env_session(const struct lu_env *env)
{
extern struct lu_context_key slp_session_key;
return inode->i_stbuf.st_size;
}
-static inline void i_size_write(struct inode *inode, loff_t i_sz)
-{
- inode->i_stbuf.st_size = i_sz;
-}
-
static inline __u64 hash_x_index(__u64 hash, int hash64)
{
if (BITS_PER_LONG == 32 && hash64)
* Lustre is a trademark of Sun Microsystems, Inc.
*/
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <signal.h>
-#include <sys/types.h>
-
+#include <byteswap.h>
+#include <errno.h>
#include <fcntl.h>
-#ifdef HAVE_NETDB_H
+#include <malloc.h>
#include <netdb.h>
-#endif
-#ifdef _AIX
-#include "syscall_AIX.h"
-#else
+#include <stdio.h>
+#include <unistd.h>
+#include <arpa/inet.h>
+#include <sys/socket.h>
#include <sys/syscall.h>
-#endif
+#include <sys/time.h>
+#include <sys/types.h>
#include <sys/utsname.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#include <sys/socket.h>
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lnet/lnet.h>
+#include <lustre_dlm.h>
#include "lutil.h"
-
-
-struct task_struct *current;
-
-void *inter_module_get(char *arg)
-{
- if (!strcmp(arg, "ldlm_cli_cancel_unused"))
- return ldlm_cli_cancel_unused;
- else if (!strcmp(arg, "ldlm_namespace_cleanup"))
- return ldlm_namespace_cleanup;
- else if (!strcmp(arg, "ldlm_replay_locks"))
- return ldlm_replay_locks;
- else
- return NULL;
-}
+struct task_struct *current;
/*
* random number generator stuff
current->gid = getgid();
current->fsuid = geteuid();
current->fsgid = getegid();
- memset(¤t->pending, 0, sizeof(current->pending));
current->max_groups = sysconf(_SC_NGROUPS_MAX);
current->groups = malloc(sizeof(gid_t) * current->max_groups);
#ifndef __LUTIL_H_
#define __LUTIL_H_
-#include <liblustre.h>
-#include <obd.h>
-#include <obd_class.h>
-
void liblustre_init_random(void);
int liblustre_init_current(char *comm);
int init_lib_portals(void);
#define DEBUG_SUBSYSTEM S_LLITE
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
-#include <time.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/queue.h>
-
-#include "llite_lib.h"
+#include <sys/types.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lclient.h>
+#include <lustre_dlm.h>
#include <lustre_fid.h>
+#include <lustre_mdc.h>
+#include <lustre_net.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
+#include "llite_lib.h"
-void ll_intent_drop_lock(struct lookup_intent *it)
+static void ll_intent_drop_lock(struct lookup_intent *it)
{
struct lustre_handle *handle;
}
}
-void ll_intent_release(struct lookup_intent *it)
+static void ll_intent_release(struct lookup_intent *it)
{
ENTRY;
EXIT;
}
-void llu_lookup_finish_locks(struct lookup_intent *it, struct pnode *pnode)
+static void
+llu_lookup_finish_locks(struct lookup_intent *it, struct pnode *pnode)
{
struct inode *inode;
LASSERT(it);
}
static int lookup_it_finish(struct ptlrpc_request *request, int offset,
- struct lookup_intent *it, void *data)
+ struct lookup_intent *it,
+ struct inode *parent, struct pnode *child)
{
- struct it_cb_data *icbd = data;
- struct pnode *child = icbd->icbd_child;
- struct inode *parent = icbd->icbd_parent;
struct llu_sb_info *sbi = llu_i2sbi(parent);
struct inode *inode = NULL;
int rc;
return inode;
}
-struct inode *llu_inode_from_lock(struct ldlm_lock *lock)
-{
- struct inode *inode;
- lock_res_and_lock(lock);
-
- if (lock->l_ast_data) {
- inode = (struct inode *)lock->l_ast_data;
- I_REF(inode);
- } else
- inode = NULL;
-
- unlock_res_and_lock(lock);
- return inode;
-}
-
static int llu_lookup_it(struct inode *parent, struct pnode *pnode,
struct lookup_intent *it, int flags)
{
struct md_op_data op_data = {{ 0 }};
- struct it_cb_data icbd;
struct ptlrpc_request *req = NULL;
struct lookup_intent lookup_it = { .it_op = IT_LOOKUP };
__u32 opc;
it->it_op_release = ll_intent_release;
}
- icbd.icbd_child = pnode;
- icbd.icbd_parent = parent;
-
if (it->it_op & IT_CREAT)
opc = LUSTRE_OPC_CREATE;
else
if (rc < 0)
GOTO(out, rc);
- rc = lookup_it_finish(req, DLM_REPLY_REC_OFF, it, &icbd);
+ rc = lookup_it_finish(req, DLM_REPLY_REC_OFF, it, parent, pnode);
if (rc != 0) {
ll_intent_release(it);
GOTO(out, rc);
#define DEBUG_SUBSYSTEM S_LLITE
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
-#include <assert.h>
#include <time.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/queue.h>
-#include <fcntl.h>
+#include <sys/types.h>
#include <sys/uio.h>
-
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <cl_object.h>
+#include <lclient.h>
+#include <lustre_dlm.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
#include "llite_lib.h"
-typedef ssize_t llu_file_piov_t(const struct iovec *iovec, int iovlen,
- _SYSIO_OFF_T pos, ssize_t len,
- void *private);
-
-size_t llap_cookie_size;
-
-static int llu_lock_to_stripe_offset(struct obd_export *exp,
- struct lov_stripe_md *lsm,
- struct ldlm_lock *lock)
-{
- struct {
- char name[16];
- struct ldlm_lock *lock;
- } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock };
- __u32 stripe, vallen = sizeof(stripe);
- int rc;
- ENTRY;
-
- if (lsm == NULL || lsm->lsm_stripe_count == 1)
- RETURN(0);
-
- /* get our offset in the lov */
- rc = obd_get_info(NULL, exp, sizeof(key), &key, &vallen, &stripe, lsm);
- if (rc != 0) {
- CERROR("obd_get_info: rc = %d\n", rc);
- LBUG();
- }
- LASSERT(stripe < lsm->lsm_stripe_count);
- RETURN(stripe);
-}
-
-int llu_extent_lock_cancel_cb(struct ldlm_lock *lock,
- struct ldlm_lock_desc *new, void *data,
- int flag)
-{
- struct lustre_handle lockh = { 0 };
- int rc;
- ENTRY;
-
- if ((unsigned long)data > 0 && (unsigned long)data < 0x1000) {
- LDLM_ERROR(lock, "cancelling lock with bad data %p", data);
- LBUG();
- }
-
- switch (flag) {
- case LDLM_CB_BLOCKING:
- ldlm_lock2handle(lock, &lockh);
- rc = ldlm_cli_cancel(&lockh, 0);
- if (rc != ELDLM_OK)
- CERROR("ldlm_cli_cancel failed: %d\n", rc);
- break;
- case LDLM_CB_CANCELING: {
- struct inode *inode;
- struct llu_inode_info *lli;
- struct lov_stripe_md *lsm;
- __u32 stripe;
- __u64 kms;
-
- /* This lock wasn't granted, don't try to evict pages */
- if (lock->l_req_mode != lock->l_granted_mode)
- RETURN(0);
-
- inode = llu_inode_from_lock(lock);
- if (!inode)
- RETURN(0);
- lli= llu_i2info(inode);
- if (!lli)
- goto iput;
- if (!lli->lli_has_smd)
- goto iput;
-
- lsm = ccc_inode_lsm_get(inode);
- if (lsm == NULL)
- goto iput;
-
- stripe = llu_lock_to_stripe_offset(llu_i2obdexp(inode),
- lsm, lock);
- lock_res_and_lock(lock);
- kms = ldlm_extent_shift_kms(lock,
- lsm->lsm_oinfo[stripe]->loi_kms);
- unlock_res_and_lock(lock);
- if (lsm->lsm_oinfo[stripe]->loi_kms != kms)
- LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64,
- lsm->lsm_oinfo[stripe]->loi_kms, kms);
- loi_kms_set(lsm->lsm_oinfo[stripe], kms);
- ccc_inode_lsm_put(inode, lsm);
-iput:
- I_RELE(inode);
- break;
- }
- default:
- LBUG();
- }
-
- RETURN(0);
-}
-
int llu_merge_lvb(const struct lu_env *env, struct inode *inode)
{
struct llu_inode_info *lli = llu_i2info(inode);
I_REF(ino);
session->lis_inode = ino;
- session->lis_max_groups = ngroups;
session->lis_cmd = cmd;
return session;
}
#define DEBUG_SUBSYSTEM S_LLITE
+#include <assert.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
-#include <assert.h>
#include <time.h>
-#include <sys/types.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <sys/queue.h>
-#ifndef __CYGWIN__
-# include <sys/statvfs.h>
-#else
-# include <sys/statfs.h>
-#endif
-
+#include <sys/types.h>
+#include <libcfs/libcfs.h>
+#include <lustre/lustre_idl.h>
+#include <liblustre.h>
+#include <lclient.h>
+#include <lustre_dlm.h>
+#include <lustre_export.h>
+#include <lustre_lite.h>
+#include <lustre_mdc.h>
+#include <lustre_net.h>
+#include <lustre_req_layout.h>
+#include <lustre_ver.h>
+#include <obd.h>
+#include <obd_class.h>
+#include <obd_support.h>
#include "llite_lib.h"
#ifndef MAY_EXEC
}
}
-void obdo_to_inode(struct inode *dst, struct obdo *src, obd_flag valid)
-{
- struct llu_inode_info *lli = llu_i2info(dst);
- struct intnl_stat *st = llu_i2stat(dst);
-
- valid &= src->o_valid;
-
- LASSERTF(!(valid & (OBD_MD_FLTYPE | OBD_MD_FLGENER | OBD_MD_FLFID |
- OBD_MD_FLID | OBD_MD_FLGROUP)),
- "object "DOSTID", valid %x\n", POSTID(&src->o_oi), valid);
-
- if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
- CDEBUG(D_INODE,"valid "LPX64", cur time "CFS_TIME_T"/"CFS_TIME_T
- ", new %lu/%lu\n",
- src->o_valid,
- LTIME_S(st->st_mtime), LTIME_S(st->st_ctime),
- (long)src->o_mtime, (long)src->o_ctime);
-
- if (valid & OBD_MD_FLATIME)
- LTIME_S(st->st_atime) = src->o_atime;
- if (valid & OBD_MD_FLMTIME)
- LTIME_S(st->st_mtime) = src->o_mtime;
- if (valid & OBD_MD_FLCTIME && src->o_ctime > LTIME_S(st->st_ctime))
- LTIME_S(st->st_ctime) = src->o_ctime;
- if (valid & OBD_MD_FLSIZE)
- st->st_size = src->o_size;
- if (valid & OBD_MD_FLBLOCKS) /* allocation of space */
- st->st_blocks = src->o_blocks;
- if (valid & OBD_MD_FLBLKSZ)
- st->st_blksize = src->o_blksize;
- if (valid & OBD_MD_FLTYPE)
- st->st_mode = (st->st_mode & ~S_IFMT) | (src->o_mode & S_IFMT);
- if (valid & OBD_MD_FLMODE)
- st->st_mode = (st->st_mode & S_IFMT) | (src->o_mode & ~S_IFMT);
- if (valid & OBD_MD_FLUID)
- st->st_uid = src->o_uid;
- if (valid & OBD_MD_FLGID)
- st->st_gid = src->o_gid;
- if (valid & OBD_MD_FLFLAGS)
- lli->lli_st_flags = src->o_flags;
-}
-
/**
* Performs the getattr on the inode and updates its fields.
* If @sync != 0, perform the getattr under the server-side lock.
return LDLM_ITER_CONTINUE;
}
-void llu_clear_inode(struct inode *inode)
+static void llu_clear_inode(struct inode *inode)
{
struct llu_inode_info *lli = llu_i2info(inode);
struct llu_sb_info *sbi = llu_i2sbi(inode);
EXIT;
}
-void llu_iop_gone(struct inode *inode)
+static void llu_iop_gone(struct inode *inode)
{
struct llu_inode_info *lli = llu_i2info(inode);
ENTRY;
return 0;
}
-struct filesys_ops llu_filesys_ops =
-{
- fsop_gone: llu_fsop_gone,
+static struct filesys_ops llu_filesys_ops = {
+ .fsop_gone = llu_fsop_gone,
};
struct inode *llu_iget(struct filesys *fs, struct lustre_md *md)
}
struct fssw_ops llu_fssw_ops = {
- llu_fsswop_mount
+ .fsswop_mount = llu_fsswop_mount,
};
static struct inode_ops llu_inode_ops = {
- inop_lookup: llu_iop_lookup,
- inop_getattr: llu_iop_getattr,
- inop_setattr: llu_iop_setattr,
- inop_filldirentries: llu_iop_filldirentries,
- inop_mkdir: llu_iop_mkdir_raw,
- inop_rmdir: llu_iop_rmdir_raw,
- inop_symlink: llu_iop_symlink_raw,
- inop_readlink: llu_iop_readlink,
- inop_open: llu_iop_open,
- inop_close: llu_iop_close,
- inop_link: llu_iop_link_raw,
- inop_unlink: llu_iop_unlink_raw,
- inop_rename: llu_iop_rename_raw,
- inop_pos: llu_iop_pos,
- inop_read: llu_iop_read,
- inop_write: llu_iop_write,
- inop_iodone: llu_iop_iodone,
- inop_fcntl: llu_iop_fcntl,
- inop_sync: llu_iop_sync,
- inop_datasync: llu_iop_datasync,
- inop_ioctl: llu_iop_ioctl,
- inop_mknod: llu_iop_mknod_raw,
+ .inop_lookup = llu_iop_lookup,
+ .inop_getattr = llu_iop_getattr,
+ .inop_setattr = llu_iop_setattr,
+ .inop_filldirentries = llu_iop_filldirentries,
+ .inop_mkdir = llu_iop_mkdir_raw,
+ .inop_rmdir = llu_iop_rmdir_raw,
+ .inop_symlink = llu_iop_symlink_raw,
+ .inop_readlink = llu_iop_readlink,
+ .inop_open = llu_iop_open,
+ .inop_close = llu_iop_close,
+ .inop_link = llu_iop_link_raw,
+ .inop_unlink = llu_iop_unlink_raw,
+ .inop_rename = llu_iop_rename_raw,
+ .inop_pos = llu_iop_pos,
+ .inop_read = llu_iop_read,
+ .inop_write = llu_iop_write,
+ .inop_iodone = llu_iop_iodone,
+ .inop_fcntl = llu_iop_fcntl,
+ .inop_sync = llu_iop_sync,
+ .inop_datasync = llu_iop_datasync,
+ .inop_ioctl = llu_iop_ioctl,
+ .inop_mknod = llu_iop_mknod_raw,
#ifdef _HAVE_STATVFS
- inop_statvfs: llu_iop_statvfs,
+ .inop_statvfs = llu_iop_statvfs,
#endif
- inop_gone: llu_iop_gone,
+ .inop_gone = llu_iop_gone,
};
int sptlrpc_conf_init(void);
void sptlrpc_conf_fini(void);
+struct dentry;
+struct vfsmount;
int lustre_rename(struct dentry *dir, struct vfsmount *mnt, char *old_name,
char *new_name);