Lines Matching full:error

111  * Returns: A VFS inode, or an error
121 int error; in gfs2_inode_lookup() local
135 error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, in gfs2_inode_lookup()
137 if (unlikely(error)) in gfs2_inode_lookup()
140 error = gfs2_glock_get(sdp, no_addr, &gfs2_iopen_glops, CREATE, in gfs2_inode_lookup()
142 if (unlikely(error)) in gfs2_inode_lookup()
154 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, in gfs2_inode_lookup()
158 if (unlikely(error)) in gfs2_inode_lookup()
167 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, in gfs2_inode_lookup()
169 if (error) in gfs2_inode_lookup()
172 error = -ESTALE; in gfs2_inode_lookup()
178 error = gfs2_check_blk_type(sdp, no_addr, in gfs2_inode_lookup()
180 if (error) in gfs2_inode_lookup()
195 error = gfs2_instantiate(&i_gh); in gfs2_inode_lookup()
196 if (error) { in gfs2_inode_lookup()
222 if (error == GLR_TRYFAILED) in gfs2_inode_lookup()
223 error = -EAGAIN; in gfs2_inode_lookup()
233 return ERR_PTR(error); in gfs2_inode_lookup()
248 int error; in gfs2_lookup_by_inum() local
256 error = -EIO; in gfs2_lookup_by_inum()
264 return ERR_PTR(error); in gfs2_lookup_by_inum()
313 int error = 0; in gfs2_lookupi() local
328 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh); in gfs2_lookupi()
329 if (error) in gfs2_lookupi()
330 return ERR_PTR(error); in gfs2_lookupi()
334 error = gfs2_permission(&nop_mnt_idmap, dir, MAY_EXEC); in gfs2_lookupi()
335 if (error) in gfs2_lookupi()
341 error = PTR_ERR(inode); in gfs2_lookupi()
345 if (error == -ENOENT) in gfs2_lookupi()
347 return inode ? inode : ERR_PTR(error); in gfs2_lookupi()
362 int error; in create_ok() local
364 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode, in create_ok()
366 if (error) in create_ok()
367 return error; in create_ok()
407 int error; in alloc_dinode() local
409 error = gfs2_quota_lock_check(ip, &ap); in alloc_dinode()
410 if (error) in alloc_dinode()
413 error = gfs2_inplace_reserve(ip, &ap); in alloc_dinode()
414 if (error) in alloc_dinode()
417 error = gfs2_trans_begin(sdp, (*dblocks * RES_RG_BIT) + RES_STATFS + RES_QUOTA, 0); in alloc_dinode()
418 if (error) in alloc_dinode()
421 error = gfs2_alloc_blocks(ip, &ip->i_no_addr, dblocks, 1); in alloc_dinode()
422 if (error) in alloc_dinode()
438 return error; in alloc_dinode()
553 int error; in link_dinode() local
556 error = gfs2_quota_lock_check(dip, &ap); in link_dinode()
557 if (error) in link_dinode()
560 error = gfs2_inplace_reserve(dip, &ap); in link_dinode()
561 if (error) in link_dinode()
564 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, da, 2), 0); in link_dinode()
565 if (error) in link_dinode()
568 error = gfs2_trans_begin(sdp, RES_LEAF + 2 * RES_DINODE, 0); in link_dinode()
569 if (error) in link_dinode()
573 error = gfs2_dir_add(&dip->i_inode, name, ip, da); in link_dinode()
580 return error; in link_dinode()
616 * Returns: 0 on success, or error code
631 int error; in gfs2_create_inode() local
639 error = gfs2_qa_get(dip); in gfs2_create_inode()
640 if (error) in gfs2_create_inode()
641 return error; in gfs2_create_inode()
643 error = gfs2_rindex_update(sdp); in gfs2_create_inode()
644 if (error) in gfs2_create_inode()
647 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh); in gfs2_create_inode()
648 if (error) in gfs2_create_inode()
652 error = create_ok(dip, name, mode); in gfs2_create_inode()
653 if (error) in gfs2_create_inode()
657 error = PTR_ERR(inode); in gfs2_create_inode()
665 error = 0; in gfs2_create_inode()
668 error = finish_open(file, dentry, gfs2_open_common); in gfs2_create_inode()
670 error = finish_no_open(file, NULL); in gfs2_create_inode()
674 } else if (error != -ENOENT) { in gfs2_create_inode()
678 error = gfs2_diradd_alloc_required(dir, name, &da); in gfs2_create_inode()
679 if (error < 0) in gfs2_create_inode()
683 error = -ENOMEM; in gfs2_create_inode()
688 error = posix_acl_create(dir, &mode, &default_acl, &acl); in gfs2_create_inode()
689 if (error) in gfs2_create_inode()
692 error = gfs2_qa_get(ip); in gfs2_create_inode()
693 if (error) in gfs2_create_inode()
738 error = alloc_dinode(ip, aflags, &blocks); in gfs2_create_inode()
739 if (error) in gfs2_create_inode()
744 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl); in gfs2_create_inode()
745 if (error) in gfs2_create_inode()
748 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_iopen_glops, CREATE, &io_gl); in gfs2_create_inode()
749 if (error) in gfs2_create_inode()
754 error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr); in gfs2_create_inode()
755 if (error == -EBUSY) in gfs2_create_inode()
757 if (error) in gfs2_create_inode()
760 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID, in gfs2_create_inode()
762 if (error) in gfs2_create_inode()
765 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); in gfs2_create_inode()
766 if (error) in gfs2_create_inode()
769 error = gfs2_trans_begin(sdp, blocks, 0); in gfs2_create_inode()
770 if (error) in gfs2_create_inode()
783 error = __gfs2_set_acl(inode, default_acl, ACL_TYPE_DEFAULT); in gfs2_create_inode()
784 if (error) in gfs2_create_inode()
790 error = __gfs2_set_acl(inode, acl, ACL_TYPE_ACCESS); in gfs2_create_inode()
791 if (error) in gfs2_create_inode()
797 error = security_inode_init_security(&ip->i_inode, &dip->i_inode, name, in gfs2_create_inode()
799 if (error) in gfs2_create_inode()
802 error = link_dinode(dip, name, ip, &da); in gfs2_create_inode()
803 if (error) in gfs2_create_inode()
812 error = finish_open(file, dentry, gfs2_open_common); in gfs2_create_inode()
820 return error; in gfs2_create_inode()
856 return error; in gfs2_create_inode()
893 int error; in __gfs2_lookup() local
904 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); in __gfs2_lookup()
905 if (error) { in __gfs2_lookup()
907 return ERR_PTR(error); in __gfs2_lookup()
916 error = finish_open(file, dentry, gfs2_open_common); in __gfs2_lookup()
919 if (error) { in __gfs2_lookup()
921 return ERR_PTR(error); in __gfs2_lookup()
954 int error; in gfs2_link() local
959 error = gfs2_qa_get(dip); in gfs2_link()
960 if (error) in gfs2_link()
961 return error; in gfs2_link()
966 error = gfs2_glock_nq(&d_gh); in gfs2_link()
967 if (error) in gfs2_link()
970 error = gfs2_glock_nq(&gh); in gfs2_link()
971 if (error) in gfs2_link()
974 error = -ENOENT; in gfs2_link()
978 error = gfs2_permission(&nop_mnt_idmap, dir, MAY_WRITE | MAY_EXEC); in gfs2_link()
979 if (error) in gfs2_link()
982 error = gfs2_dir_check(dir, &dentry->d_name, NULL); in gfs2_link()
983 switch (error) { in gfs2_link()
987 error = -EEXIST; in gfs2_link()
993 error = -EINVAL; in gfs2_link()
996 error = -EFBIG; in gfs2_link()
999 error = -EPERM; in gfs2_link()
1002 error = -EMLINK; in gfs2_link()
1006 error = gfs2_diradd_alloc_required(dir, &dentry->d_name, &da); in gfs2_link()
1007 if (error < 0) in gfs2_link()
1012 error = gfs2_quota_lock_check(dip, &ap); in gfs2_link()
1013 if (error) in gfs2_link()
1016 error = gfs2_inplace_reserve(dip, &ap); in gfs2_link()
1017 if (error) in gfs2_link()
1020 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, &da, 2), 0); in gfs2_link()
1021 if (error) in gfs2_link()
1024 error = gfs2_trans_begin(sdp, 2 * RES_DINODE + RES_LEAF, 0); in gfs2_link()
1025 if (error) in gfs2_link()
1029 error = gfs2_meta_inode_buffer(ip, &dibh); in gfs2_link()
1030 if (error) in gfs2_link()
1033 error = gfs2_dir_add(dir, &dentry->d_name, ip, &da); in gfs2_link()
1034 if (error) in gfs2_link()
1063 return error; in gfs2_link()
1080 int error; in gfs2_unlink_ok() local
1093 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode, in gfs2_unlink_ok()
1095 if (error) in gfs2_unlink_ok()
1096 return error; in gfs2_unlink_ok()
1109 * Returns: 0 on success, or an error
1117 int error; in gfs2_unlink_inode() local
1119 error = gfs2_dir_del(dip, dentry); in gfs2_unlink_inode()
1120 if (error) in gfs2_unlink_inode()
1121 return error; in gfs2_unlink_inode()
1155 int error; in gfs2_unlink() local
1157 error = gfs2_rindex_update(sdp); in gfs2_unlink()
1158 if (error) in gfs2_unlink()
1159 return error; in gfs2_unlink()
1161 error = -EROFS; in gfs2_unlink()
1173 error = gfs2_glock_nq(&d_gh); in gfs2_unlink()
1174 if (error) in gfs2_unlink()
1177 error = gfs2_glock_nq(&gh); in gfs2_unlink()
1178 if (error) in gfs2_unlink()
1181 error = -ENOENT; in gfs2_unlink()
1186 error = -ENOTEMPTY; in gfs2_unlink()
1191 error = gfs2_glock_nq(&r_gh); /* rgrp */ in gfs2_unlink()
1192 if (error) in gfs2_unlink()
1195 error = gfs2_unlink_ok(dip, &dentry->d_name, ip); in gfs2_unlink()
1196 if (error) in gfs2_unlink()
1199 error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); in gfs2_unlink()
1200 if (error) in gfs2_unlink()
1203 error = gfs2_unlink_inode(dip, dentry); in gfs2_unlink()
1217 return error; in gfs2_unlink()
1283 * Returns: error code or 0 for success
1333 int error = 0; in gfs2_ok_to_move() local
1339 error = -EINVAL; in gfs2_ok_to_move()
1343 error = 0; in gfs2_ok_to_move()
1349 error = -ENOENT; in gfs2_ok_to_move()
1353 error = PTR_ERR(tmp); in gfs2_ok_to_move()
1363 return error; in gfs2_ok_to_move()
1411 int error; in gfs2_rename() local
1421 error = gfs2_rindex_update(sdp); in gfs2_rename()
1422 if (error) in gfs2_rename()
1423 return error; in gfs2_rename()
1425 error = gfs2_qa_get(ndip); in gfs2_rename()
1426 if (error) in gfs2_rename()
1427 return error; in gfs2_rename()
1430 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, in gfs2_rename()
1432 if (error) in gfs2_rename()
1438 error = gfs2_ok_to_move(ip, ndip); in gfs2_rename()
1439 if (error) in gfs2_rename()
1461 error = gfs2_glock_nq(ghs + x); in gfs2_rename()
1462 if (error) in gfs2_rename()
1465 error = gfs2_glock_async_wait(num_gh, ghs); in gfs2_rename()
1466 if (error) in gfs2_rename()
1476 error = -ENOENT; in gfs2_rename()
1479 error = gfs2_glock_nq_init(nrgd->rd_gl, LM_ST_EXCLUSIVE, in gfs2_rename()
1481 if (error) in gfs2_rename()
1485 error = -ENOENT; in gfs2_rename()
1491 error = gfs2_unlink_ok(odip, &odentry->d_name, ip); in gfs2_rename()
1492 if (error) in gfs2_rename()
1498 error = gfs2_unlink_ok(ndip, &ndentry->d_name, nip); in gfs2_rename()
1499 if (error) in gfs2_rename()
1503 error = -EAGAIN; in gfs2_rename()
1510 error = -EIO; in gfs2_rename()
1514 error = -ENOTEMPTY; in gfs2_rename()
1519 error = gfs2_permission(&nop_mnt_idmap, ndir, in gfs2_rename()
1521 if (error) in gfs2_rename()
1524 error = gfs2_dir_check(ndir, &ndentry->d_name, NULL); in gfs2_rename()
1525 switch (error) { in gfs2_rename()
1527 error = 0; in gfs2_rename()
1530 error = -EEXIST; in gfs2_rename()
1538 error = -ENOENT; in gfs2_rename()
1542 error = -EFBIG; in gfs2_rename()
1547 error = -EMLINK; in gfs2_rename()
1556 error = gfs2_permission(&nop_mnt_idmap, d_inode(odentry), in gfs2_rename()
1558 if (error) in gfs2_rename()
1563 error = gfs2_diradd_alloc_required(ndir, &ndentry->d_name, &da); in gfs2_rename()
1564 if (error) in gfs2_rename()
1570 error = gfs2_quota_lock_check(ndip, &ap); in gfs2_rename()
1571 if (error) in gfs2_rename()
1574 error = gfs2_inplace_reserve(ndip, &ap); in gfs2_rename()
1575 if (error) in gfs2_rename()
1578 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(ndip, &da, 4) + in gfs2_rename()
1580 if (error) in gfs2_rename()
1583 error = gfs2_trans_begin(sdp, 4 * RES_DINODE + in gfs2_rename()
1585 if (error) in gfs2_rename()
1592 error = gfs2_unlink_inode(ndip, ndentry); in gfs2_rename()
1594 error = update_moved_ino(ip, ndip, dir_rename); in gfs2_rename()
1595 if (error) in gfs2_rename()
1598 error = gfs2_dir_del(odip, odentry); in gfs2_rename()
1599 if (error) in gfs2_rename()
1602 error = gfs2_dir_add(ndir, &ndentry->d_name, ip, &da); in gfs2_rename()
1603 if (error) in gfs2_rename()
1629 return error; in gfs2_rename()
1657 int error; in gfs2_exchange() local
1660 error = gfs2_rindex_update(sdp); in gfs2_exchange()
1661 if (error) in gfs2_exchange()
1662 return error; in gfs2_exchange()
1665 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, in gfs2_exchange()
1667 if (error) in gfs2_exchange()
1672 error = gfs2_ok_to_move(oip, ndip); in gfs2_exchange()
1673 if (error) in gfs2_exchange()
1679 error = gfs2_ok_to_move(nip, odip); in gfs2_exchange()
1680 if (error) in gfs2_exchange()
1699 error = gfs2_glock_nq(ghs + x); in gfs2_exchange()
1700 if (error) in gfs2_exchange()
1704 error = gfs2_glock_async_wait(num_gh, ghs); in gfs2_exchange()
1705 if (error) in gfs2_exchange()
1708 error = -ENOENT; in gfs2_exchange()
1712 error = gfs2_unlink_ok(odip, &odentry->d_name, oip); in gfs2_exchange()
1713 if (error) in gfs2_exchange()
1715 error = gfs2_unlink_ok(ndip, &ndentry->d_name, nip); in gfs2_exchange()
1716 if (error) in gfs2_exchange()
1720 error = gfs2_permission(&nop_mnt_idmap, odentry->d_inode, in gfs2_exchange()
1722 if (error) in gfs2_exchange()
1726 error = gfs2_permission(&nop_mnt_idmap, ndentry->d_inode, in gfs2_exchange()
1728 if (error) in gfs2_exchange()
1731 error = gfs2_trans_begin(sdp, 4 * RES_DINODE + 4 * RES_LEAF, 0); in gfs2_exchange()
1732 if (error) in gfs2_exchange()
1735 error = update_moved_ino(oip, ndip, S_ISDIR(old_mode)); in gfs2_exchange()
1736 if (error) in gfs2_exchange()
1739 error = update_moved_ino(nip, odip, S_ISDIR(new_mode)); in gfs2_exchange()
1740 if (error) in gfs2_exchange()
1743 error = gfs2_dir_mvino(ndip, &ndentry->d_name, oip, in gfs2_exchange()
1745 if (error) in gfs2_exchange()
1748 error = gfs2_dir_mvino(odip, &odentry->d_name, nip, in gfs2_exchange()
1750 if (error) in gfs2_exchange()
1778 return error; in gfs2_exchange()
1804 * Returns: 0 on success or error code
1816 int error; in gfs2_get_link() local
1822 error = gfs2_glock_nq(&i_gh); in gfs2_get_link()
1823 if (error) { in gfs2_get_link()
1825 return ERR_PTR(error); in gfs2_get_link()
1835 error = gfs2_meta_inode_buffer(ip, &dibh); in gfs2_get_link()
1836 if (error) { in gfs2_get_link()
1837 buf = ERR_PTR(error); in gfs2_get_link()
1874 int error; in gfs2_permission() local
1887 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); in gfs2_permission()
1888 if (error) in gfs2_permission()
1889 return error; in gfs2_permission()
1893 error = -EPERM; in gfs2_permission()
1895 error = generic_permission(&nop_mnt_idmap, inode, mask); in gfs2_permission()
1899 return error; in gfs2_permission()
1911 int error; in gfs2_setattr_simple() local
1916 error = gfs2_trans_begin(GFS2_SB(inode), RES_DINODE, 0); in gfs2_setattr_simple()
1917 if (error) in gfs2_setattr_simple()
1918 return error; in gfs2_setattr_simple()
1920 error = __gfs2_setattr_simple(inode, attr); in gfs2_setattr_simple()
1922 return error; in gfs2_setattr_simple()
1931 int error; in setattr_chown() local
1943 error = gfs2_qa_get(ip); in setattr_chown()
1944 if (error) in setattr_chown()
1945 return error; in setattr_chown()
1947 error = gfs2_rindex_update(sdp); in setattr_chown()
1948 if (error) in setattr_chown()
1951 error = gfs2_quota_lock(ip, nuid, ngid); in setattr_chown()
1952 if (error) in setattr_chown()
1959 error = gfs2_quota_check(ip, nuid, ngid, &ap); in setattr_chown()
1960 if (error) in setattr_chown()
1964 error = gfs2_trans_begin(sdp, RES_DINODE + 2 * RES_QUOTA, 0); in setattr_chown()
1965 if (error) in setattr_chown()
1968 error = gfs2_setattr_simple(inode, attr); in setattr_chown()
1969 if (error) in setattr_chown()
1984 return error; in setattr_chown()
2005 int error; in gfs2_setattr() local
2007 error = gfs2_qa_get(ip); in gfs2_setattr()
2008 if (error) in gfs2_setattr()
2009 return error; in gfs2_setattr()
2011 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh); in gfs2_setattr()
2012 if (error) in gfs2_setattr()
2015 error = may_setattr(&nop_mnt_idmap, inode, attr->ia_valid); in gfs2_setattr()
2016 if (error) in gfs2_setattr()
2017 goto error; in gfs2_setattr()
2019 error = setattr_prepare(&nop_mnt_idmap, dentry, attr); in gfs2_setattr()
2020 if (error) in gfs2_setattr()
2021 goto error; in gfs2_setattr()
2024 error = gfs2_setattr_size(inode, attr->ia_size); in gfs2_setattr()
2026 error = setattr_chown(inode, attr); in gfs2_setattr()
2028 error = gfs2_setattr_simple(inode, attr); in gfs2_setattr()
2029 if (!error && attr->ia_valid & ATTR_MODE) in gfs2_setattr()
2030 error = posix_acl_chmod(&nop_mnt_idmap, dentry, in gfs2_setattr()
2034 error: in gfs2_setattr()
2035 if (!error) in gfs2_setattr()
2040 return error; in gfs2_setattr()
2068 int error; in gfs2_getattr() local
2072 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); in gfs2_getattr()
2073 if (error) in gfs2_getattr()
2074 return error; in gfs2_getattr()
2162 int error; in gfs2_update_time() local
2168 error = gfs2_glock_nq(gh); in gfs2_update_time()
2169 if (error) in gfs2_update_time()
2170 return error; in gfs2_update_time()