From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout2.w1.samsung.com ([210.118.77.12]:26279 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbbL2XhJ (ORCPT ); Tue, 29 Dec 2015 18:37:09 -0500 Subject: Re: [PATCH] configfs: implement binary attributes To: Christoph Hellwig , jlbec@evilplan.org, akpm@linux-foundation.org, nab@linux-iscsi.org References: <1450968671-13699-1-git-send-email-hch@lst.de> <1450968671-13699-2-git-send-email-hch@lst.de> Cc: pantelis.antoniou@konsulko.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org From: Krzysztof Opasiak Message-id: <56831927.50205@samsung.com> Date: Wed, 30 Dec 2015 00:37:11 +0100 MIME-version: 1.0 In-reply-to: <1450968671-13699-2-git-send-email-hch@lst.de> Content-type: text/plain; charset=iso-8859-2; format=flowed Content-transfer-encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: W dniu 2015-12-24 o 15:51, Christoph Hellwig pisze: > From: Pantelis Antoniou > > 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 > [hch: folded a fix from Geert Uytterhoeven ] > Signed-off-by: Christoph Hellwig > --- (...) > > #include > @@ -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