# include <fcntl.h>
# include <liblustre.h>
#endif
-#include <lustre/lustre_idl.h>
#include <lustre_net.h>
+#include <lustre/lustre_idl.h>
#include "mdc_internal.h"
#ifndef __KERNEL__
}
}
-static __u32 mds_pack_open_flags(__u32 flags)
+static __u32 mds_pack_open_flags(__u32 flags, __u32 mode)
{
__u32 cr_flags = (flags & (FMODE_READ | FMODE_WRITE |
MDS_OPEN_HAS_EA | MDS_OPEN_HAS_OBJS |
cr_flags |= MDS_OPEN_SYNC;
if (flags & O_DIRECTORY)
cr_flags |= MDS_OPEN_DIRECTORY;
- if (flags & O_JOIN_FILE)
- cr_flags |= MDS_OPEN_JOIN_FILE;
#ifdef FMODE_EXEC
if (flags & FMODE_EXEC)
cr_flags |= MDS_FMODE_EXEC;
}
/* packing of MDS records */
-void mdc_join_pack(struct ptlrpc_request *req,
- struct md_op_data *op_data,
- __u64 head_size)
-{
- struct mdt_rec_join *rec;
-
- rec = req_capsule_client_get(&req->rq_pill, &RMF_REC_JOINFILE);
- LASSERT(rec != NULL);
- rec->jr_fid = op_data->op_fid2;
- rec->jr_headsize = head_size;
-}
-
void mdc_open_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
__u32 mode, __u64 rdev, __u32 flags, const void *lmm,
int lmmlen)
rec->cr_fid2 = op_data->op_fid2;
}
rec->cr_mode = mode;
- rec->cr_flags = mds_pack_open_flags(flags);
+ rec->cr_flags = mds_pack_open_flags(flags, mode);
rec->cr_rdev = rdev;
rec->cr_time = op_data->op_mod_time;
rec->cr_suppgid1 = op_data->op_suppgids[0];
{
int rc;
ENTRY;
- spin_lock(&cli->cl_loi_list_lock);
+ client_obd_list_lock(&cli->cl_loi_list_lock);
rc = list_empty(&mcw->mcw_entry);
- spin_unlock(&cli->cl_loi_list_lock);
+ client_obd_list_unlock(&cli->cl_loi_list_lock);
RETURN(rc);
};
struct mdc_cache_waiter mcw;
struct l_wait_info lwi = { 0 };
- spin_lock(&cli->cl_loi_list_lock);
+ client_obd_list_lock(&cli->cl_loi_list_lock);
if (cli->cl_r_in_flight >= cli->cl_max_rpcs_in_flight) {
list_add_tail(&mcw.mcw_entry, &cli->cl_cache_waiters);
cfs_waitq_init(&mcw.mcw_waitq);
- spin_unlock(&cli->cl_loi_list_lock);
+ client_obd_list_unlock(&cli->cl_loi_list_lock);
l_wait_event(mcw.mcw_waitq, mdc_req_avail(cli, &mcw), &lwi);
} else {
cli->cl_r_in_flight++;
- spin_unlock(&cli->cl_loi_list_lock);
+ client_obd_list_unlock(&cli->cl_loi_list_lock);
}
}
struct list_head *l, *tmp;
struct mdc_cache_waiter *mcw;
- spin_lock(&cli->cl_loi_list_lock);
+ client_obd_list_lock(&cli->cl_loi_list_lock);
cli->cl_r_in_flight--;
list_for_each_safe(l, tmp, &cli->cl_cache_waiters) {
}
/* Empty waiting list? Decrease reqs in-flight number */
- spin_unlock(&cli->cl_loi_list_lock);
+ client_obd_list_unlock(&cli->cl_loi_list_lock);
}