/* turn off the kernel's read-ahead */
file->f_ra.ra_pages = 0;
- /* ll_cl_context initialize */
- rwlock_init(&fd->fd_lock);
- INIT_LIST_HEAD(&fd->fd_lccs);
-
RETURN(0);
}
range_locked = true;
}
- ll_cl_add(file, env, io, LCC_RW);
+ ll_cl_add(inode, env, io, LCC_RW);
rc = cl_io_loop(env, io);
- ll_cl_remove(file, env);
+ ll_cl_remove(inode, env);
if (range_locked && !is_parallel_dio) {
CDEBUG(D_VFSTRACE, "Range unlock "RL_FMT"\n",
if (result > 0) {
ll_heat_add(inode, CIT_WRITE, result);
- ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_WRITE_BYTES,
- result);
set_bit(LLIF_DATA_MODIFIED, &ll_i2info(inode)->lli_flags);
}
ENTRY;
if (!capable(CAP_DAC_READ_SEARCH) &&
- !(ll_i2sbi(inode)->ll_flags & LL_SBI_USER_FID2PATH))
+ !test_bit(LL_SBI_USER_FID2PATH, ll_i2sbi(inode)->ll_flags))
RETURN(-EPERM);
/* Only need to get the buflen */
if (ioc->lil_count != 1)
RETURN(-EINVAL);
+ if (IS_ENCRYPTED(inode))
+ RETURN(-EOPNOTSUPP);
+
arg += sizeof(*ioc);
if (copy_from_user(¶m.pa_archive_id, (void __user *)arg,
sizeof(__u32)))
if (rc != 0)
RETURN(rc);
+ spin_lock(&inode->i_lock);
set_nlink(inode, attr.cat_nlink);
+ spin_unlock(&inode->i_lock);
+
inode->i_blocks = attr.cat_blocks;
i_size_write(inode, attr.cat_size);
squash = &sbi->ll_squash;
if (unlikely(squash->rsi_uid != 0 &&
uid_eq(current_fsuid(), GLOBAL_ROOT_UID) &&
- !(sbi->ll_flags & LL_SBI_NOROOTSQUASH))) {
+ !test_bit(LL_SBI_NOROOTSQUASH, sbi->ll_flags))) {
squash_id = true;
}
if (squash_id) {
{
const struct file_operations *fops = &ll_file_operations_noflock;
- if (sbi->ll_flags & LL_SBI_FLOCK)
+ if (test_bit(LL_SBI_FLOCK, sbi->ll_flags))
fops = &ll_file_operations_flock;
- else if (sbi->ll_flags & LL_SBI_LOCALFLOCK)
+ else if (test_bit(LL_SBI_LOCALFLOCK, sbi->ll_flags))
fops = &ll_file_operations;
return fops;
ENTRY;
*gen = ll_layout_version_get(lli);
- if (!(sbi->ll_flags & LL_SBI_LAYOUT_LOCK) || *gen != CL_LAYOUT_GEN_NONE)
+ if (!test_bit(LL_SBI_LAYOUT_LOCK, sbi->ll_flags) ||
+ *gen != CL_LAYOUT_GEN_NONE)
RETURN(0);
/* sanity checks */