Home
last modified time | relevance | path

Searched refs:attr (Results 1 – 25 of 139) sorted by relevance

123456

/fs/orangefs/
Dorangefs-sysfs.c166 struct attribute attr; member
168 struct orangefs_attribute *attr,
171 struct orangefs_attribute *attr,
177 struct attribute *attr, in orangefs_attr_show() argument
182 attribute = container_of(attr, struct orangefs_attribute, attr); in orangefs_attr_show()
189 struct attribute *attr, in orangefs_attr_store() argument
199 attribute = container_of(attr, struct orangefs_attribute, attr); in orangefs_attr_store()
211 struct orangefs_attribute *attr, char *buf) in sysfs_int_show() argument
219 if (!strcmp(attr->attr.name, "op_timeout_secs")) { in sysfs_int_show()
225 } else if (!strcmp(attr->attr.name, in sysfs_int_show()
[all …]
/fs/
Dattr.c61 int setattr_prepare(struct dentry *dentry, struct iattr *attr) in setattr_prepare() argument
64 unsigned int ia_valid = attr->ia_valid; in setattr_prepare()
71 int error = inode_newsize_ok(inode, attr->ia_size); in setattr_prepare()
81 if ((ia_valid & ATTR_UID) && !chown_ok(inode, attr->ia_uid)) in setattr_prepare()
85 if ((ia_valid & ATTR_GID) && !chgrp_ok(inode, attr->ia_gid)) in setattr_prepare()
93 if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid : in setattr_prepare()
96 attr->ia_mode &= ~S_ISGID; in setattr_prepare()
178 void setattr_copy(struct inode *inode, const struct iattr *attr) in setattr_copy() argument
180 unsigned int ia_valid = attr->ia_valid; in setattr_copy()
183 inode->i_uid = attr->ia_uid; in setattr_copy()
[all …]
Dlibfs.c822 struct simple_attr *attr; in simple_attr_open() local
824 attr = kmalloc(sizeof(*attr), GFP_KERNEL); in simple_attr_open()
825 if (!attr) in simple_attr_open()
828 attr->get = get; in simple_attr_open()
829 attr->set = set; in simple_attr_open()
830 attr->data = inode->i_private; in simple_attr_open()
831 attr->fmt = fmt; in simple_attr_open()
832 mutex_init(&attr->mutex); in simple_attr_open()
834 file->private_data = attr; in simple_attr_open()
851 struct simple_attr *attr; in simple_attr_read() local
[all …]
/fs/sysfs/
Dgroup.c22 struct attribute *const *attr; in remove_files() local
26 for (attr = grp->attrs; *attr; attr++) in remove_files()
27 kernfs_remove_by_name(parent, (*attr)->name); in remove_files()
30 kernfs_remove_by_name(parent, (*bin_attr)->attr.name); in remove_files()
37 struct attribute *const *attr; in create_files() local
42 for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) { in create_files()
43 umode_t mode = (*attr)->mode; in create_files()
51 kernfs_remove_by_name(parent, (*attr)->name); in create_files()
53 mode = grp->is_visible(kobj, *attr, i); in create_files()
60 (*attr)->name, mode); in create_files()
[all …]
Dfile.c172 void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr) in sysfs_notify() argument
181 if (kn && attr) { in sysfs_notify()
182 tmp = kernfs_find_and_get(kn, attr); in sysfs_notify()
246 const struct attribute *attr, bool is_bin, in sysfs_add_file_mode_ns() argument
284 struct bin_attribute *battr = (void *)attr; in sysfs_add_file_mode_ns()
301 if (!attr->ignore_lockdep) in sysfs_add_file_mode_ns()
302 key = attr->key ?: (struct lock_class_key *)&attr->skey; in sysfs_add_file_mode_ns()
305 kn = __kernfs_create_file(parent, attr->name, mode & 0777, uid, gid, in sysfs_add_file_mode_ns()
306 size, ops, (void *)attr, ns, key); in sysfs_add_file_mode_ns()
309 sysfs_warn_dup(parent, attr->name); in sysfs_add_file_mode_ns()
[all …]
/fs/adfs/
Dinode.c88 unsigned int attr = ADFS_I(inode)->attr; in adfs_atts2mode() local
92 if (attr & ADFS_NDA_DIRECTORY) { in adfs_atts2mode()
111 if (attr & ADFS_NDA_OWNER_READ) in adfs_atts2mode()
114 if (attr & ADFS_NDA_OWNER_WRITE) in adfs_atts2mode()
117 if (attr & ADFS_NDA_PUBLIC_READ) in adfs_atts2mode()
120 if (attr & ADFS_NDA_PUBLIC_WRITE) in adfs_atts2mode()
133 int attr; in adfs_mode2atts() local
138 return ADFS_I(inode)->attr; in adfs_mode2atts()
141 attr = ADFS_NDA_DIRECTORY; in adfs_mode2atts()
143 attr = 0; in adfs_mode2atts()
[all …]
/fs/fat/
Dfile.c26 u32 attr; in fat_ioctl_get_attributes() local
29 attr = fat_make_attrs(inode); in fat_ioctl_get_attributes()
32 return put_user(attr, user_attr); in fat_ioctl_get_attributes()
40 u32 attr, oldattr; in fat_ioctl_set_attributes() local
44 err = get_user(attr, user_attr); in fat_ioctl_set_attributes()
59 attr &= 0xff & ~(ATTR_VOLUME | ATTR_DIR); in fat_ioctl_set_attributes()
61 attr |= (MSDOS_I(inode)->i_attrs & ATTR_VOLUME) | in fat_ioctl_set_attributes()
69 ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO); in fat_ioctl_set_attributes()
71 ia.ia_mode = fat_make_mode(sbi, attr, in fat_ioctl_set_attributes()
76 if (inode->i_ino == MSDOS_ROOT_INO && attr != ATTR_DIR) { in fat_ioctl_set_attributes()
[all …]
/fs/coda/
Dcoda_linux.c90 void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) in coda_vattr_to_iattr() argument
96 switch (attr->va_type) { in coda_vattr_to_iattr()
114 if (attr->va_mode != (u_short) -1) in coda_vattr_to_iattr()
115 inode->i_mode = attr->va_mode | inode_type; in coda_vattr_to_iattr()
116 if (attr->va_uid != -1) in coda_vattr_to_iattr()
117 inode->i_uid = make_kuid(&init_user_ns, (uid_t) attr->va_uid); in coda_vattr_to_iattr()
118 if (attr->va_gid != -1) in coda_vattr_to_iattr()
119 inode->i_gid = make_kgid(&init_user_ns, (gid_t) attr->va_gid); in coda_vattr_to_iattr()
120 if (attr->va_nlink != -1) in coda_vattr_to_iattr()
121 set_nlink(inode, attr->va_nlink); in coda_vattr_to_iattr()
[all …]
Dcnode.c26 static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr) in coda_fill_inode() argument
28 coda_vattr_to_iattr(inode, attr); in coda_fill_inode()
42 init_special_inode(inode, inode->i_mode, huge_decode_dev(attr->va_rdev)); in coda_fill_inode()
61 struct coda_vattr * attr) in coda_iget() argument
82 coda_fill_inode(inode, attr); in coda_iget()
94 struct coda_vattr attr; in coda_cnode_make() local
99 error = venus_getattr(sb, fid, &attr); in coda_cnode_make()
103 inode = coda_iget(sb, fid, &attr); in coda_cnode_make()
/fs/nilfs2/
Dsysfs.c37 struct attribute *attr, char *buf) \
42 struct nilfs_##name##_attr *a = container_of(attr, \
44 attr); \
48 struct attribute *attr, \
54 struct nilfs_##name##_attr *a = container_of(attr, \
56 attr); \
110 nilfs_snapshot_inodes_count_show(struct nilfs_snapshot_attr *attr, in nilfs_snapshot_inodes_count_show() argument
118 nilfs_snapshot_blocks_count_show(struct nilfs_snapshot_attr *attr, in nilfs_snapshot_blocks_count_show() argument
131 nilfs_snapshot_README_show(struct nilfs_snapshot_attr *attr, in nilfs_snapshot_README_show() argument
149 struct attribute *attr, char *buf) in nilfs_snapshot_attr_show() argument
[all …]
Dsysfs.h55 struct attribute attr; \
66 struct attribute attr; \
82 struct attribute attr; \
151 (&nilfs_feature_attr_##name.attr)
153 (&nilfs_dev_attr_##name.attr)
155 (&nilfs_segments_attr_##name.attr)
157 (&nilfs_mounted_snapshots_attr_##name.attr)
159 (&nilfs_checkpoints_attr_##name.attr)
161 (&nilfs_snapshot_attr_##name.attr)
163 (&nilfs_superblock_attr_##name.attr)
[all …]
/fs/gfs2/
Dsys.c31 struct attribute attr; member
36 static ssize_t gfs2_attr_show(struct kobject *kobj, struct attribute *attr, in gfs2_attr_show() argument
40 struct gfs2_attr *a = container_of(attr, struct gfs2_attr, attr); in gfs2_attr_show()
44 static ssize_t gfs2_attr_store(struct kobject *kobj, struct attribute *attr, in gfs2_attr_store() argument
48 struct gfs2_attr *a = container_of(attr, struct gfs2_attr, attr); in gfs2_attr_store()
287 &gfs2_attr_id.attr,
288 &gfs2_attr_fsname.attr,
289 &gfs2_attr_uuid.attr,
290 &gfs2_attr_freeze.attr,
291 &gfs2_attr_withdraw.attr,
[all …]
/fs/fuse/
Ddir.c251 if (ret || fuse_invalid_attr(&outarg.attr) || in fuse_dentry_revalidate()
252 (outarg.attr.mode ^ inode->i_mode) & S_IFMT) in fuse_dentry_revalidate()
256 fuse_change_attributes(inode, &outarg.attr, in fuse_dentry_revalidate()
323 bool fuse_invalid_attr(struct fuse_attr *attr) in fuse_invalid_attr() argument
325 return !fuse_valid_type(attr->mode) || in fuse_invalid_attr()
326 attr->size > LLONG_MAX; in fuse_invalid_attr()
360 if (fuse_invalid_attr(&outarg->attr)) in fuse_lookup_name()
364 &outarg->attr, entry_attr_timeout(outarg), in fuse_lookup_name()
485 if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid) || in fuse_create_open()
486 fuse_invalid_attr(&outentry.attr)) in fuse_create_open()
[all …]
Dinode.c145 void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, in fuse_change_attributes_common() argument
157 inode->i_ino = fuse_squash_ino(attr->ino); in fuse_change_attributes_common()
158 inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777); in fuse_change_attributes_common()
159 set_nlink(inode, attr->nlink); in fuse_change_attributes_common()
160 inode->i_uid = make_kuid(fc->user_ns, attr->uid); in fuse_change_attributes_common()
161 inode->i_gid = make_kgid(fc->user_ns, attr->gid); in fuse_change_attributes_common()
162 inode->i_blocks = attr->blocks; in fuse_change_attributes_common()
163 inode->i_atime.tv_sec = attr->atime; in fuse_change_attributes_common()
164 inode->i_atime.tv_nsec = attr->atimensec; in fuse_change_attributes_common()
167 inode->i_mtime.tv_sec = attr->mtime; in fuse_change_attributes_common()
[all …]
/fs/minix/
Dfile.c25 static int minix_setattr(struct dentry *dentry, struct iattr *attr) in minix_setattr() argument
30 error = setattr_prepare(dentry, attr); in minix_setattr()
34 if ((attr->ia_valid & ATTR_SIZE) && in minix_setattr()
35 attr->ia_size != i_size_read(inode)) { in minix_setattr()
36 error = inode_newsize_ok(inode, attr->ia_size); in minix_setattr()
40 truncate_setsize(inode, attr->ia_size); in minix_setattr()
44 setattr_copy(inode, attr); in minix_setattr()
/fs/sysv/
Dfile.c32 static int sysv_setattr(struct dentry *dentry, struct iattr *attr) in sysv_setattr() argument
37 error = setattr_prepare(dentry, attr); in sysv_setattr()
41 if ((attr->ia_valid & ATTR_SIZE) && in sysv_setattr()
42 attr->ia_size != i_size_read(inode)) { in sysv_setattr()
43 error = inode_newsize_ok(inode, attr->ia_size); in sysv_setattr()
46 truncate_setsize(inode, attr->ia_size); in sysv_setattr()
50 setattr_copy(inode, attr); in sysv_setattr()
/fs/ocfs2/
Dfilecheck.c76 struct kobj_attribute *attr,
79 struct kobj_attribute *attr,
94 &ocfs2_filecheck_attr_chk.attr,
95 &ocfs2_filecheck_attr_fix.attr,
96 &ocfs2_filecheck_attr_set.attr,
109 ocfs2_filecheck_show(struct kobject *kobj, struct attribute *attr, char *buf) in ocfs2_filecheck_show() argument
112 struct kobj_attribute *kattr = container_of(attr, in ocfs2_filecheck_show()
113 struct kobj_attribute, attr); in ocfs2_filecheck_show()
123 ocfs2_filecheck_store(struct kobject *kobj, struct attribute *attr, in ocfs2_filecheck_store() argument
127 struct kobj_attribute *kattr = container_of(attr, in ocfs2_filecheck_store()
[all …]
/fs/udf/
Dfile.c257 static int udf_setattr(struct dentry *dentry, struct iattr *attr) in udf_setattr() argument
263 error = setattr_prepare(dentry, attr); in udf_setattr()
267 if ((attr->ia_valid & ATTR_UID) && in udf_setattr()
269 !uid_eq(attr->ia_uid, UDF_SB(sb)->s_uid)) in udf_setattr()
271 if ((attr->ia_valid & ATTR_GID) && in udf_setattr()
273 !gid_eq(attr->ia_gid, UDF_SB(sb)->s_gid)) in udf_setattr()
276 if ((attr->ia_valid & ATTR_SIZE) && in udf_setattr()
277 attr->ia_size != i_size_read(inode)) { in udf_setattr()
278 error = udf_setsize(inode, attr->ia_size); in udf_setattr()
283 if (attr->ia_valid & ATTR_MODE) in udf_setattr()
[all …]
/fs/ocfs2/cluster/
Dmasklog.c88 struct attribute attr; member
92 #define to_mlog_attr(_attr) container_of(_attr, struct mlog_attribute, attr)
95 .attr = { \
127 static ssize_t mlog_show(struct kobject *obj, struct attribute *attr, in mlog_show() argument
130 struct mlog_attribute *mlog_attr = to_mlog_attr(attr); in mlog_show()
135 static ssize_t mlog_store(struct kobject *obj, struct attribute *attr, in mlog_store() argument
138 struct mlog_attribute *mlog_attr = to_mlog_attr(attr); in mlog_store()
161 while (mlog_attrs[i].attr.mode) { in mlog_sys_init()
162 mlog_attr_ptrs[i] = &mlog_attrs[i].attr; in mlog_sys_init()
/fs/ntfs/
Dnamei.c212 a = ctx->attr; in ntfs_lookup()
219 fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + le16_to_cpu( in ntfs_lookup()
220 ctx->attr->data.resident.value_offset)); in ntfs_lookup()
292 ATTR_RECORD *attr; in ntfs_get_parent() local
320 attr = ctx->attr; in ntfs_get_parent()
321 if (unlikely(attr->non_resident)) in ntfs_get_parent()
323 fn = (FILE_NAME_ATTR *)((u8 *)attr + in ntfs_get_parent()
324 le16_to_cpu(attr->data.resident.value_offset)); in ntfs_get_parent()
325 if (unlikely((u8 *)fn + le32_to_cpu(attr->data.resident.value_length) > in ntfs_get_parent()
326 (u8*)attr + le32_to_cpu(attr->length))) in ntfs_get_parent()
/fs/kernfs/
Dfile.c67 return kn->attr.ops; in kernfs_ops()
165 of->event = atomic_read(&of->kn->attr.open->event); in kernfs_seq_show()
167 return of->kn->attr.ops->seq_show(sf, v); in kernfs_seq_show()
210 of->event = atomic_read(&of->kn->attr.open->event); in kernfs_file_direct_read()
551 if (!kn->attr.open && new_on) { in kernfs_get_open_node()
552 kn->attr.open = new_on; in kernfs_get_open_node()
556 on = kn->attr.open; in kernfs_get_open_node()
596 struct kernfs_open_node *on = kn->attr.open; in kernfs_put_open_node()
606 kn->attr.open = NULL; in kernfs_put_open_node()
763 kn->attr.ops->release(of); in kernfs_release_file()
[all …]
/fs/ubifs/
Dfile.c1075 static void do_attr_changes(struct inode *inode, const struct iattr *attr) in do_attr_changes() argument
1077 if (attr->ia_valid & ATTR_UID) in do_attr_changes()
1078 inode->i_uid = attr->ia_uid; in do_attr_changes()
1079 if (attr->ia_valid & ATTR_GID) in do_attr_changes()
1080 inode->i_gid = attr->ia_gid; in do_attr_changes()
1081 if (attr->ia_valid & ATTR_ATIME) { in do_attr_changes()
1082 inode->i_atime = timestamp_truncate(attr->ia_atime, in do_attr_changes()
1085 if (attr->ia_valid & ATTR_MTIME) { in do_attr_changes()
1086 inode->i_mtime = timestamp_truncate(attr->ia_mtime, in do_attr_changes()
1089 if (attr->ia_valid & ATTR_CTIME) { in do_attr_changes()
[all …]
/fs/configfs/
Dfile.c46 struct configfs_attribute *attr; member
70 count = buffer->attr->show(buffer->item, buffer->page); in fill_read_buffer()
251 res = buffer->attr->store(buffer->item, buffer->page, count); in flush_write_buffer()
360 struct configfs_attribute *attr; in __configfs_open_file() local
379 attr = to_attr(dentry); in __configfs_open_file()
380 if (!attr) in __configfs_open_file()
387 buffer->attr = attr; in __configfs_open_file()
390 buffer->owner = attr->ca_owner; in __configfs_open_file()
409 if ((type & CONFIGFS_ITEM_ATTR) && !attr->store) in __configfs_open_file()
422 if ((type & CONFIGFS_ITEM_ATTR) && !attr->show) in __configfs_open_file()
[all …]
/fs/hpfs/
Dinode.c260 int hpfs_setattr(struct dentry *dentry, struct iattr *attr) in hpfs_setattr() argument
268 if ((attr->ia_valid & ATTR_UID) && in hpfs_setattr()
269 from_kuid(&init_user_ns, attr->ia_uid) >= 0x10000) in hpfs_setattr()
271 if ((attr->ia_valid & ATTR_GID) && in hpfs_setattr()
272 from_kgid(&init_user_ns, attr->ia_gid) >= 0x10000) in hpfs_setattr()
274 if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) in hpfs_setattr()
277 error = setattr_prepare(dentry, attr); in hpfs_setattr()
281 if ((attr->ia_valid & ATTR_SIZE) && in hpfs_setattr()
282 attr->ia_size != i_size_read(inode)) { in hpfs_setattr()
283 error = inode_newsize_ok(inode, attr->ia_size); in hpfs_setattr()
[all …]
/fs/hostfs/
Dhostfs_kern.c788 static int hostfs_setattr(struct dentry *dentry, struct iattr *attr) in hostfs_setattr() argument
797 err = setattr_prepare(dentry, attr); in hostfs_setattr()
802 attr->ia_valid &= ~ATTR_SIZE; in hostfs_setattr()
805 if (attr->ia_valid & ATTR_MODE) { in hostfs_setattr()
807 attrs.ia_mode = attr->ia_mode; in hostfs_setattr()
809 if (attr->ia_valid & ATTR_UID) { in hostfs_setattr()
811 attrs.ia_uid = from_kuid(&init_user_ns, attr->ia_uid); in hostfs_setattr()
813 if (attr->ia_valid & ATTR_GID) { in hostfs_setattr()
815 attrs.ia_gid = from_kgid(&init_user_ns, attr->ia_gid); in hostfs_setattr()
817 if (attr->ia_valid & ATTR_SIZE) { in hostfs_setattr()
[all …]

123456