Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1299165

Re: [PATCH] configfs: implement binary attributes

From Krzysztof Opasiak <k.opasiak@samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH] configfs: implement binary attributes
Date 2015-12-30 00:40 +0100
Message-ID <qLc1Y-76R-11@gated-at.bofh.it> (permalink)
References <qJfx0-82z-25@gated-at.bofh.it> <qJfx0-82z-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



W dniu 2015-12-24 o 15:51, Christoph Hellwig pisze:
> From: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
>
> ConfigFS lacked binary attributes up until now. This patch
> introduces support for binary attributes in a somewhat similar
> manner of sysfs binary attributes albeit with changes that
> fit the configfs usage model.
>
> Problems that configfs binary attributes fix are everything that
> requires a binary blob as part of the configuration of a resource,
> such as bitstream loading for FPGAs, DTBs for dynamically created
> devices etc.
>
> Look at Documentation/filesystems/configfs/configfs.txt for internals
> and howto use them.
>
> This patch is against linux-next as of today that contains
> Christoph's configfs rework.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> [hch: folded a fix from Geert Uytterhoeven <geert+renesas@glider.be>]
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

(...)

>
>   #include <linux/configfs.h>
> @@ -48,6 +49,10 @@ struct configfs_buffer {
>   	struct configfs_item_operations	* ops;
>   	struct mutex		mutex;
>   	int			needs_read_fill;
> +	int			read_in_progress;
> +	int			write_in_progress;

Those 2 should be probably bool instead of int.

> +	char			*bin_buffer;
> +	int			bin_buffer_size;
>   };

(...)

> diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
> index eae8757..0cc810e 100644
> --- a/fs/configfs/inode.c
> +++ b/fs/configfs/inode.c
> @@ -218,7 +218,7 @@ const unsigned char * configfs_get_name(struct configfs_dirent *sd)
>   	if (sd->s_type & (CONFIGFS_DIR | CONFIGFS_ITEM_LINK))
>   		return sd->s_dentry->d_name.name;
>
> -	if (sd->s_type & CONFIGFS_ITEM_ATTR) {
> +	if (sd->s_type & (CONFIGFS_ITEM_ATTR | CONFIGFS_ITEM_BIN_ATTR)) {

I would also recomend a static inline helper here instead of adding this 
or as this may simplify the code in a few places.


Best regards,
-- 
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] configfs: implement binary attributes Christoph Hellwig <hch@lst.de> - 2015-12-24 16:00 +0100
  Re: [PATCH] configfs: implement binary attributes Joel Becker <jlbec@evilplan.org> - 2015-12-30 00:10 +0100
    Re: [PATCH] configfs: implement binary attributes Krzysztof Opasiak <k.opasiak@samsung.com> - 2015-12-30 00:30 +0100
    Re: [PATCH] configfs: implement binary attributes Pantelis Antoniou <pantelis.antoniou@konsulko.com> - 2015-12-30 10:00 +0100
  Re: [PATCH] configfs: implement binary attributes Krzysztof Opasiak <k.opasiak@samsung.com> - 2015-12-30 00:40 +0100

csiph-web