Lines Matching refs:ctx

3902 	struct shmem_options *ctx = fc->fs_private;
3925 ctx->blocks = DIV_ROUND_UP(size, PAGE_SIZE);
3926 ctx->seen |= SHMEM_SEEN_BLOCKS;
3929 ctx->blocks = memparse(param->string, &rest);
3930 if (*rest || ctx->blocks > LONG_MAX)
3932 ctx->seen |= SHMEM_SEEN_BLOCKS;
3935 ctx->inodes = memparse(param->string, &rest);
3936 if (*rest || ctx->inodes > ULONG_MAX / BOGO_INODE_SIZE)
3938 ctx->seen |= SHMEM_SEEN_INODES;
3941 ctx->mode = result.uint_32 & 07777;
3955 ctx->uid = kuid;
3969 ctx->gid = kgid;
3972 ctx->huge = result.uint_32;
3973 if (ctx->huge != SHMEM_HUGE_NEVER &&
3977 ctx->seen |= SHMEM_SEEN_HUGE;
3981 mpol_put(ctx->mpol);
3982 ctx->mpol = NULL;
3983 if (mpol_parse_str(param->string, &ctx->mpol))
3989 ctx->full_inums = false;
3990 ctx->seen |= SHMEM_SEEN_INUMS;
3997 ctx->full_inums = true;
3998 ctx->seen |= SHMEM_SEEN_INUMS;
4005 ctx->noswap = true;
4006 ctx->seen |= SHMEM_SEEN_NOSWAP;
4011 ctx->seen |= SHMEM_SEEN_QUOTA;
4012 ctx->quota_types |= (QTYPE_MASK_USR | QTYPE_MASK_GRP);
4017 ctx->seen |= SHMEM_SEEN_QUOTA;
4018 ctx->quota_types |= QTYPE_MASK_USR;
4023 ctx->seen |= SHMEM_SEEN_QUOTA;
4024 ctx->quota_types |= QTYPE_MASK_GRP;
4033 ctx->qlimits.usrquota_bhardlimit = size;
4042 ctx->qlimits.grpquota_bhardlimit = size;
4051 ctx->qlimits.usrquota_ihardlimit = size;
4060 ctx->qlimits.grpquota_ihardlimit = size;
4120 struct shmem_options *ctx = fc->fs_private;
4129 if ((ctx->seen & SHMEM_SEEN_BLOCKS) && ctx->blocks) {
4135 ctx->blocks) > 0) {
4140 if ((ctx->seen & SHMEM_SEEN_INODES) && ctx->inodes) {
4145 if (ctx->inodes * BOGO_INODE_SIZE < used_isp) {
4151 if ((ctx->seen & SHMEM_SEEN_INUMS) && !ctx->full_inums &&
4156 if ((ctx->seen & SHMEM_SEEN_NOSWAP) && ctx->noswap && !sbinfo->noswap) {
4160 if (!(ctx->seen & SHMEM_SEEN_NOSWAP) && !ctx->noswap && sbinfo->noswap) {
4165 if (ctx->seen & SHMEM_SEEN_QUOTA &&
4173 (ctx->qlimits.name## hardlimit && \
4174 (ctx->qlimits.name## hardlimit != sbinfo->qlimits.name## hardlimit))
4183 if (ctx->seen & SHMEM_SEEN_HUGE)
4184 sbinfo->huge = ctx->huge;
4185 if (ctx->seen & SHMEM_SEEN_INUMS)
4186 sbinfo->full_inums = ctx->full_inums;
4187 if (ctx->seen & SHMEM_SEEN_BLOCKS)
4188 sbinfo->max_blocks = ctx->blocks;
4189 if (ctx->seen & SHMEM_SEEN_INODES) {
4190 sbinfo->max_inodes = ctx->inodes;
4191 sbinfo->free_ispace = ctx->inodes * BOGO_INODE_SIZE - used_isp;
4197 if (ctx->mpol) {
4199 sbinfo->mpol = ctx->mpol; /* transfers initial ref */
4200 ctx->mpol = NULL;
4203 if (ctx->noswap)
4285 struct shmem_options *ctx = fc->fs_private;
4305 if (!(ctx->seen & SHMEM_SEEN_BLOCKS))
4306 ctx->blocks = shmem_default_max_blocks();
4307 if (!(ctx->seen & SHMEM_SEEN_INODES))
4308 ctx->inodes = shmem_default_max_inodes();
4309 if (!(ctx->seen & SHMEM_SEEN_INUMS))
4310 ctx->full_inums = IS_ENABLED(CONFIG_TMPFS_INODE64);
4311 sbinfo->noswap = ctx->noswap;
4320 sbinfo->max_blocks = ctx->blocks;
4321 sbinfo->max_inodes = ctx->inodes;
4328 sbinfo->uid = ctx->uid;
4329 sbinfo->gid = ctx->gid;
4330 sbinfo->full_inums = ctx->full_inums;
4331 sbinfo->mode = ctx->mode;
4332 sbinfo->huge = ctx->huge;
4333 sbinfo->mpol = ctx->mpol;
4334 ctx->mpol = NULL;
4357 if (ctx->seen & SHMEM_SEEN_QUOTA) {
4362 /* Copy the default limits from ctx into sbinfo */
4363 memcpy(&sbinfo->qlimits, &ctx->qlimits,
4366 if (shmem_enable_quotas(sb, ctx->quota_types))
4396 struct shmem_options *ctx = fc->fs_private;
4398 if (ctx) {
4399 mpol_put(ctx->mpol);
4400 kfree(ctx);
4582 struct shmem_options *ctx;
4584 ctx = kzalloc(sizeof(struct shmem_options), GFP_KERNEL);
4585 if (!ctx)
4588 ctx->mode = 0777 | S_ISVTX;
4589 ctx->uid = current_fsuid();
4590 ctx->gid = current_fsgid();
4592 fc->fs_private = ctx;