/* should NOT be called with the dcache lock, see fs/dcache.c */
static void ll_release(struct dentry *de)
{
- struct ll_dentry_data *lld;
- ENTRY;
- LASSERT(de != NULL);
- lld = ll_d2d(de);
- if (lld == NULL) /* NFS copies the de->d_op methods (bug 4655) */
- RETURN_EXIT;
+ struct ll_dentry_data *lld;
+
+ ENTRY;
+ LASSERT(de != NULL);
+ lld = ll_d2d(de);
+ if (lld == NULL) /* NFS copies the de->d_op methods (bug 4655) */
+ RETURN_EXIT;
de->d_fsdata = NULL;
call_rcu(&lld->lld_rcu_head, free_dentry_data);
ldlm_lock_decref(&handle, it->it_lock_mode);
/* bug 494: intent_release may be called multiple times, from
- * this thread and we don't want to double-decref this lock */
+ * this thread and we don't want to double-decref this lock
+ */
it->it_lock_mode = 0;
if (it->it_remote_lock_mode != 0) {
handle.cookie = it->it_remote_lock_handle;
void ll_intent_release(struct lookup_intent *it)
{
- ENTRY;
+ ENTRY;
- CDEBUG(D_INFO, "intent %p released\n", it);
- ll_intent_drop_lock(it);
- /* We are still holding extra reference on a request, need to free it */
- if (it_disposition(it, DISP_ENQ_OPEN_REF))
+ CDEBUG(D_INFO, "intent %p released\n", it);
+ ll_intent_drop_lock(it);
+ /* We are still holding extra reference on a request, need to free it */
+ if (it_disposition(it, DISP_ENQ_OPEN_REF))
ptlrpc_req_finished(it->it_request); /* ll_file_open */
if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
void ll_prune_aliases(struct inode *inode)
{
struct dentry *dentry;
+
ENTRY;
LASSERT(inode != NULL);
d_prune_aliases(inode);
- EXIT;
+ EXIT;
}
int ll_revalidate_it_finish(struct ptlrpc_request *request,
__u64 bits = 0;
int rc = 0;
- ENTRY;
+ ENTRY;
if (!request)
RETURN(0);
if (rc != 1)
return rc;
- /* If this is intermediate component path lookup and we were able to get
- * to this dentry, then its lock has not been revoked and the
- * path component is valid. */
+ /* If this is intermediate component path lookup and were able to get to
+ * this dentry, then its lock has not been revoked and the
+ * path component is valid.
+ */
if (lookup_flags & (LOOKUP_CONTINUE | LOOKUP_PARENT)) {
if (dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) {
parent = dget_parent(dentry);
kunmap(page);
/* Always remove the page for striped dir, because the page is
- * built from temporarily in LMV layer */
+ * built from temporarily in LMV layer
+ */
if (inode && ll_dir_striped(inode)) {
__free_page(page);
return;
bool done = false;
struct llcrypt_str lltr = LLTR_INIT(NULL, 0);
int rc = 0;
+
ENTRY;
if (IS_ENCRYPTED(inode)) {
type = S_DT(lu_dirent_type_get(ent));
/* For ll_nfs_get_name_filldir(), it will try to access
* 'ent' through 'lde_name', so the parameter 'name'
- * for 'filldir()' must be part of the 'ent'. */
+ * for 'filldir()' must be part of the 'ent'.
+ */
#ifdef HAVE_DIR_CONTEXT
ctx->pos = lhash;
if (!IS_ENCRYPTED(inode)) {
}
dput(parent);
- /* If it can not find in cache, do lookup .. on the master
- * object */
+ /* If it can not find in cache, do lookup on the master obj */
if (fid_is_zero(&pfid)) {
rc = ll_dir_get_parent_fid(inode, &pfid);
if (rc != 0)
RETURN(rc);
}
-/**
+/*
* Create striped directory with specified stripe(@lump)
*
* \param[in] dparent the parent of the directory.
if (test_bit(LL_SBI_FILE_SECCTX, sbi->ll_flags)) {
/* selinux_dentry_init_security() uses dentry->d_parent and name
* to determine the security context for the file. So our fake
- * dentry should be real enough for this purpose. */
+ * dentry should be real enough for this purpose.
+ */
err = ll_dentry_init_security(&dentry, mode, &dentry.d_name,
&op_data->op_file_secctx_name,
&op_data->op_file_secctx_name_size,
struct ptlrpc_request *req = NULL;
int rc = 0;
int lum_size;
- ENTRY;
+ ENTRY;
if (lump != NULL) {
switch (lump->lmm_magic) {
case LOV_USER_MAGIC_V1:
return rc;
}
-/**
+/*
* This function will be used to get default LOV/LMV/Default LMV
* @valid will be used to indicate which stripe it will retrieve.
* If the directory does not have its own default layout, then the
struct lov_mds_md *lmm = NULL;
int lmm_size = 0;
int rc = 0;
- ENTRY;
+ ENTRY;
rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
&req, valid, 0);
if (rc == -ENODATA && !fid_is_root(ll_inode2fid(inode)) &&
RETURN(rc);
}
-/**
+/*
* This function will be used to get default LOV/LMV/Default LMV
* @valid will be used to indicate which stripe it will retrieve
* OBD_MD_MEA LMV stripe EA
struct lov_mds_md *lmm = NULL;
int lmm_size = 0;
int rc = 0;
- ENTRY;
+ ENTRY;
rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
&req, valid, 0);
int ll_get_mdt_idx_by_fid(struct ll_sb_info *sbi, const struct lu_fid *fid)
{
- struct md_op_data *op_data;
- int rc;
- int mdt_index;
- ENTRY;
+ struct md_op_data *op_data;
+ int rc;
+ int mdt_index;
+ ENTRY;
OBD_ALLOC_PTR(op_data);
if (op_data == NULL)
RETURN(-ENOMEM);
return ll_get_mdt_idx_by_fid(ll_i2sbi(inode), ll_inode2fid(inode));
}
-/**
+/*
* Generic handler to do any pre-copy work.
*
* It sends a first hsm_progress (with extent length == 0) to coordinator as a
*/
static int ll_ioc_copy_start(struct super_block *sb, struct hsm_copy *copy)
{
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- struct hsm_progress_kernel hpk;
- int rc = 0;
- int rc2;
- ENTRY;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct hsm_progress_kernel hpk;
+ int rc = 0;
+ int rc2;
+ ENTRY;
/* Forge a hsm_progress based on data from copy. */
hpk.hpk_fid = copy->hc_hai.hai_fid;
hpk.hpk_cookie = copy->hc_hai.hai_cookie;
}
/* Store in the hsm_copy for later copytool use.
- * Always modified even if no lsm. */
+ * Always modified even if no lsm.
+ */
copy->hc_data_version = data_version;
}
RETURN(rc != 0 ? rc : rc2);
}
-/**
+/*
* Generic handler to do any post-copy work.
*
* It will send the last hsm_progress update to coordinator to inform it
*/
static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
{
- struct ll_sb_info *sbi = ll_s2sbi(sb);
- struct hsm_progress_kernel hpk;
- int rc = 0;
- int rc2;
- ENTRY;
+ struct ll_sb_info *sbi = ll_s2sbi(sb);
+ struct hsm_progress_kernel hpk;
+ int rc = 0;
+ int rc2;
+ ENTRY;
/* If you modify the logic here, also check llapi_hsm_copy_end(). */
/* Take care: copy->hc_hai.hai_action, len, gid and data are not
* initialized if copy_end was called with copy == NULL.
}
/* Store in the hsm_copy for later copytool use.
- * Always modified even if no lsm. */
+ * Always modified even if no lsm.
+ */
hpk.hpk_data_version = data_version;
/* File could have been stripped during archiving, so we need
- * to check anyway. */
+ * to check anyway.
+ */
if ((copy->hc_hai.hai_action == HSMA_ARCHIVE) &&
(copy->hc_data_version != data_version)) {
CDEBUG(D_HSM, "File data version mismatched. "
* the cdt will loop on retried archive requests.
* The policy engine will ask for a new archive later
* when the file will not be modified for some tunable
- * time */
+ * time
+ */
hpk.hpk_flags &= ~HP_FLAG_RETRY;
rc = -EBUSY;
/* hpk_errval must be >= 0 */
unsigned int nr;
bool lfa_flag = false; /* lfa already free'ed */
size_t size;
- ENTRY;
+ ENTRY;
if (!capable(CAP_DAC_READ_SEARCH) &&
!test_bit(LL_SBI_USER_FID2PATH, ll_i2sbi(inode)->ll_flags))
RETURN(-EPERM);
RETURN(rc);
}
-/* This function tries to get a single name component,
- * to send to the server. No actual path traversal involved,
- * so we limit to NAME_MAX */
+/* This function tries to get a single name component, to send to the server.
+ * No actual path traversal involved, so we limit to NAME_MAX
+ */
static char *ll_getname(const char __user *filename)
{
int ret = 0, len;
struct obd_ioctl_data *data = NULL;
void __user *uarg = (void __user *)arg;
int rc = 0;
- ENTRY;
+ ENTRY;
CDEBUG(D_VFSTRACE|D_IOCTL, "VFS Op:inode="DFID"(%pK) cmd=%x arg=%lx\n",
PFID(ll_inode2fid(inode)), inode, cmd, arg);
max_stripe_count = lum.lum_stripe_count;
/* lum_magic will indicate which stripe the ioctl will like
* to get, LMV_MAGIC_V1 is for normal LMV stripe, LMV_USER_MAGIC
- * is for default LMV stripe */
+ * is for default LMV stripe
+ */
if (lum.lum_magic == LMV_MAGIC_V1)
valid |= OBD_MD_MEA;
else if (lum.lum_magic == LMV_USER_MAGIC)
return rc;
}
case LL_IOC_REMOVE_ENTRY: {
- char *filename = NULL;
- int namelen = 0;
- int rc;
+ char *filename = NULL;
+ int namelen = 0;
+ int rc;
/* Here is a little hack to avoid sending REINT_RMENTRY to
* unsupported server, which might crash the server(LU-2730),
* Because both LVB_TYPE and REINT_RMENTRY will be supported
* on 2.4, we use OBD_CONNECT_LVB_TYPE to detect whether the
- * server will support REINT_RMENTRY XXX*/
+ * server will support REINT_RMENTRY XXX
+ */
if (!(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_LVB_TYPE))
RETURN(-EOPNOTSUPP);
if (lmmsize == 0) {
/* If the file has no striping then zero out *lump so
- * that the caller isn't confused by garbage. */
+ * that the caller isn't confused by garbage.
+ */
if (clear_user(lump, sizeof(*lump)))
GOTO(out_req, rc = -EFAULT);
} else if (copy_to_user(lump, lmm, lmmsize)) {
* set, also set ext4 equivalent to please statx
*/
if (body->mbo_flags & LUSTRE_ENCRYPT_FL)
- stx.stx_attributes |= STATX_ATTR_ENCRYPTED;
+ stx.stx_attributes |=
+ STATX_ATTR_ENCRYPTED;
}
/* For a striped directory, the size and blocks returned
hpk.hpk_data_version = 0;
/* File may not exist in Lustre; all progress
- * reported to Lustre root */
+ * reported to Lustre root
+ */
rc = obd_iocontrol(cmd, sbi->ll_md_exp, sizeof(hpk), &hpk,
NULL);
RETURN(rc);
struct ll_sb_info *sbi = ll_i2sbi(inode);
int api32 = ll_need_32bit_api(sbi);
loff_t ret = -EINVAL;
- ENTRY;
+ ENTRY;
ll_inode_lock(inode);
switch (origin) {
case SEEK_SET: