access to file structure for sysfs read/write?

From: Markus Grabner (grabner_at_icg.tu-graz.ac.at)
Date: 12/22/04


Date: Wed, 22 Dec 2004 22:19:54 +0100


        Hi!

    Is there a way to access the file structure ("struct file *") in the
read and write method for sysfs access? When creating a sysfs entry with
device_create_file, we have to pass a device_attribute data structure,
which contains a pointer to functions "show" and "store".
The "struct device *" is passed to these functions, so can I derive the
"struct file *" (representing the file the user openend to access the sysfs
file) from the pointer to the device?

        Thanks,
                Markus

-- 
Markus Grabner - Computer Graphics and Vision
Graz University of Technology, Inffeldgasse 16/II, 8010 Graz, Austria
Phone: +43/316/873-5041, Fax: +43/316/873-5050
Email: grabner@icg.tu-graz.ac.at, WWW: http://www.icg.tu-graz.ac.at/~grabner


Relevant Pages

  • [PATCH] nesting class_device in sysfs to solve world peace
    ... class_device structures in sysfs. ... I have a follow-on patch that fixes up all callers of the ... This patch allows struct class_device to be nested, ... The pointer to the struct class_device will be returned from ...
    (Linux-Kernel)
  • [PATCH 10/11] driver core: remove no longer used "struct class_device"
    ... This is used to create a struct class pointer that can then be used ... * created struct class_device will be a child of that device in sysfs. ... extern void class_remove_file(struct class *class, ...
    (Linux-Kernel)
  • [PATCH] Driver Core: add the ability for class_device structures to be nested
    ... This patch allows struct class_device to be nested, ... static void class_create_release ... class_device_create - creates a class device and registers it with sysfs ... pointer to the struct class that this device should be registered to. ...
    (Linux-Kernel)
  • Re: Another spinoza challenge
    ... You should test against the int type's limits: ... typedef struct complex ... a pointer to an integer ... A macro is preferable because it is replaced by inline code, ...
    (comp.lang.c)
  • Re: how to store list of varying types
    ... represent that with those in the struct definitions? ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ... start with an upper-case letter (so, I would use DataElement ...
    (microsoft.public.vc.mfc)