Home
last modified time | relevance | path

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

12345

/fs/
Dattr.c30 int inode_change_ok(const struct inode *inode, struct iattr *attr) in inode_change_ok() argument
32 unsigned int ia_valid = attr->ia_valid; in inode_change_ok()
39 int error = inode_newsize_ok(inode, attr->ia_size); in inode_change_ok()
51 attr->ia_uid != inode->i_uid) && !capable(CAP_CHOWN)) in inode_change_ok()
57 (!in_group_p(attr->ia_gid) && attr->ia_gid != inode->i_gid)) && in inode_change_ok()
66 if (!in_group_p((ia_valid & ATTR_GID) ? attr->ia_gid : in inode_change_ok()
68 attr->ia_mode &= ~S_ISGID; in inode_change_ok()
139 void setattr_copy(struct inode *inode, const struct iattr *attr) in setattr_copy() argument
141 unsigned int ia_valid = attr->ia_valid; in setattr_copy()
144 inode->i_uid = attr->ia_uid; in setattr_copy()
[all …]
Dlibfs.c754 struct simple_attr *attr; in simple_attr_open() local
756 attr = kmalloc(sizeof(*attr), GFP_KERNEL); in simple_attr_open()
757 if (!attr) in simple_attr_open()
760 attr->get = get; in simple_attr_open()
761 attr->set = set; in simple_attr_open()
762 attr->data = inode->i_private; in simple_attr_open()
763 attr->fmt = fmt; in simple_attr_open()
764 mutex_init(&attr->mutex); in simple_attr_open()
766 file->private_data = attr; in simple_attr_open()
781 struct simple_attr *attr; in simple_attr_read() local
[all …]
/fs/sysfs/
Dgroup.c22 struct attribute *const* attr; in remove_files() local
25 for (i = 0, attr = grp->attrs; *attr; i++, attr++) in remove_files()
26 sysfs_hash_and_remove(dir_sd, NULL, (*attr)->name); in remove_files()
32 struct attribute *const* attr; in create_files() local
35 for (i = 0, attr = grp->attrs; *attr && !error; i++, attr++) { in create_files()
42 sysfs_hash_and_remove(dir_sd, NULL, (*attr)->name); in create_files()
44 mode = grp->is_visible(kobj, *attr, i); in create_files()
48 error = sysfs_add_file_mode(dir_sd, *attr, SYSFS_KOBJ_ATTR, in create_files()
49 (*attr)->mode | mode); in create_files()
169 struct attribute *const *attr; in sysfs_merge_group() local
[all …]
Dbin.c52 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr; in fill_read() local
61 if (attr->read) in fill_read()
62 rc = attr->read(file, kobj, attr, buffer, off, count); in fill_read()
122 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr; in flush_write() local
131 if (attr->write) in flush_write()
132 rc = attr->write(file, kobj, attr, buffer, offset, count); in flush_write()
341 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr; in mmap() local
353 if (!attr->mmap) in mmap()
356 rc = attr->mmap(file, kobj, attr, vma); in mmap()
395 struct bin_attribute *attr = attr_sd->s_bin_attr.bin_attr; in open() local
[all …]
Dfile.c85 count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page); in fill_read_buffer()
202 rc = ops->store(kobj, attr_sd->s_attr.attr, buffer->page, count); in flush_write_buffer()
462 void sysfs_notify(struct kobject *k, const char *dir, const char *attr) in sysfs_notify() argument
470 if (sd && attr) in sysfs_notify()
471 sd = sysfs_find_dirent(sd, NULL, attr); in sysfs_notify()
488 int sysfs_attr_ns(struct kobject *kobj, const struct attribute *attr, in sysfs_attr_ns() argument
516 ns = ops->namespace(kobj, attr); in sysfs_attr_ns()
527 const struct attribute *attr, int type, umode_t amode) in sysfs_add_file_mode() argument
535 rc = sysfs_attr_ns(dir_sd->s_dir.kobj, attr, &ns); in sysfs_add_file_mode()
539 sd = sysfs_new_dirent(attr->name, mode, type); in sysfs_add_file_mode()
[all …]
Dsysfs.h32 struct attribute *attr; member
120 struct attribute *attr = sd->s_attr.attr; \
121 struct lock_class_key *key = attr->key; \
123 key = &attr->skey; \
228 const struct attribute *attr, int type);
231 const struct attribute *attr, int type, umode_t amode);
/fs/adfs/
Dinode.c86 unsigned int attr = ADFS_I(inode)->attr; in adfs_atts2mode() local
90 if (attr & ADFS_NDA_DIRECTORY) { in adfs_atts2mode()
109 if (attr & ADFS_NDA_OWNER_READ) in adfs_atts2mode()
112 if (attr & ADFS_NDA_OWNER_WRITE) in adfs_atts2mode()
115 if (attr & ADFS_NDA_PUBLIC_READ) in adfs_atts2mode()
118 if (attr & ADFS_NDA_PUBLIC_WRITE) in adfs_atts2mode()
131 int attr; in adfs_mode2atts() local
136 return ADFS_I(inode)->attr; in adfs_mode2atts()
139 attr = ADFS_NDA_DIRECTORY; in adfs_mode2atts()
141 attr = 0; in adfs_mode2atts()
[all …]
/fs/coda/
Dcoda_linux.c76 void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) in coda_vattr_to_iattr() argument
82 switch (attr->va_type) { in coda_vattr_to_iattr()
100 if (attr->va_mode != (u_short) -1) in coda_vattr_to_iattr()
101 inode->i_mode = attr->va_mode | inode_type; in coda_vattr_to_iattr()
102 if (attr->va_uid != -1) in coda_vattr_to_iattr()
103 inode->i_uid = (uid_t) attr->va_uid; in coda_vattr_to_iattr()
104 if (attr->va_gid != -1) in coda_vattr_to_iattr()
105 inode->i_gid = (gid_t) attr->va_gid; in coda_vattr_to_iattr()
106 if (attr->va_nlink != -1) in coda_vattr_to_iattr()
107 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()
41 init_special_inode(inode, inode->i_mode, huge_decode_dev(attr->va_rdev)); in coda_fill_inode()
60 struct coda_vattr * attr) in coda_iget() argument
81 coda_fill_inode(inode, attr); in coda_iget()
93 struct coda_vattr attr; in coda_cnode_make() local
98 error = venus_getattr(sb, fid, &attr); in coda_cnode_make()
102 inode = coda_iget(sb, fid, &attr); in coda_cnode_make()
/fs/fat/
Dfile.c24 u32 attr; in fat_ioctl_get_attributes() local
27 attr = fat_make_attrs(inode); in fat_ioctl_get_attributes()
30 return put_user(attr, user_attr); in fat_ioctl_get_attributes()
38 u32 attr, oldattr; in fat_ioctl_set_attributes() local
42 err = get_user(attr, user_attr); in fat_ioctl_set_attributes()
57 attr &= 0xff & ~(ATTR_VOLUME | ATTR_DIR); in fat_ioctl_set_attributes()
59 attr |= (MSDOS_I(inode)->i_attrs & ATTR_VOLUME) | in fat_ioctl_set_attributes()
67 ia.ia_mode = fat_make_mode(sbi, attr, S_IRWXUGO); in fat_ioctl_set_attributes()
69 ia.ia_mode = fat_make_mode(sbi, attr, in fat_ioctl_set_attributes()
74 if (inode->i_ino == MSDOS_ROOT_INO && attr != ATTR_DIR) { in fat_ioctl_set_attributes()
[all …]
/fs/yaffs2/
Dyaffs_attribs.c73 int yaffs_set_attribs(struct yaffs_obj *obj, struct iattr *attr) in yaffs_set_attribs() argument
75 unsigned int valid = attr->ia_valid; in yaffs_set_attribs()
78 obj->yst_mode = attr->ia_mode; in yaffs_set_attribs()
80 obj->yst_uid = attr->ia_uid; in yaffs_set_attribs()
82 obj->yst_gid = attr->ia_gid; in yaffs_set_attribs()
85 obj->yst_atime = Y_TIME_CONVERT(attr->ia_atime); in yaffs_set_attribs()
87 obj->yst_ctime = Y_TIME_CONVERT(attr->ia_ctime); in yaffs_set_attribs()
89 obj->yst_mtime = Y_TIME_CONVERT(attr->ia_mtime); in yaffs_set_attribs()
92 yaffs_resize_file(obj, attr->ia_size); in yaffs_set_attribs()
100 int yaffs_get_attribs(struct yaffs_obj *obj, struct iattr *attr) in yaffs_get_attribs() argument
[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()
266 &gfs2_attr_id.attr,
267 &gfs2_attr_fsname.attr,
268 &gfs2_attr_uuid.attr,
269 &gfs2_attr_freeze.attr,
270 &gfs2_attr_withdraw.attr,
[all …]
/fs/configfs/
Dfile.c66 struct configfs_attribute * attr = to_attr(dentry); in fill_read_buffer() local
77 count = ops->show_attribute(item,attr,buffer->page); in fill_read_buffer()
172 struct configfs_attribute * attr = to_attr(dentry); in flush_write_buffer() local
176 return ops->store_attribute(item,attr,buffer->page,count); in flush_write_buffer()
216 struct configfs_attribute * attr = to_attr(file->f_path.dentry); in check_perm() local
221 if (!item || !attr) in check_perm()
225 if (!try_module_get(attr->ca_owner)) { in check_perm()
275 module_put(attr->ca_owner); in check_perm()
290 struct configfs_attribute * attr = to_attr(filp->f_path.dentry); in configfs_release() local
291 struct module * owner = attr->ca_owner; in configfs_release()
[all …]
/fs/ocfs2/cluster/
Dnodemanager.c354 struct configfs_attribute attr; member
360 .attr = { .ca_owner = THIS_MODULE,
368 .attr = { .ca_owner = THIS_MODULE,
376 .attr = { .ca_owner = THIS_MODULE,
384 .attr = { .ca_owner = THIS_MODULE,
392 [O2NM_NODE_ATTR_NUM] = &o2nm_node_attr_num.attr,
393 [O2NM_NODE_ATTR_PORT] = &o2nm_node_attr_ipv4_port.attr,
394 [O2NM_NODE_ATTR_ADDRESS] = &o2nm_node_attr_ipv4_address.attr,
395 [O2NM_NODE_ATTR_LOCAL] = &o2nm_node_attr_local.attr,
399 static int o2nm_attr_index(struct configfs_attribute *attr) in o2nm_attr_index() argument
[all …]
Dmasklog.c68 struct attribute attr; member
72 #define to_mlog_attr(_attr) container_of(_attr, struct mlog_attribute, attr)
75 .attr = { \
107 static ssize_t mlog_show(struct kobject *obj, struct attribute *attr, in mlog_show() argument
110 struct mlog_attribute *mlog_attr = to_mlog_attr(attr); in mlog_show()
115 static ssize_t mlog_store(struct kobject *obj, struct attribute *attr, in mlog_store() argument
118 struct mlog_attribute *mlog_attr = to_mlog_attr(attr); in mlog_store()
141 while (mlog_attrs[i].attr.mode) { in mlog_sys_init()
142 mlog_attr_ptrs[i] = &mlog_attrs[i].attr; in mlog_sys_init()
/fs/fuse/
Dinode.c155 void fuse_change_attributes_common(struct inode *inode, struct fuse_attr *attr, in fuse_change_attributes_common() argument
164 inode->i_ino = fuse_squash_ino(attr->ino); in fuse_change_attributes_common()
165 inode->i_mode = (inode->i_mode & S_IFMT) | (attr->mode & 07777); in fuse_change_attributes_common()
166 set_nlink(inode, attr->nlink); in fuse_change_attributes_common()
167 inode->i_uid = attr->uid; in fuse_change_attributes_common()
168 inode->i_gid = attr->gid; in fuse_change_attributes_common()
169 inode->i_blocks = attr->blocks; in fuse_change_attributes_common()
170 inode->i_atime.tv_sec = attr->atime; in fuse_change_attributes_common()
171 inode->i_atime.tv_nsec = attr->atimensec; in fuse_change_attributes_common()
172 inode->i_mtime.tv_sec = attr->mtime; in fuse_change_attributes_common()
[all …]
Ddir.c214 if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT) in fuse_dentry_revalidate()
217 fuse_change_attributes(inode, &outarg.attr, in fuse_dentry_revalidate()
299 if (!fuse_valid_type(outarg->attr.mode)) in fuse_lookup_name()
303 &outarg->attr, entry_attr_timeout(outarg), in fuse_lookup_name()
438 if (!S_ISREG(outentry.attr.mode) || invalid_nodeid(outentry.nodeid)) in fuse_create_open()
446 &outentry.attr, entry_attr_timeout(&outentry), 0); in fuse_create_open()
511 if ((outarg.attr.mode ^ mode) & S_IFMT) in create_new_entry()
515 &outarg.attr, entry_attr_timeout(&outarg), 0); in create_new_entry()
782 static void fuse_fillattr(struct inode *inode, struct fuse_attr *attr, in fuse_fillattr() argument
786 stat->ino = attr->ino; in fuse_fillattr()
[all …]
/fs/dlm/
Dconfig.c130 struct configfs_attribute attr; member
149 .attr = { .ca_owner = THIS_MODULE,
204 [CLUSTER_ATTR_TCP_PORT] = &cluster_attr_tcp_port.attr,
205 [CLUSTER_ATTR_BUFFER_SIZE] = &cluster_attr_buffer_size.attr,
206 [CLUSTER_ATTR_RSBTBL_SIZE] = &cluster_attr_rsbtbl_size.attr,
207 [CLUSTER_ATTR_DIRTBL_SIZE] = &cluster_attr_dirtbl_size.attr,
208 [CLUSTER_ATTR_RECOVER_TIMER] = &cluster_attr_recover_timer.attr,
209 [CLUSTER_ATTR_TOSS_SECS] = &cluster_attr_toss_secs.attr,
210 [CLUSTER_ATTR_SCAN_SECS] = &cluster_attr_scan_secs.attr,
211 [CLUSTER_ATTR_LOG_DEBUG] = &cluster_attr_log_debug.attr,
[all …]
Dlockspace.c89 struct attribute attr; member
95 .attr = {.name = "control", .mode = S_IWUSR},
100 .attr = {.name = "event_done", .mode = S_IWUSR},
105 .attr = {.name = "id", .mode = S_IRUGO | S_IWUSR},
111 .attr = {.name = "recover_status", .mode = S_IRUGO},
116 .attr = {.name = "recover_nodeid", .mode = S_IRUGO},
121 &dlm_attr_control.attr,
122 &dlm_attr_event.attr,
123 &dlm_attr_id.attr,
124 &dlm_attr_recover_status.attr,
[all …]
/fs/minix/
Dfile.c26 static int minix_setattr(struct dentry *dentry, struct iattr *attr) in minix_setattr() argument
31 error = inode_change_ok(inode, attr); in minix_setattr()
35 if ((attr->ia_valid & ATTR_SIZE) && in minix_setattr()
36 attr->ia_size != i_size_read(inode)) { in minix_setattr()
37 error = vmtruncate(inode, attr->ia_size); in minix_setattr()
42 setattr_copy(inode, attr); in minix_setattr()
/fs/sysv/
Dfile.c33 static int sysv_setattr(struct dentry *dentry, struct iattr *attr) in sysv_setattr() argument
38 error = inode_change_ok(inode, attr); in sysv_setattr()
42 if ((attr->ia_valid & ATTR_SIZE) && in sysv_setattr()
43 attr->ia_size != i_size_read(inode)) { in sysv_setattr()
44 error = vmtruncate(inode, attr->ia_size); in sysv_setattr()
49 setattr_copy(inode, attr); in sysv_setattr()
/fs/ntfs/
Dnamei.c226 a = ctx->attr; in ntfs_lookup()
233 fn = (FILE_NAME_ATTR*)((u8*)ctx->attr + le16_to_cpu( in ntfs_lookup()
234 ctx->attr->data.resident.value_offset)); in ntfs_lookup()
306 ATTR_RECORD *attr; in ntfs_get_parent() local
334 attr = ctx->attr; in ntfs_get_parent()
335 if (unlikely(attr->non_resident)) in ntfs_get_parent()
337 fn = (FILE_NAME_ATTR *)((u8 *)attr + in ntfs_get_parent()
338 le16_to_cpu(attr->data.resident.value_offset)); in ntfs_get_parent()
339 if (unlikely((u8 *)fn + le32_to_cpu(attr->data.resident.value_length) > in ntfs_get_parent()
340 (u8*)attr + le32_to_cpu(attr->length))) in ntfs_get_parent()
/fs/hostfs/
Dhostfs_kern.c788 int hostfs_setattr(struct dentry *dentry, struct iattr *attr) in hostfs_setattr() argument
797 err = inode_change_ok(inode, 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 = attr->ia_uid; in hostfs_setattr()
813 if (attr->ia_valid & ATTR_GID) { in hostfs_setattr()
815 attrs.ia_gid = attr->ia_gid; in hostfs_setattr()
817 if (attr->ia_valid & ATTR_SIZE) { in hostfs_setattr()
[all …]
/fs/ubifs/
Dfile.c1068 static void do_attr_changes(struct inode *inode, const struct iattr *attr) in do_attr_changes() argument
1070 if (attr->ia_valid & ATTR_UID) in do_attr_changes()
1071 inode->i_uid = attr->ia_uid; in do_attr_changes()
1072 if (attr->ia_valid & ATTR_GID) in do_attr_changes()
1073 inode->i_gid = attr->ia_gid; in do_attr_changes()
1074 if (attr->ia_valid & ATTR_ATIME) in do_attr_changes()
1075 inode->i_atime = timespec_trunc(attr->ia_atime, in do_attr_changes()
1077 if (attr->ia_valid & ATTR_MTIME) in do_attr_changes()
1078 inode->i_mtime = timespec_trunc(attr->ia_mtime, in do_attr_changes()
1080 if (attr->ia_valid & ATTR_CTIME) in do_attr_changes()
[all …]
/fs/hpfs/
Dinode.c256 int hpfs_setattr(struct dentry *dentry, struct iattr *attr) in hpfs_setattr() argument
264 if ((attr->ia_valid & ATTR_UID) && attr->ia_uid >= 0x10000) in hpfs_setattr()
266 if ((attr->ia_valid & ATTR_GID) && attr->ia_gid >= 0x10000) in hpfs_setattr()
268 if ((attr->ia_valid & ATTR_SIZE) && attr->ia_size > inode->i_size) in hpfs_setattr()
271 error = inode_change_ok(inode, attr); in hpfs_setattr()
275 if ((attr->ia_valid & ATTR_SIZE) && in hpfs_setattr()
276 attr->ia_size != i_size_read(inode)) { in hpfs_setattr()
277 error = vmtruncate(inode, attr->ia_size); in hpfs_setattr()
282 setattr_copy(inode, attr); in hpfs_setattr()

12345