From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-kernel@vger.kernel.org
Cc: Greg KH <greg@kroah.com>
Subject: [PATCH] sysfs: export the vfs release call of binary attribute
Date: Thu, 27 Jan 2005 11:07:33 +0100 [thread overview]
Message-ID: <20050127100733.GA3018@vrfy.org> (raw)
Currently there is no way to know what time userspace has finished writing
to a binary sysfs attribute bigger than one page. The firmware_class code uses
its own special file in the class directory to notify about this. This can
be simplified by using this release callback.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
===== fs/sysfs/bin.c 1.20 vs edited =====
--- 1.20/fs/sysfs/bin.c 2004-12-21 18:32:08 +01:00
+++ edited/fs/sysfs/bin.c 2005-01-26 20:56:07 +01:00
@@ -156,6 +156,9 @@ static int release(struct inode * inode,
struct bin_attribute * attr = to_bin_attr(file->f_dentry);
u8 * buffer = file->private_data;
+ if (attr->release)
+ attr->release(kobj);
+
if (kobj)
kobject_put(kobj);
module_put(attr->attr.owner);
===== include/linux/sysfs.h 1.39 vs edited =====
--- 1.39/include/linux/sysfs.h 2004-12-21 18:31:01 +01:00
+++ edited/include/linux/sysfs.h 2005-01-26 20:34:01 +01:00
@@ -56,6 +56,7 @@ struct bin_attribute {
void *private;
ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
+ int (*release)(struct kobject *);
int (*mmap)(struct kobject *, struct bin_attribute *attr,
struct vm_area_struct *vma);
};
next reply other threads:[~2005-01-27 10:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-27 10:07 Kay Sievers [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-01-27 20:19 [PATCH] sysfs: export the vfs release call of binary attribute Kay Sievers
2005-01-27 20:34 ` Kay Sievers
2005-02-01 0:15 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050127100733.GA3018@vrfy.org \
--to=kay.sievers@vrfy.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.