Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754069AbbL2XhM (ORCPT ); Tue, 29 Dec 2015 18:37:12 -0500 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 X-AuditID: cbfec7f4-f79026d00000418a-59-56831922af2d 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 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 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 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHLMWRmVeSWpSXmKPExsVy+t/xq7pKks1hBrvaZCzmrF/DZrFy9VEm i5PnvrFY7Nl7ksXi8q45bBZtq88wWhydtpzFgd3j6cUgj1cHVrF7nJjxm8Xj/vYjTB67bzaw eXzeJBfAFsVlk5Kak1mWWqRvl8CV8WxJA1PBM/6KeXuesDQwPuXpYuTkkBAwkejpuM8KYYtJ XLi3ng3EFhJYyigxbQKQzQVkP2eUWHCoixkkISxgJTH13SMWEFtEIEOipeEiI0RDtsTbzb1g NrNAokT/lxNA9RwcbAL6EvN2iYKEeQU0JC5s3ATWyiKgKvHw9mewvaICMRKPF29lhagRlPgx +R5YDaeAtUTn76XMECOtJZ4decgKYctLbF7zlnkCo8AsJC2zkJTNQlK2gJF5FaNoamlyQXFS eq6hXnFibnFpXrpecn7uJkZIqH/Zwbj4mNUhRgEORiUeXgXR5jAh1sSy4srcQ4wSHMxKIrwX WIBCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeefueh8iJJCeWJKanZpakFoEk2Xi4JRqYFwsmpyZ JLtg3V8nxequ/e/vHRINFhB/yTlVZfLDivDiZdP2n5nNsyShmD3qnbvPNJck+VSjxi9rbWWa I3Izrv9P3ZLc2vBnexGfrdo5Z9eENwycm7Y5SDQKfW46qedr/dB19ipG5f39ARp88fVOX3q+ Pk0M27mKycQ+LVgwMbW3f4aMPFeXEktxRqKhFnNRcSIAEHc8cnECAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2206 Lines: 70 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 -- 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/