int flags = vvp_io_args_flags(file, args);
io->u.ci_rw.crw_nonblock = file->f_flags & O_NONBLOCK;
- io->ci_lock_no_expand = lfd->ll_lock_no_expand;
+ io->ci_lock_no_expand = lfd->lfd_lock_no_expand;
if (iot == CIT_WRITE) {
io->u.ci_wr.wr_append = iocb_ki_flags_check(flags, APPEND);
{
struct ll_file_data *lfd = file->private_data;
- lfd->ll_lock_no_expand = !(flags & LF_UNSET);
+ lfd->lfd_lock_no_expand = !(flags & LF_UNSET);
return 0;
}
__u32 lli_inode_magic;
rwlock_t lli_lock;
+ __u32 lli_projid; /* project id */
+
volatile unsigned long lli_flags;
struct posix_acl *lli_posix_acl;
/* for writepage() only to communicate to fsync */
int lli_async_rc;
+ __u32 lli_heat_flags;
/* protect the file heat fields */
- spinlock_t lli_heat_lock;
- __u32 lli_heat_flags;
- struct obd_heat_instance lli_heat_instances[OBD_HEAT_COUNT];
+ spinlock_t lli_heat_lock;
+ struct obd_heat_instance lli_heat_instances[OBD_HEAT_COUNT];
/*
* Whenever a process try to read/write the file, the
seqlock_t lli_jobinfo_seqlock;
struct job_info lli_jobinfo;
- struct mutex lli_pcc_lock;
- enum lu_pcc_state_flags lli_pcc_state;
- atomic_t lli_pcc_mapcnt;
+ struct mutex lli_pcc_lock;
+ enum lu_pcc_state_flags lli_pcc_state;
+ atomic_t lli_pcc_mapcnt;
/*
* I/O for a file previously opened before attach into
* PCC or once opened while in ATTACHING state will
* Lustre file when mmaped a file.
*/
atomic_t lli_pcc_mapneg;
+ enum pcc_dataset_flags lli_pcc_dsflags;
/*
* @lli_pcc_generation saves the gobal PCC generation
* when the file was successfully attached into PCC.
* safely.
*/
__u64 lli_pcc_generation;
- enum pcc_dataset_flags lli_pcc_dsflags;
struct pcc_inode *lli_pcc_inode;
struct mutex lli_group_mutex;
__u32 lli_layout_gen;
spinlock_t lli_layout_lock;
- __u32 lli_projid; /* project id */
-
struct rw_semaphore lli_xattrs_list_rwsem;
struct mutex lli_xattrs_enq_lock;
struct list_head lli_xattrs; /* ll_xattr_entry->xe_list*/
/* flags for sbi->ll_flags */
enum ll_sbi_flags {
- LL_SBI_NOLCK, /* DLM locking disabled directio-only */
- LL_SBI_CHECKSUM, /* checksum each page as it's written */
- LL_SBI_LOCALFLOCK, /* local flocks instead of fs-wide */
- LL_SBI_FLOCK, /* flock enabled */
- LL_SBI_USER_XATTR, /* support user xattr */
- LL_SBI_LRU_RESIZE, /* lru resize support */
- LL_SBI_LAZYSTATFS, /* lazystatfs mount option */
LL_SBI_32BIT_API, /* generate 32 bit inodes. */
- LL_SBI_USER_FID2PATH, /* fid2path by unprivileged users */
- LL_SBI_VERBOSE, /* verbose mount/umount */
LL_SBI_ALWAYS_PING, /* ping even if server suppress_pings */
- LL_SBI_TEST_DUMMY_ENCRYPTION, /* test dummy encryption */
+ LL_SBI_CHECKSUM, /* checksum each page as it's written */
LL_SBI_ENCRYPT, /* client side encryption */
+ LL_SBI_FLOCK, /* flock enabled */
+ LL_SBI_LOCALFLOCK, /* local flocks instead of fs-wide */
LL_SBI_FOREIGN_SYMLINK, /* foreign fake-symlink support */
LL_SBI_FOREIGN_SYMLINK_UPCALL, /* foreign fake-symlink upcall set */
+ LL_SBI_LAZYSTATFS, /* lazystatfs mount option */
+ LL_SBI_LRU_RESIZE, /* lru resize support */
+ LL_SBI_NOLCK, /* DLM locking disabled directio-only */
LL_SBI_STATFS_PROJECT, /* statfs returns project quota */
+ LL_SBI_TEST_DUMMY_ENCRYPTION, /* test dummy encryption */
+ LL_SBI_USER_FID2PATH, /* fid2path by unprivileged users */
+ LL_SBI_USER_XATTR, /* support user xattr */
+ LL_SBI_VERBOSE, /* verbose mount/umount */
LL_SBI_NUM_MOUNT_OPT,
+ LL_SBI_64BIT_HASH, /* support 64-bits dir hash/offset */
LL_SBI_ACL, /* support ACL */
LL_SBI_AGL_ENABLED, /* enable agl */
- LL_SBI_64BIT_HASH, /* support 64-bits dir hash/offset */
- LL_SBI_LAYOUT_LOCK, /* layout lock support */
- LL_SBI_XATTR_CACHE, /* support for xattr cache */
- LL_SBI_NOROOTSQUASH, /* do not apply root squash */
+ LL_SBI_ENCRYPT_NAME, /* name encryption */
LL_SBI_FAST_READ, /* fast read support */
- LL_SBI_FILE_SECCTX, /* file security context at create */
- LL_SBI_TINY_WRITE, /* tiny write support */
LL_SBI_FILE_HEAT, /* file heat support */
+ LL_SBI_FILE_SECCTX, /* file security context at create */
+ LL_SBI_HYBRID_IO, /* allow BIO as DIO */
+ LL_SBI_LAYOUT_LOCK, /* layout lock support */
+ LL_SBI_NOROOTSQUASH, /* do not apply root squash */
LL_SBI_PARALLEL_DIO, /* parallel (async) O_DIRECT RPCs */
- LL_SBI_ENCRYPT_NAME, /* name encryption */
+ LL_SBI_TINY_WRITE, /* tiny write support */
LL_SBI_UNALIGNED_DIO, /* unaligned DIO */
- LL_SBI_HYBRID_IO, /* allow BIO as DIO */
+ LL_SBI_XATTR_CACHE, /* support for xattr cache */
LL_SBI_NUM_FLAGS
};
DECLARE_BITMAP(ll_flags, LL_SBI_NUM_FLAGS); /* enum ll_sbi_flags */
gid_t ll_enable_setstripe_gid; /* */
- unsigned int ll_xattr_cache_enabled:1,
- ll_xattr_cache_set:1, /* already set to 0/1 */
+ unsigned int ll_checksum_set:1,
ll_client_common_fill_super_succeeded:1,
- ll_checksum_set:1,
- ll_inode_cache_enabled:1,
+ ll_dir_open_read:1,
ll_enable_statahead_fname:1,
+ ll_inode_cache_enabled:1,
ll_intent_mkdir_enabled:1,
- ll_dir_open_read:1;
-
+ ll_sync_on_close:1,
+ ll_xattr_cache_enabled:1,
+ ll_xattr_cache_set:1; /* already set to 0/1 */
struct lustre_client_ocd ll_lco;
extern struct kmem_cache *ll_file_data_slab;
struct lustre_handle;
struct ll_file_data {
- struct ll_readahead_state fd_ras;
- struct ll_grouplock fd_grouplock;
- __u64 lfd_pos;
- __u32 fd_flags;
- enum mds_open_flags fd_open_mode;
+ struct file *fd_file;
+ __u64 lfd_pos;
/* openhandle if lease exists for this file.
* Borrow lli->lli_och_mutex to protect assignment
*/
- struct obd_client_handle *fd_lease_och;
- struct obd_client_handle *fd_och;
- struct file *fd_file;
+ struct obd_client_handle *fd_lease_och;
+ struct obd_client_handle *fd_och;
+ struct ll_readahead_state fd_ras;
/* Indicate whether need to report failure when close.
* true: failure is known, not report again.
* false: unknown failure, should report.
*/
- bool fd_write_failed;
- bool ll_lock_no_expand;
+ bool fd_write_failed;
+ unsigned int lfd_lock_no_expand:1;
+ __u32 fd_flags;
+ enum mds_open_flags fd_open_mode;
+ /* striped directory may read partially if some stripe inaccessible,
+ * -errno is saved here, and will return to user in close().
+ */
+ int fd_partial_readdir_rc;
/* Used by mirrored file to lead IOs to a specific mirror, usually
* for mirror resync. 0 means default.
*/
- __u32 fd_designated_mirror;
+ __u32 fd_designated_mirror;
/* The layout version when resync starts. Resync I/O should carry this
* layout version for verification to OST objects
*/
- __u32 fd_layout_version;
- struct pcc_file fd_pcc_file;
- /* striped directory may read partially if some stripe inaccessible,
- * -errno is saved here, and will return to user in close().
- */
- int fd_partial_readdir_rc;
+ __u32 fd_layout_version;
+ struct ll_grouplock fd_grouplock;
+ struct pcc_file fd_pcc_file;
/* mdtest unique/shared dir stat mode: per process statahead struct. */
- struct ll_statahead_info *fd_sai;
+ struct ll_statahead_info *fd_sai;
};
void llite_tunables_unregister(void);
* for the sbi_flags.
*/
static const match_table_t ll_sbi_flags_name = {
- {LL_SBI_NOLCK, "nolock"},
+ {LL_SBI_32BIT_API, "32bitapi"},
{LL_SBI_CHECKSUM, "checksum"},
{LL_SBI_CHECKSUM, "nochecksum"},
- {LL_SBI_LOCALFLOCK, "localflock"},
+ {LL_SBI_ENCRYPT, "encrypt"},
+ {LL_SBI_ENCRYPT, "noencrypt"},
{LL_SBI_FLOCK, "flock"},
{LL_SBI_FLOCK, "noflock"},
- {LL_SBI_USER_XATTR, "user_xattr"},
- {LL_SBI_USER_XATTR, "nouser_xattr"},
- {LL_SBI_LRU_RESIZE, "lruresize"},
- {LL_SBI_LRU_RESIZE, "nolruresize"},
+ {LL_SBI_LOCALFLOCK, "localflock"},
+ {LL_SBI_FOREIGN_SYMLINK, "foreign_symlink=%s"},
{LL_SBI_LAZYSTATFS, "lazystatfs"},
{LL_SBI_LAZYSTATFS, "nolazystatfs"},
- {LL_SBI_32BIT_API, "32bitapi"},
+ {LL_SBI_LRU_RESIZE, "lruresize"},
+ {LL_SBI_LRU_RESIZE, "nolruresize"},
+ {LL_SBI_NOLCK, "nolock"},
+ {LL_SBI_STATFS_PROJECT, "statfs_project"},
+ {LL_SBI_STATFS_PROJECT, "nostatfs_project"},
+ {LL_SBI_TEST_DUMMY_ENCRYPTION, "test_dummy_encryption=%s"},
+ {LL_SBI_TEST_DUMMY_ENCRYPTION, "test_dummy_encryption"},
{LL_SBI_USER_FID2PATH, "user_fid2path"},
{LL_SBI_USER_FID2PATH, "nouser_fid2path"},
+ {LL_SBI_USER_XATTR, "user_xattr"},
+ {LL_SBI_USER_XATTR, "nouser_xattr"},
{LL_SBI_VERBOSE, "verbose"},
{LL_SBI_VERBOSE, "noverbose"},
{LL_SBI_ALWAYS_PING, "always_ping"},
- {LL_SBI_TEST_DUMMY_ENCRYPTION, "test_dummy_encryption=%s"},
- {LL_SBI_TEST_DUMMY_ENCRYPTION, "test_dummy_encryption"},
- {LL_SBI_ENCRYPT, "encrypt"},
- {LL_SBI_ENCRYPT, "noencrypt"},
- {LL_SBI_FOREIGN_SYMLINK, "foreign_symlink=%s"},
- {LL_SBI_STATFS_PROJECT, "statfs_project"},
- {LL_SBI_STATFS_PROJECT, "nostatfs_project"},
{LL_SBI_NUM_MOUNT_OPT, NULL},
+ {LL_SBI_64BIT_HASH, "64bit_hash"},
{LL_SBI_ACL, "acl"},
{LL_SBI_AGL_ENABLED, "agl"},
- {LL_SBI_64BIT_HASH, "64bit_hash"},
- {LL_SBI_LAYOUT_LOCK, "layout"},
- {LL_SBI_XATTR_CACHE, "xattr_cache"},
- {LL_SBI_NOROOTSQUASH, "norootsquash"},
+ {LL_SBI_ENCRYPT_NAME, "name_encrypt"},
{LL_SBI_FAST_READ, "fast_read"},
- {LL_SBI_FILE_SECCTX, "file_secctx"},
- {LL_SBI_TINY_WRITE, "tiny_write"},
{LL_SBI_FILE_HEAT, "file_heat"},
- {LL_SBI_PARALLEL_DIO, "parallel_dio"},
+ {LL_SBI_FILE_SECCTX, "file_secctx"},
{LL_SBI_HYBRID_IO, "hybrid_io"},
- {LL_SBI_ENCRYPT_NAME, "name_encrypt"},
+ {LL_SBI_LAYOUT_LOCK, "layout"},
+ {LL_SBI_NOROOTSQUASH, "norootsquash"},
+ {LL_SBI_PARALLEL_DIO, "parallel_dio"},
+ {LL_SBI_TINY_WRITE, "tiny_write"},
{LL_SBI_UNALIGNED_DIO, "unaligned_dio"},
+ {LL_SBI_XATTR_CACHE, "xattr_cache"},
};
int ll_sbi_flags_seq_show(struct seq_file *m, void *v)
}
switch (token) {
- case LL_SBI_NOLCK:
case LL_SBI_32BIT_API:
case LL_SBI_64BIT_HASH:
case LL_SBI_ALWAYS_PING:
+ case LL_SBI_NOLCK:
set_bit(token, sbi->ll_flags);
break;
} else {
LCONSOLE_ERROR("invalid %s option\n", s1);
}
- fallthrough;
+ break;
default:
break;
}
&lustre_attr_foreign_symlink_upcall.attr,
&lustre_attr_foreign_symlink_upcall_info.attr,
&lustre_attr_fstype.attr,
- &lustre_attr_uuid.attr,
+ &lustre_attr_heat_decay_percentage.attr,
+ &lustre_attr_heat_period_second.attr,
+ &lustre_attr_hybrid_io.attr,
+ &lustre_attr_hybrid_io_write_threshold_bytes.attr,
+ &lustre_attr_hybrid_io_read_threshold_bytes.attr,
+ &lustre_attr_inode_cache.attr,
&lustre_attr_checksums.attr,
&lustre_attr_checksum_pages.attr,
&lustre_attr_max_easize.attr,
&lustre_attr_max_read_ahead_async_active.attr,
&lustre_attr_maxbytes.attr,
&lustre_attr_namelen_max.attr,
+ &lustre_attr_opencache_threshold_count.attr,
+ &lustre_attr_opencache_threshold_ms.attr,
+ &lustre_attr_opencache_max_ms.attr,
+ &lustre_attr_parallel_dio.attr,
+ &lustre_attr_pcc_async_threshold.attr,
+ &lustre_attr_pcc_mode.attr,
+ &lustre_attr_pcc_async_affinity.attr,
&lustre_attr_read_ahead_async_file_threshold_mb.attr,
&lustre_attr_read_ahead_range_kb.attr,
&lustre_attr_stat_blocksize.attr,
&lustre_attr_intent_mkdir.attr,
&lustre_attr_fast_read.attr,
&lustre_attr_tiny_write.attr,
- &lustre_attr_parallel_dio.attr,
&lustre_attr_unaligned_dio.attr,
- &lustre_attr_hybrid_io.attr,
&lustre_attr_enable_setstripe_gid.attr,
&lustre_attr_file_heat.attr,
- &lustre_attr_heat_decay_percentage.attr,
- &lustre_attr_heat_period_second.attr,
- &lustre_attr_opencache_threshold_count.attr,
- &lustre_attr_opencache_threshold_ms.attr,
- &lustre_attr_opencache_max_ms.attr,
- &lustre_attr_inode_cache.attr,
- &lustre_attr_hybrid_io_write_threshold_bytes.attr,
- &lustre_attr_hybrid_io_read_threshold_bytes.attr,
#ifdef CONFIG_LL_ENCRYPTION
&lustre_attr_enable_filename_encryption.attr,
#endif
#if defined(CONFIG_LL_ENCRYPTION) || defined(HAVE_LUSTRE_CRYPTO)
&lustre_attr_filename_enc_use_old_base64.attr,
#endif
- &lustre_attr_pcc_async_threshold.attr,
- &lustre_attr_pcc_mode.attr,
- &lustre_attr_pcc_async_affinity.attr,
+ &lustre_attr_uuid.attr,
&lustre_attr_dir_read_on_open.attr,
NULL,
};