size_t bytes, loff_t *off)
{
struct sysfs_open_file *of = sysfs_of(file);
- struct bin_attribute *battr = of->sd->s_bin_attr.bin_attr;
+ struct bin_attribute *battr = of->sd->s_attr.bin_attr;
struct kobject *kobj = of->sd->s_parent->s_dir.kobj;
loff_t size = file_inode(file)->i_size;
int count = min_t(size_t, bytes, PAGE_SIZE);
}
if (sysfs_is_bin(of->sd)) {
- struct bin_attribute *battr = of->sd->s_bin_attr.bin_attr;
+ struct bin_attribute *battr = of->sd->s_attr.bin_attr;
rc = -EIO;
if (battr->write)
static int sysfs_bin_mmap(struct file *file, struct vm_area_struct *vma)
{
struct sysfs_open_file *of = sysfs_of(file);
- struct bin_attribute *battr = of->sd->s_bin_attr.bin_attr;
+ struct bin_attribute *battr = of->sd->s_attr.bin_attr;
struct kobject *kobj = of->sd->s_parent->s_dir.kobj;
int rc;
return -ENODEV;
if (sysfs_is_bin(attr_sd)) {
- struct bin_attribute *battr = attr_sd->s_bin_attr.bin_attr;
+ struct bin_attribute *battr = attr_sd->s_attr.bin_attr;
has_read = battr->read || battr->mmap;
has_write = battr->write || battr->mmap;
inode->i_fop = &sysfs_file_operations;
break;
case SYSFS_KOBJ_BIN_ATTR:
- bin_attr = sd->s_bin_attr.bin_attr;
+ bin_attr = sd->s_attr.bin_attr;
inode->i_size = bin_attr->size;
inode->i_fop = &sysfs_bin_operations;
break;
};
struct sysfs_elem_attr {
- struct attribute *attr;
+ union {
+ struct attribute *attr;
+ struct bin_attribute *bin_attr;
+ };
struct sysfs_open_dirent *open;
};
-struct sysfs_elem_bin_attr {
- struct bin_attribute *bin_attr;
- struct hlist_head buffers;
-};
-
struct sysfs_inode_attrs {
struct iattr ia_iattr;
void *ia_secdata;
struct sysfs_elem_dir s_dir;
struct sysfs_elem_symlink s_symlink;
struct sysfs_elem_attr s_attr;
- struct sysfs_elem_bin_attr s_bin_attr;
};
unsigned short s_flags;