Lines Matching full:rc
132 int rc; in ecryptfs_do_unlink() local
134 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_do_unlink()
136 if (!rc) { in ecryptfs_do_unlink()
138 rc = -EINVAL; in ecryptfs_do_unlink()
140 rc = vfs_unlink(&init_user_ns, lower_dir, lower_dentry, in ecryptfs_do_unlink()
143 if (rc) { in ecryptfs_do_unlink()
144 printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc); in ecryptfs_do_unlink()
153 if (!rc) in ecryptfs_do_unlink()
155 return rc; in ecryptfs_do_unlink()
174 int rc; in ecryptfs_do_create() local
179 rc = lock_parent(ecryptfs_dentry, &lower_dentry, &lower_dir); in ecryptfs_do_create()
180 if (!rc) in ecryptfs_do_create()
181 rc = vfs_create(&init_user_ns, lower_dir, in ecryptfs_do_create()
183 if (rc) { in ecryptfs_do_create()
185 "rc = [%d]\n", __func__, rc); in ecryptfs_do_create()
186 inode = ERR_PTR(rc); in ecryptfs_do_create()
215 int rc = 0; in ecryptfs_initialize_file() local
223 rc = ecryptfs_new_file_context(ecryptfs_inode); in ecryptfs_initialize_file()
224 if (rc) { in ecryptfs_initialize_file()
226 "context; rc = [%d]\n", rc); in ecryptfs_initialize_file()
229 rc = ecryptfs_get_lower_file(ecryptfs_dentry, ecryptfs_inode); in ecryptfs_initialize_file()
230 if (rc) { in ecryptfs_initialize_file()
233 "[%pd]; rc = [%d]\n", __func__, in ecryptfs_initialize_file()
234 ecryptfs_dentry, rc); in ecryptfs_initialize_file()
237 rc = ecryptfs_write_metadata(ecryptfs_dentry, ecryptfs_inode); in ecryptfs_initialize_file()
238 if (rc) in ecryptfs_initialize_file()
239 printk(KERN_ERR "Error writing headers; rc = [%d]\n", rc); in ecryptfs_initialize_file()
242 return rc; in ecryptfs_initialize_file()
259 int rc; in ecryptfs_create() local
266 rc = PTR_ERR(ecryptfs_inode); in ecryptfs_create()
271 rc = ecryptfs_initialize_file(ecryptfs_dentry, ecryptfs_inode); in ecryptfs_create()
272 if (rc) { in ecryptfs_create()
280 return rc; in ecryptfs_create()
286 int rc; in ecryptfs_i_size_read() local
288 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_i_size_read()
289 if (rc) { in ecryptfs_i_size_read()
292 "[%pd]; rc = [%d]\n", __func__, in ecryptfs_i_size_read()
293 dentry, rc); in ecryptfs_i_size_read()
294 return rc; in ecryptfs_i_size_read()
302 rc = ecryptfs_read_and_validate_header_region(inode); in ecryptfs_i_size_read()
304 if (rc) { in ecryptfs_i_size_read()
305 rc = ecryptfs_read_and_validate_xattr_region(dentry, inode); in ecryptfs_i_size_read()
306 if (!rc) in ecryptfs_i_size_read()
323 int rc = 0; in ecryptfs_lookup_interpose() local
354 printk(KERN_ERR "%s: Error interposing; rc = [%ld]\n", in ecryptfs_lookup_interpose()
359 rc = ecryptfs_i_size_read(dentry, inode); in ecryptfs_lookup_interpose()
360 if (rc) { in ecryptfs_lookup_interpose()
362 return ERR_PTR(rc); in ecryptfs_lookup_interpose()
390 int rc = 0; in ecryptfs_lookup() local
397 rc = ecryptfs_encrypt_and_encode_filename( in ecryptfs_lookup()
400 if (rc) { in ecryptfs_lookup()
402 "filename; rc = [%d]\n", __func__, rc); in ecryptfs_lookup()
403 return ERR_PTR(rc); in ecryptfs_lookup()
429 int rc; in ecryptfs_link() local
433 rc = lock_parent(new_dentry, &lower_new_dentry, &lower_dir); in ecryptfs_link()
434 if (!rc) in ecryptfs_link()
435 rc = vfs_link(lower_old_dentry, &init_user_ns, lower_dir, in ecryptfs_link()
437 if (rc || d_really_is_negative(lower_new_dentry)) in ecryptfs_link()
439 rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb); in ecryptfs_link()
440 if (rc) in ecryptfs_link()
449 return rc; in ecryptfs_link()
461 int rc; in ecryptfs_symlink() local
468 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_symlink()
469 if (rc) in ecryptfs_symlink()
473 rc = ecryptfs_encrypt_and_encode_filename(&encoded_symname, in ecryptfs_symlink()
477 if (rc) in ecryptfs_symlink()
479 rc = vfs_symlink(&init_user_ns, lower_dir, lower_dentry, in ecryptfs_symlink()
482 if (rc || d_really_is_negative(lower_dentry)) in ecryptfs_symlink()
484 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_symlink()
485 if (rc) in ecryptfs_symlink()
493 return rc; in ecryptfs_symlink()
499 int rc; in ecryptfs_mkdir() local
503 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_mkdir()
504 if (!rc) in ecryptfs_mkdir()
505 rc = vfs_mkdir(&init_user_ns, lower_dir, in ecryptfs_mkdir()
507 if (rc || d_really_is_negative(lower_dentry)) in ecryptfs_mkdir()
509 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mkdir()
510 if (rc) in ecryptfs_mkdir()
519 return rc; in ecryptfs_mkdir()
526 int rc; in ecryptfs_rmdir() local
528 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_rmdir()
530 if (!rc) { in ecryptfs_rmdir()
532 rc = -EINVAL; in ecryptfs_rmdir()
534 rc = vfs_rmdir(&init_user_ns, lower_dir, lower_dentry); in ecryptfs_rmdir()
536 if (!rc) { in ecryptfs_rmdir()
543 if (!rc) in ecryptfs_rmdir()
545 return rc; in ecryptfs_rmdir()
552 int rc; in ecryptfs_mknod() local
556 rc = lock_parent(dentry, &lower_dentry, &lower_dir); in ecryptfs_mknod()
557 if (!rc) in ecryptfs_mknod()
558 rc = vfs_mknod(&init_user_ns, lower_dir, in ecryptfs_mknod()
560 if (rc || d_really_is_negative(lower_dentry)) in ecryptfs_mknod()
562 rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb); in ecryptfs_mknod()
563 if (rc) in ecryptfs_mknod()
571 return rc; in ecryptfs_mknod()
579 int rc; in ecryptfs_rename() local
601 rc = -EINVAL; in ecryptfs_rename()
613 rc = -ENOTEMPTY; in ecryptfs_rename()
623 rc = vfs_rename(&rd); in ecryptfs_rename()
624 if (rc) in ecryptfs_rename()
635 return rc; in ecryptfs_rename()
644 int rc; in ecryptfs_readlink_lower() local
650 rc = ecryptfs_decode_and_decrypt_filename(&buf, bufsiz, dentry->d_sb, in ecryptfs_readlink_lower()
653 if (rc) in ecryptfs_readlink_lower()
654 return ERR_PTR(rc); in ecryptfs_readlink_lower()
727 int rc = 0; in truncate_upper() local
738 rc = ecryptfs_get_lower_file(dentry, inode); in truncate_upper()
739 if (rc) in truncate_upper()
740 return rc; in truncate_upper()
751 rc = ecryptfs_write(inode, zero, in truncate_upper()
772 rc = -ENOMEM; in truncate_upper()
775 rc = ecryptfs_write(inode, zeros_virt, in truncate_upper()
778 if (rc) { in truncate_upper()
781 "reducing truncate; rc = [%d]\n", rc); in truncate_upper()
786 rc = ecryptfs_write_inode_size_to_metadata(inode); in truncate_upper()
787 if (rc) { in truncate_upper()
790 "rc = [%d]\n", rc); in truncate_upper()
807 return rc; in truncate_upper()
846 int rc; in ecryptfs_truncate() local
848 rc = ecryptfs_inode_newsize_ok(d_inode(dentry), new_length); in ecryptfs_truncate()
849 if (rc) in ecryptfs_truncate()
850 return rc; in ecryptfs_truncate()
852 rc = truncate_upper(dentry, &ia, &lower_ia); in ecryptfs_truncate()
853 if (!rc && lower_ia.ia_valid & ATTR_SIZE) { in ecryptfs_truncate()
857 rc = notify_change(&init_user_ns, lower_dentry, in ecryptfs_truncate()
861 return rc; in ecryptfs_truncate()
888 int rc = 0; in ecryptfs_setattr() local
897 rc = ecryptfs_init_crypt_stat(crypt_stat); in ecryptfs_setattr()
898 if (rc) in ecryptfs_setattr()
899 return rc; in ecryptfs_setattr()
914 rc = ecryptfs_get_lower_file(dentry, inode); in ecryptfs_setattr()
915 if (rc) { in ecryptfs_setattr()
919 rc = ecryptfs_read_metadata(dentry); in ecryptfs_setattr()
921 if (rc) { in ecryptfs_setattr()
924 rc = -EIO; in ecryptfs_setattr()
933 rc = 0; in ecryptfs_setattr()
940 rc = setattr_prepare(&init_user_ns, dentry, ia); in ecryptfs_setattr()
941 if (rc) in ecryptfs_setattr()
944 rc = ecryptfs_inode_newsize_ok(inode, ia->ia_size); in ecryptfs_setattr()
945 if (rc) in ecryptfs_setattr()
953 rc = truncate_upper(dentry, ia, &lower_ia); in ecryptfs_setattr()
954 if (rc < 0) in ecryptfs_setattr()
966 rc = notify_change(&init_user_ns, lower_dentry, &lower_ia, NULL); in ecryptfs_setattr()
970 return rc; in ecryptfs_setattr()
979 int rc = 0; in ecryptfs_getattr_link() local
993 rc = PTR_ERR(target); in ecryptfs_getattr_link()
996 return rc; in ecryptfs_getattr_link()
1005 int rc; in ecryptfs_getattr() local
1007 rc = vfs_getattr(ecryptfs_dentry_to_lower_path(dentry), &lower_stat, in ecryptfs_getattr()
1009 if (!rc) { in ecryptfs_getattr()
1015 return rc; in ecryptfs_getattr()
1023 int rc; in ecryptfs_setxattr() local
1030 rc = -EOPNOTSUPP; in ecryptfs_setxattr()
1034 rc = __vfs_setxattr_locked(&init_user_ns, lower_dentry, name, value, size, flags, NULL); in ecryptfs_setxattr()
1036 if (!rc && inode) in ecryptfs_setxattr()
1039 return rc; in ecryptfs_setxattr()
1046 int rc; in ecryptfs_getxattr_lower() local
1049 rc = -EOPNOTSUPP; in ecryptfs_getxattr_lower()
1053 rc = __vfs_getxattr(lower_dentry, lower_inode, name, value, size); in ecryptfs_getxattr_lower()
1056 return rc; in ecryptfs_getxattr_lower()
1071 int rc = 0; in ecryptfs_listxattr() local
1076 rc = -EOPNOTSUPP; in ecryptfs_listxattr()
1080 rc = d_inode(lower_dentry)->i_op->listxattr(lower_dentry, list, size); in ecryptfs_listxattr()
1083 return rc; in ecryptfs_listxattr()
1089 int rc; in ecryptfs_removexattr() local
1096 rc = -EOPNOTSUPP; in ecryptfs_removexattr()
1100 rc = __vfs_removexattr(&init_user_ns, lower_dentry, name); in ecryptfs_removexattr()
1103 return rc; in ecryptfs_removexattr()
1115 int rc; in ecryptfs_fileattr_set() local
1117 rc = vfs_fileattr_set(&init_user_ns, lower_dentry, fa); in ecryptfs_fileattr_set()
1120 return rc; in ecryptfs_fileattr_set()