Re: [PATCH V3 3/7] fscrypt: remove struct fscrypt_ctx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Jun 16, 2019 at 09:38:09PM +0530, Chandan Rajendra wrote:
> -/**
> - * fscrypt_get_ctx() - Get a decryption context
> - * @gfp_flags:   The gfp flag for memory allocation
> - *
> - * Allocate and initialize a decryption context.
> - *
> - * Return: A new decryption context on success; an ERR_PTR() otherwise.
> - */
> -struct fscrypt_ctx *fscrypt_get_ctx(gfp_t gfp_flags)
> -{
> -	struct fscrypt_ctx *ctx;
> -	unsigned long flags;
> -
> -	/*
> -	 * First try getting a ctx from the free list so that we don't have to
> -	 * call into the slab allocator.
> -	 */
> -	spin_lock_irqsave(&fscrypt_ctx_lock, flags);
> -	ctx = list_first_entry_or_null(&fscrypt_free_ctxs,
> -					struct fscrypt_ctx, free_list);
> -	if (ctx)
> -		list_del(&ctx->free_list);
> -	spin_unlock_irqrestore(&fscrypt_ctx_lock, flags);
> -	if (!ctx) {
> -		ctx = kmem_cache_zalloc(fscrypt_ctx_cachep, gfp_flags);
> -		if (!ctx)
> -			return ERR_PTR(-ENOMEM);
> -		ctx->flags |= FS_CTX_REQUIRES_FREE_ENCRYPT_FL;
> -	} else {
> -		ctx->flags &= ~FS_CTX_REQUIRES_FREE_ENCRYPT_FL;
> -	}
> -	return ctx;
> -}
> -EXPORT_SYMBOL(fscrypt_get_ctx);

FS_CTX_REQUIRES_FREE_ENCRYPT_FL is no longer used, so should be removed.

- Eric



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux