#define MDD_OBD_NAME "mdd_obd"
#define MDD_OBD_UUID "mdd_obd_uuid"
-static inline int md_should_create(u64 open_flags)
+static inline int md_should_create(enum mds_open_flags open_flags)
{
return !(open_flags & MDS_OPEN_DELAY_CREATE) &&
(open_flags & MDS_FMODE_WRITE) &&
}
/* do NOT or the MAY_*'s, you'll get the weakest */
-static inline int mds_accmode(u64 open_flags)
+static inline int mds_accmode(enum mds_open_flags open_flags)
{
unsigned int may_mask = 0;
} u;
/** Open flags from client: such as MDS_OPEN_CREAT, and others. */
- __u64 sp_cr_flags;
+ enum mds_open_flags sp_cr_flags;
/* File security context for creates. */
const char *sp_cr_file_secctx_name; /* (security) xattr name */
struct md_device *m, const struct lu_fid *fid);
int (*moo_open)(const struct lu_env *env, struct md_object *obj,
- u64 open_flags, struct md_op_spec *spec);
+ enum mds_open_flags open_flags, struct md_op_spec *spc);
int (*moo_close)(const struct lu_env *env, struct md_object *obj,
struct md_attr *ma, u64 open_flags);
struct md_open_data *och_mod;
struct lustre_handle och_lease_handle; /* open lock for lease */
__u32 och_magic;
- int och_flags;
+ enum mds_open_flags och_flags; /* Open flags from client */
};
#define OBD_CLIENT_HANDLE_MAGIC 0xd15ea5ed
/* Changelog extra extension to include low 32 bits of MDS_OPEN_* flags. */
struct changelog_ext_openmode {
- __u32 cr_openflags;
+ __u32 cr_openflags; /* enum mds_open_flags */
};
/* Changelog extra extension to include xattr */
return rc;
}
-int ll_md_real_close(struct inode *inode, fmode_t fmode)
+/**
+ * ll_md_real_close() - called when file is closed. Called from ll_file_release
+ *
+ * @inode: inode which is getting closed
+ * @fd_open_mode: MDS flags passed from client
+ *
+ * Return:
+ * * 0 on success
+ * * <0 on error
+ */
+int ll_md_real_close(struct inode *inode, enum mds_open_flags fd_open_mode)
{
struct ll_inode_info *lli = ll_i2info(inode);
struct obd_client_handle **och_p;
int rc = 0;
ENTRY;
- if (fmode & FMODE_WRITE) {
+ if (fd_open_mode & MDS_FMODE_WRITE) {
och_p = &lli->lli_mds_write_och;
och_usecount = &lli->lli_open_fd_write_count;
- } else if (fmode & FMODE_EXEC) {
+ } else if (fd_open_mode & MDS_FMODE_EXEC) {
och_p = &lli->lli_mds_exec_och;
och_usecount = &lli->lli_open_fd_exec_count;
} else {
- LASSERT(fmode & FMODE_READ);
+ LASSERT(fd_open_mode & MDS_FMODE_READ);
och_p = &lli->lli_mds_read_och;
och_usecount = &lli->lli_open_fd_read_count;
}
/* Let's see if we have good enough OPEN lock on the file and if we can
* skip talking to MDS
*/
- if (lfd->fd_omode & FMODE_WRITE) {
+ if (lfd->fd_open_mode & MDS_FMODE_WRITE) {
lockmode = LCK_CW;
LASSERT(lli->lli_open_fd_write_count);
lli->lli_open_fd_write_count--;
- } else if (lfd->fd_omode & FMODE_EXEC) {
+ } else if (lfd->fd_open_mode & MDS_FMODE_EXEC) {
lockmode = LCK_PR;
LASSERT(lli->lli_open_fd_exec_count);
lli->lli_open_fd_exec_count--;
if ((lockmode == LCK_CW && inode->i_mode & 0111) ||
!md_lock_match(ll_i2mdexp(inode), flags, ll_inode2fid(inode),
LDLM_IBITS, &policy, lockmode, 0, &lockh))
- rc = ll_md_real_close(inode, lfd->fd_omode);
+ rc = ll_md_real_close(inode, lfd->fd_open_mode);
out:
file->private_data = NULL;
file->private_data = lfd;
ll_readahead_init(inode, &lfd->fd_ras);
- lfd->fd_omode = it->it_open_flags & (FMODE_READ | FMODE_WRITE |
- FMODE_EXEC);
+ lfd->fd_open_mode = it->it_open_flags & (MDS_FMODE_READ |
+ MDS_FMODE_WRITE |
+ MDS_FMODE_EXEC);
RETURN(0);
}
if ((oit.it_open_flags + 1) & O_ACCMODE)
oit.it_open_flags++;
if (file->f_flags & O_TRUNC)
- oit.it_open_flags |= FMODE_WRITE;
+ oit.it_open_flags |= MDS_FMODE_WRITE;
/* kernel only call f_op->open in dentry_open. filp_open calls
* dentry_open after call to open_namei that checks permissions.
* Only nfsd_open call dentry_open directly without checking
* permissions and because of that this code below is safe.
*/
- if (oit.it_open_flags & (FMODE_WRITE | FMODE_READ))
+ if (oit.it_open_flags & (MDS_FMODE_WRITE | MDS_FMODE_READ))
oit.it_open_flags |= MDS_OPEN_OWNEROVERRIDE;
/* We do not want O_EXCL here, presumably we opened the file
* already? XXX - NFS implications?
*/
- oit.it_open_flags &= ~O_EXCL;
+ oit.it_open_flags &= ~MDS_OPEN_EXCL;
/* bug20584, if "it_open_flags" contains O_CREAT, file will be
* created if necessary, then "IT_CREAT" should be set to keep
* consistent with it
*/
- if (oit.it_open_flags & O_CREAT)
+ if (oit.it_open_flags & MDS_OPEN_CREAT)
oit.it_op |= IT_CREAT;
it = &oit;
restart:
/* Let's see if we have file open on MDS already. */
- if (it->it_open_flags & FMODE_WRITE) {
+ if (it->it_open_flags & MDS_FMODE_WRITE) {
och_p = &lli->lli_mds_write_och;
och_usecount = &lli->lli_open_fd_write_count;
- } else if (it->it_open_flags & FMODE_EXEC) {
+ } else if (it->it_open_flags & MDS_FMODE_EXEC) {
och_p = &lli->lli_mds_exec_och;
och_usecount = &lli->lli_open_fd_exec_count;
} else {
RETURN(rc);
}
-/* Acquire a lease and open the file. */
+/**
+ * ll_lease_open() - Acquire a lease(block other open() call on this file)
+ * and open the file.
+ *
+ * @inode: mount point
+ * @file: file to open
+ * @fmode: Kernel mode open flag pass to open() (permissions)
+ * @open_flags: MDS flags passed from client
+ *
+ * Return:
+ * * populate obd_client_handle object on success
+ */
static struct obd_client_handle *
ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode,
- __u64 open_flags)
+ enum mds_open_flags open_flags)
{
struct lookup_intent it = { .it_op = IT_OPEN };
struct ll_sb_info *sbi = ll_i2sbi(inode);
RETURN(result > 0 ? result : rc);
}
-/**
+/*
* The purpose of fast read is to overcome per I/O overhead and improve IOPS
* especially for small I/O.
*
return result;
}
-/**
+/*
* Confine read iter lest read beyond the EOF
*
* \param iocb [in] kernel iocb
RETURN(result);
}
-/* Write to a file (through the page cache). */
+/* Write to a file (through the page cache).*/
static ssize_t do_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct file *file = iocb->ki_filp;
RETURN(result);
}
-/* Write to a file (through the page cache). AIO stuff */
static ssize_t ll_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
unsigned long nr_segs, loff_t pos)
{
}
/*
- * Read the data_version for inode.
- *
* This value is computed using stripe object version on OST.
* Version is computed using server side locking.
*
RETURN(rc);
}
-static inline long ll_lease_type_from_fmode(fmode_t fmode)
+static inline long ll_lease_type_from_fmode(enum mds_open_flags fd_open_mode)
{
- return ((fmode & FMODE_READ) ? LL_LEASE_RDLCK : 0) |
- ((fmode & FMODE_WRITE) ? LL_LEASE_WRLCK : 0);
+ return ((fd_open_mode & MDS_FMODE_READ) ? LL_LEASE_RDLCK : 0) |
+ ((fd_open_mode & MDS_FMODE_WRITE) ? LL_LEASE_WRLCK : 0);
}
static int ll_file_futimes_3(struct file *file, const struct ll_futimes_3 *lfu)
struct split_param sp;
struct pcc_param param;
bool lease_broken = false;
- fmode_t fmode = 0;
+ enum mds_open_flags fmode = MDS_FMODE_CLOSED;
enum mds_op_bias bias = 0;
__u32 fdv;
struct file *layout_file = NULL;
GOTO(out, rc);
if (lease_broken)
- fmode = 0;
+ fmode = MDS_FMODE_CLOSED;
EXIT;
out:
struct ll_inode_info *lli = ll_i2info(inode);
struct ll_file_data *lfd = file->private_data;
struct obd_client_handle *och = NULL;
- __u64 open_flags = 0;
+ enum mds_open_flags open_flags = MDS_FMODE_CLOSED;
bool lease_broken;
- fmode_t fmode;
+ fmode_t fmode; /* kernel permissions */
long rc;
ENTRY;
case LL_IOC_GET_LEASE: {
struct ll_inode_info *lli = ll_i2info(inode);
struct ldlm_lock *lock = NULL;
- fmode_t fmode = 0;
+ enum mds_open_flags fmode = MDS_FMODE_CLOSED;
mutex_lock(&lli->lli_och_mutex);
if (lfd->fd_lease_och != NULL) {
* null and dentry must be used directly rather than pulled from
* file_dentry() as is done otherwise.
*/
-
int ll_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
struct dentry *dentry = file_dentry(file);
/* Fetch layout from MDT with getxattr request, if it's not ready yet */
static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
-
{
struct ll_sb_info *sbi = ll_i2sbi(inode);
struct ptlrpc_request *req;
intent->lai_opc == LAYOUT_INTENT_TRUNC ||
intent->lai_opc == LAYOUT_INTENT_PCCRO_SET ||
intent->lai_opc == LAYOUT_INTENT_PCCRO_CLEAR)
- it.it_open_flags = FMODE_WRITE;
+ it.it_open_flags = MDS_FMODE_WRITE;
LDLM_DEBUG_NOLOCK("%s: requeue layout lock for file "DFID"(%p)",
sbi->ll_fsname, PFID(&lli->lli_fid), inode);
struct ll_grouplock fd_grouplock;
__u64 lfd_pos;
__u32 fd_flags;
- fmode_t fd_omode;
+ enum mds_open_flags fd_open_mode;
/* openhandle if lease exists for this file.
* Borrow lli->lli_och_mutex to protect assignment
*/
int ll_file_open(struct inode *inode, struct file *file);
int ll_file_release(struct inode *inode, struct file *file);
int ll_release_openhandle(struct dentry *d, struct lookup_intent *l);
-int ll_md_real_close(struct inode *inode, fmode_t fmode);
+int ll_md_real_close(struct inode *inode, enum mds_open_flags fd_open_mode);
void ll_track_file_opens(struct inode *inode);
extern void ll_rw_stats_tally(struct ll_sb_info *sbi, pid_t pid,
struct ll_file_data *file, loff_t pos,
lock->l_req_mode, 0);
if (bits & MDS_INODELOCK_OPEN) {
- fmode_t fmode;
+ enum mds_open_flags fmode = MDS_FMODE_CLOSED;
switch (lock->l_req_mode) {
case LCK_CW:
- fmode = FMODE_WRITE;
+ fmode = MDS_FMODE_WRITE;
break;
case LCK_PR:
- fmode = FMODE_EXEC;
+ fmode = MDS_FMODE_EXEC;
break;
case LCK_CR:
- fmode = FMODE_READ;
+ fmode = MDS_FMODE_READ;
break;
default:
LDLM_ERROR(lock, "bad lock mode for OPEN lock");
RETURN(dentry == save ? NULL : dentry);
}
- if (it->it_op & IT_OPEN && it->it_open_flags & FMODE_WRITE &&
+ if (it->it_op & IT_OPEN && it->it_open_flags & MDS_FMODE_WRITE &&
dentry->d_sb->s_flags & SB_RDONLY)
RETURN(ERR_PTR(-EROFS));
#endif
-/*
- * For cached negative dentry and new dentry, handle lookup/create/open
- * together.
+/**
+ * ll_atomic_open() - For cached negative dentry and new dentry, handle
+ * lookup/create/open together. This method is only called
+ * if the last component is negative(needs lookup)
*/
static int ll_atomic_open(struct inode *dir, struct dentry *dentry,
struct file *file, unsigned int open_flags,
ldlm_blocking_callback cb_blocking,
__u64 extra_lock_flags)
{
+ enum mds_open_flags flags = it->it_open_flags;
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
struct lmv_tgt_desc *tgt;
struct mdt_body *body;
- __u64 flags = it->it_open_flags;
int rc;
ENTRY;
* layout first, to avoid creating new file
* under old layout, clear O_CREAT.
*/
- it->it_open_flags &= ~O_CREAT;
+ it->it_open_flags &= ~MDS_OPEN_CREAT;
}
}
}
#include <cl_object.h>
#include "mdc_internal.h"
-static void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags)
+/*
+ * set_mrc_cr_flags() - Move @flags into high(most significant bits (cr_flags_h)
+ * and low(least significant bits (cr_flags_l)) field under
+ * reint record
+ *
+ * @mrc: instance of mdt_reint_rec
+ * @flags: open flags passed from client
+ */
+static void set_mrc_cr_flags(struct mdt_rec_create *mrc,
+ enum mds_open_flags flags)
{
mrc->cr_flags_l = (__u32)(flags & 0xFFFFFFFFUll);
mrc->cr_flags_h = (__u32)(flags >> 32);
struct sptlrpc_sepol *sepol)
{
struct mdt_rec_create *rec;
+ enum mds_open_flags flags;
char *tmp;
- __u64 flags;
BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
sizeof(struct mdt_rec_create));
mdc_file_sepol_pack(pill, sepol);
}
-static inline __u64 mds_pack_open_flags(__u64 flags)
+static inline __u64 mds_pack_open_flags(enum mds_open_flags flags)
{
- __u64 cr_flags = (flags & MDS_OPEN_FL_INTERNAL);
+ enum mds_open_flags cr_flags = (flags & MDS_OPEN_FL_INTERNAL);
if (flags & FMODE_READ)
cr_flags |= MDS_FMODE_READ;
size_t lmmlen, struct sptlrpc_sepol *sepol)
{
struct mdt_rec_create *rec;
+ enum mds_open_flags cr_flags;
char *tmp;
- __u64 cr_flags;
BUILD_BUG_ON(sizeof(struct mdt_rec_reint) !=
sizeof(struct mdt_rec_create));
*
* \retval 0 if getting the parent FID succeeds.
* \retval negative errno if getting the parent FID fails.
- **/
+ */
static inline int mdd_parent_fid(const struct lu_env *env,
struct mdd_object *obj,
const struct lu_attr *attr,
RETURN(result);
}
-/**
+/*
* Determine if the target object can be hard linked, and right now it only
* checks if the link count reach the maximum limit. Note: for ldiskfs, the
* directory nlink count might exceed the maximum link count(see
* XXX: Setting the lov ea is not locked but setting the attr is locked?
* Should this be fixed?
*/
- CDEBUG(D_OTHER, "ea %p/%u, cr_flags %#llo, no_create %u\n",
+ CDEBUG(D_OTHER, "ea %p/%u, cr_flags %#lo, no_create %u\n",
spec->u.sp_ea.eadata, spec->u.sp_ea.eadatalen,
spec->sp_cr_flags, spec->no_create);
struct mdd_object_user {
struct list_head mou_list; /* linked off mod_users */
- u64 mou_open_flags; /* open mode by client */
+ enum mds_open_flags mou_open_flags; /* open mode by client */
__u64 mou_uidgid; /* uid_gid on client */
int mou_opencount; /* # opened */
/* time of next access denied notificaiton */
static inline bool has_prefix(const char *str, const char *prefix);
-
-static u32 flags_helper(u64 open_flags)
+static u32 mdd_open_flags_to_mode(enum mds_open_flags open_flags)
{
u32 open_mode = 0;
return open_mode;
}
-/** Allocate/init a user and its sub-structures.
+/**
+ * mdd_obj_user_alloc() - Allocate/init a user and its sub-structures.
+ *
+ * @flags: open flags passed from client
+ * @uid: client uid
+ * @gid: client gid
*
- * \param flags [IN]
- * \param uid [IN]
- * \param gid [IN]
- * \retval mou [OUT] success valid structure
- * \retval mou [OUT]
+ * Return:
+ * * populate mdd_object_user with valid struct on success
*/
-static struct mdd_object_user *mdd_obj_user_alloc(u64 open_flags,
+static struct mdd_object_user *mdd_obj_user_alloc(enum mds_open_flags o_flags,
uid_t uid, gid_t gid)
{
struct mdd_object_user *mou;
+ enum mds_open_flags open_flags = o_flags;
ENTRY;
}
/**
- * Find if UID/GID already has this file open
+ * mdd_obj_user_find() - Find if UID/GID already has this file open
*
- * Caller should have write-locked \param mdd_obj.
- * \param mdd_obj [IN] mdd_obj
- * \param uid [IN] client uid
- * \param gid [IN] client gid
- * \retval user pointer or NULL if not found
+ * @mdd_obj: Metadata server side object
+ * @uid: Client UID
+ * @gid: Client GID
+ * @open_flags: MDS flags passed from client
+ *
+ * Caller should have write-locked on param @mdd_obj.
+ *
+ * Return: mdd_object_user pointer or NULL if not found
*/
static
struct mdd_object_user *mdd_obj_user_find(struct mdd_object *mdd_obj,
uid_t uid, gid_t gid,
- u64 open_flags)
+ enum mds_open_flags open_flags)
{
struct mdd_object_user *mou;
__u64 uidgid;
uidgid = ((__u64)uid << 32) | gid;
list_for_each_entry(mou, &mdd_obj->mod_users, mou_list) {
if (mou->mou_uidgid == uidgid &&
- flags_helper(mou->mou_open_flags) ==
- flags_helper(open_flags))
+ mdd_open_flags_to_mode(mou->mou_open_flags) ==
+ mdd_open_flags_to_mode(open_flags))
RETURN(mou);
}
RETURN(NULL);
RETURN(0);
}
+
/**
* Remove UID from the list
*
RETURN(0);
}
+
int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
struct lu_attr *la)
{
}
static int mdd_accmode(const struct lu_env *env, const struct lu_attr *la,
- u64 open_flags)
+ enum mds_open_flags open_flags)
{
/* Sadly, NFSD reopens a file repeatedly during operation, so the
* "acc_mode = 0" allowance for newly-created files isn't honoured.
return mds_accmode(open_flags);
}
+/**
+ * mdd_open_sanity_check() - Check if mdd object is valid(not unlinked)
+ *
+ * @env: execution environment for this thread
+ * @obj: metadata object
+ * @attr: common attribute of the object
+ * @open_flags: MDS flags passed from client
+ * @is_replay: Additional params passed to open/create
+ *
+ * Return:
+ * * O on success
+ * * negative errno on failure
+ */
static int mdd_open_sanity_check(const struct lu_env *env,
struct mdd_object *obj,
- const struct lu_attr *attr, u64 open_flags,
- int is_replay)
+ const struct lu_attr *attr,
+ enum mds_open_flags open_flags, int is_replay)
{
unsigned int may_mask;
int rc;
RETURN(0);
}
+/**
+ * mdd_open() - Called when object under metadata is opened
+ *
+ * @env: execution environment for this thread
+ * @obj: metadata object
+ * @open_flags: MDS flags passed from client
+ * @spec: Additional params passed to open/create
+ *
+ * Return:
+ * * 0 on Success
+ * * <0 on Failure
+ */
static int mdd_open(const struct lu_env *env, struct md_object *obj,
- u64 open_flags, struct md_op_spec *spec)
+ enum mds_open_flags open_flags, struct md_op_spec *spec)
{
struct mdd_object *mdd_obj = md2mdd_obj(obj);
struct md_device *md_dev = lu2md_dev(mdd2lu_dev(mdo2mdd(obj)));
/* export data of portals_handle */
const struct mdt_export_data *mfd_owner;
/** open mode provided by client */
- u64 mfd_open_flags;
+ enum mds_open_flags mfd_open_flags;
/** protected by med_open_lock */
struct list_head mfd_list;
/** xid of the open request */
int mdt_lock_new_child(struct mdt_thread_info *info,
struct mdt_object *o,
struct mdt_lock_handle *child_lockh);
-void mdt_mfd_set_mode(struct mdt_file_data *mfd, u64 open_flags);
+void mdt_mfd_set_mode(struct mdt_file_data *mfd, enum mds_open_flags o_flags);
int mdt_reint_open(struct mdt_thread_info *info, struct mdt_lock_handle *lhc);
struct mdt_file_data *mdt_open_handle2mfd(struct mdt_export_data *med,
const struct lustre_handle *open_handle,
struct mdt_object *child);
void mdt_prep_ma_buf_from_rep(struct mdt_thread_info *info,
struct mdt_object *obj, struct md_attr *ma,
- __u64 open_flags);
+ enum mds_open_flags open_flags);
+
static inline struct mdt_device *mdt_dev(struct lu_device *d)
{
EXIT;
}
-void mdt_mfd_set_mode(struct mdt_file_data *mfd, u64 open_flags)
+/**
+ * mdt_mfd_set_mode() - Set MDS open flags into @mfd
+ *
+ * @mfd: mdt_file_data object per open handle
+ * @open_flags: open flags passed from client
+ */
+void mdt_mfd_set_mode(struct mdt_file_data *mfd, enum mds_open_flags open_flags)
{
LASSERT(mfd != NULL);
- CDEBUG(D_DENTRY, DFID " Change mfd open_flags %#llo -> %#llo.\n",
+ CDEBUG(D_DENTRY, DFID " Change mfd open_flags %#lo -> %#lo.\n",
PFID(mdt_object_fid(mfd->mfd_object)), mfd->mfd_open_flags,
open_flags);
}
/**
- * prep ma_lmm/ma_lmv for md_attr from reply
+ * mdt_prep_ma_buf_from_rep() - prep ma_lmm/ma_lmv for md_attr from reply
+ *
+ * @info: Common data shared by mdt-level handlers
+ * @obj: metadata object
+ * @ma: attributes to be evaluated for that object
+ * @open_flags: open flags passed from client
+ *
+ * Return:
+ * * void
*/
void mdt_prep_ma_buf_from_rep(struct mdt_thread_info *info,
struct mdt_object *obj, struct md_attr *ma,
- __u64 open_flags)
+ enum mds_open_flags open_flags)
{
struct req_capsule *pill;
}
}
+/*
+ * mdt_mfd_open() - open object in metadata server
+ *
+ * @info: Common data shared by mdt-level handlers
+ * @p: Parent mdt object
+ * @o: Child mdt object
+ * @open_flags: open flags passed from client
+ * @created: Object already existing/created
+ * @rep: ldlm_reply object
+ *
+ * Return:
+ * * 0 on success
+ * * <0 on failure
+ */
static int mdt_mfd_open(struct mdt_thread_info *info, struct mdt_object *p,
- struct mdt_object *o, u64 open_flags, int created,
- struct ldlm_reply *rep)
+ struct mdt_object *o, enum mds_open_flags open_flags,
+ int created, struct ldlm_reply *rep)
{
struct ptlrpc_request *req = mdt_info_req(info);
struct mdt_export_data *med = &req->rq_export->exp_mdt_data;
static int mdt_finish_open(struct mdt_thread_info *info,
struct mdt_object *p, struct mdt_object *o,
- u64 open_flags,
+ enum mds_open_flags open_flags,
struct ldlm_reply *rep)
{
struct ptlrpc_request *req = mdt_info_req(info);
static int mdt_open_by_fid(struct mdt_thread_info *info, struct ldlm_reply *rep,
struct mdt_lock_handle *lhc)
{
- u64 open_flags = info->mti_spec.sp_cr_flags;
+ enum mds_open_flags open_flags = info->mti_spec.sp_cr_flags;
struct mdt_reint_record *rr = &info->mti_rr;
struct md_attr *ma = &info->mti_attr;
struct mdt_object *o;
__u64 *ibits)
{
struct md_attr *ma = &info->mti_attr;
- __u64 open_flags = info->mti_spec.sp_cr_flags;
+ enum mds_open_flags open_flags = info->mti_spec.sp_cr_flags;
__u64 trybits = 0;
enum ldlm_mode lm = LCK_PR;
bool acq_lease = !!(open_flags & MDS_OPEN_LEASE);
/* Lease must be with open lock */
if (!(open_flags & MDS_OPEN_LOCK)) {
CERROR("%s: Request lease for file:"DFID ", but open lock "
- "is missed, open_flags = %#llo : rc = %d\n",
+ "is missed, open_flags = %#lo : rc = %d\n",
mdt_obd_name(info->mti_mdt),
PFID(mdt_object_fid(obj)), open_flags, -EPROTO);
GOTO(out, rc = -EPROTO);
rc = mdt_object_lock_try(info, obj, lhc, ibits, trybits, lm);
CDEBUG(D_INODE, "%s: Requested bits lock:"DFID ", ibits = %#llx/%#llx"
- ", open_flags = %#llo, try_layout = %d : rc = %d\n",
+ ", open_flags = %#lo, try_layout = %d : rc = %d\n",
mdt_obd_name(info->mti_mdt), PFID(mdt_object_fid(obj)),
*ibits, trybits, open_flags, try_layout, rc);
struct mdt_lock_handle *ll = &info->mti_lh[MDT_LH_LAYOUT];
CDEBUG(D_INODE, "Will create layout, get EX layout lock:"DFID
- ", open_flags = %#llo\n",
+ ", open_flags = %#lo\n",
PFID(mdt_object_fid(obj)), open_flags);
/* We cannot enqueue another lock for the same resource we
struct mdt_lock_handle *lhc,
__u64 ibits, int rc)
{
- __u64 open_flags = info->mti_spec.sp_cr_flags;
+ enum mds_open_flags open_flags = info->mti_spec.sp_cr_flags;
struct mdt_lock_handle *ll = &info->mti_lh[MDT_LH_LOCAL];
ENTRY;
static int mdt_cross_open(struct mdt_thread_info *info,
const struct lu_fid *parent_fid,
const struct lu_fid *fid,
- struct ldlm_reply *rep, u64 open_flags)
+ struct ldlm_reply *rep,
+ enum mds_open_flags open_flags)
{
struct md_attr *ma = &info->mti_attr;
struct mdt_object *o;
static inline enum ldlm_mode mdt_open_lock_mode(struct mdt_thread_info *info,
struct mdt_object *p,
struct lu_name *name,
- u64 open_flags)
+ enum mds_open_flags open_flags)
{
int result;
struct lu_fid fid;
struct lu_fid *child_fid = &info->mti_tmp_fid1;
struct lu_ucred *uc = mdt_ucred(info);
struct md_attr *ma = &info->mti_attr;
- u64 open_flags = info->mti_spec.sp_cr_flags;
+ enum mds_open_flags open_flags = info->mti_spec.sp_cr_flags;
u64 ibits = 0;
struct mdt_reint_record *rr = &info->mti_rr;
int result, rc;
GOTO(out, result = -EROFS);
CDEBUG(D_INODE, "I am going to open "DFID"/("DNAME"->"DFID") "
- "cr_flag=%#llo mode=0%06o msg_flag=0x%x\n",
+ "cr_flag=%#lo mode=0%06o msg_flag=0x%x\n",
PFID(rr->rr_fid1), PNAME(&rr->rr_name), PFID(rr->rr_fid2),
open_flags, ma->ma_attr.la_mode, msg_flags);