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()
196 error = gfs2_instantiate(&i_gh); in gfs2_inode_lookup()
197 if (error) { in gfs2_inode_lookup()
223 if (error == GLR_TRYFAILED) in gfs2_inode_lookup()
224 error = -EAGAIN; in gfs2_inode_lookup()
234 return ERR_PTR(error); in gfs2_inode_lookup()
249 int error; in gfs2_lookup_by_inum() local
257 error = -EIO; in gfs2_lookup_by_inum()
265 return ERR_PTR(error); in gfs2_lookup_by_inum()
314 int error = 0; in gfs2_lookupi() local
329 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh); in gfs2_lookupi()
330 if (error) in gfs2_lookupi()
331 return ERR_PTR(error); in gfs2_lookupi()
335 error = gfs2_permission(&nop_mnt_idmap, dir, MAY_EXEC); in gfs2_lookupi()
336 if (error) in gfs2_lookupi()
342 error = PTR_ERR(inode); in gfs2_lookupi()
346 if (error == -ENOENT) in gfs2_lookupi()
348 return inode ? inode : ERR_PTR(error); in gfs2_lookupi()
363 int error; in create_ok() local
365 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode, in create_ok()
367 if (error) in create_ok()
368 return error; in create_ok()
408 int error; in alloc_dinode() local
410 error = gfs2_quota_lock_check(ip, &ap); in alloc_dinode()
411 if (error) in alloc_dinode()
414 error = gfs2_inplace_reserve(ip, &ap); in alloc_dinode()
415 if (error) in alloc_dinode()
418 error = gfs2_trans_begin(sdp, (*dblocks * RES_RG_BIT) + RES_STATFS + RES_QUOTA, 0); in alloc_dinode()
419 if (error) in alloc_dinode()
422 error = gfs2_alloc_blocks(ip, &ip->i_no_addr, dblocks, 1); in alloc_dinode()
423 if (error) in alloc_dinode()
439 return error; in alloc_dinode()
554 int error; in link_dinode() local
557 error = gfs2_quota_lock_check(dip, &ap); in link_dinode()
558 if (error) in link_dinode()
561 error = gfs2_inplace_reserve(dip, &ap); in link_dinode()
562 if (error) in link_dinode()
565 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, da, 2), 0); in link_dinode()
566 if (error) in link_dinode()
569 error = gfs2_trans_begin(sdp, RES_LEAF + 2 * RES_DINODE, 0); in link_dinode()
570 if (error) in link_dinode()
574 error = gfs2_dir_add(&dip->i_inode, name, ip, da); in link_dinode()
581 return error; in link_dinode()
617 * Returns: 0 on success, or error code
632 int error; in gfs2_create_inode() local
640 error = gfs2_qa_get(dip); in gfs2_create_inode()
641 if (error) in gfs2_create_inode()
642 return error; in gfs2_create_inode()
644 error = gfs2_rindex_update(sdp); in gfs2_create_inode()
645 if (error) in gfs2_create_inode()
648 error = gfs2_glock_nq_init(dip->i_gl, LM_ST_EXCLUSIVE, 0, &d_gh); in gfs2_create_inode()
649 if (error) in gfs2_create_inode()
653 error = create_ok(dip, name, mode); in gfs2_create_inode()
654 if (error) in gfs2_create_inode()
658 error = PTR_ERR(inode); in gfs2_create_inode()
666 error = 0; in gfs2_create_inode()
669 error = finish_open(file, dentry, gfs2_open_common); in gfs2_create_inode()
671 error = finish_no_open(file, NULL); in gfs2_create_inode()
675 } else if (error != -ENOENT) { in gfs2_create_inode()
679 error = gfs2_diradd_alloc_required(dir, name, &da); in gfs2_create_inode()
680 if (error < 0) in gfs2_create_inode()
684 error = -ENOMEM; in gfs2_create_inode()
689 error = posix_acl_create(dir, &mode, &default_acl, &acl); in gfs2_create_inode()
690 if (error) in gfs2_create_inode()
693 error = gfs2_qa_get(ip); in gfs2_create_inode()
694 if (error) in gfs2_create_inode()
739 error = alloc_dinode(ip, aflags, &blocks); in gfs2_create_inode()
740 if (error) in gfs2_create_inode()
745 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl); in gfs2_create_inode()
746 if (error) in gfs2_create_inode()
749 error = gfs2_glock_get(sdp, ip->i_no_addr, &gfs2_iopen_glops, CREATE, &io_gl); in gfs2_create_inode()
750 if (error) in gfs2_create_inode()
755 error = insert_inode_locked4(inode, ip->i_no_addr, iget_test, &ip->i_no_addr); in gfs2_create_inode()
756 if (error == -EBUSY) in gfs2_create_inode()
758 if (error) in gfs2_create_inode()
761 error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT | GL_NOPID, in gfs2_create_inode()
763 if (error) in gfs2_create_inode()
766 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, GL_SKIP, &gh); in gfs2_create_inode()
767 if (error) in gfs2_create_inode()
770 error = gfs2_trans_begin(sdp, blocks, 0); in gfs2_create_inode()
771 if (error) in gfs2_create_inode()
784 error = __gfs2_set_acl(inode, default_acl, ACL_TYPE_DEFAULT); in gfs2_create_inode()
785 if (error) in gfs2_create_inode()
791 error = __gfs2_set_acl(inode, acl, ACL_TYPE_ACCESS); in gfs2_create_inode()
792 if (error) in gfs2_create_inode()
798 error = security_inode_init_security(&ip->i_inode, &dip->i_inode, name, in gfs2_create_inode()
800 if (error) in gfs2_create_inode()
803 error = link_dinode(dip, name, ip, &da); in gfs2_create_inode()
804 if (error) in gfs2_create_inode()
813 error = finish_open(file, dentry, gfs2_open_common); in gfs2_create_inode()
821 return error; in gfs2_create_inode()
857 return error; in gfs2_create_inode()
894 int error; in __gfs2_lookup() local
905 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); in __gfs2_lookup()
906 if (error) { in __gfs2_lookup()
908 return ERR_PTR(error); in __gfs2_lookup()
917 error = finish_open(file, dentry, gfs2_open_common); in __gfs2_lookup()
920 if (error) { in __gfs2_lookup()
922 return ERR_PTR(error); in __gfs2_lookup()
955 int error; in gfs2_link() local
960 error = gfs2_qa_get(dip); in gfs2_link()
961 if (error) in gfs2_link()
962 return error; in gfs2_link()
967 error = gfs2_glock_nq(&d_gh); in gfs2_link()
968 if (error) in gfs2_link()
971 error = gfs2_glock_nq(&gh); in gfs2_link()
972 if (error) in gfs2_link()
975 error = -ENOENT; in gfs2_link()
979 error = gfs2_permission(&nop_mnt_idmap, dir, MAY_WRITE | MAY_EXEC); in gfs2_link()
980 if (error) in gfs2_link()
983 error = gfs2_dir_check(dir, &dentry->d_name, NULL); in gfs2_link()
984 switch (error) { in gfs2_link()
988 error = -EEXIST; in gfs2_link()
994 error = -EINVAL; in gfs2_link()
997 error = -EFBIG; in gfs2_link()
1000 error = -EPERM; in gfs2_link()
1003 error = -EMLINK; in gfs2_link()
1007 error = gfs2_diradd_alloc_required(dir, &dentry->d_name, &da); in gfs2_link()
1008 if (error < 0) in gfs2_link()
1013 error = gfs2_quota_lock_check(dip, &ap); in gfs2_link()
1014 if (error) in gfs2_link()
1017 error = gfs2_inplace_reserve(dip, &ap); in gfs2_link()
1018 if (error) in gfs2_link()
1021 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(dip, &da, 2), 0); in gfs2_link()
1022 if (error) in gfs2_link()
1025 error = gfs2_trans_begin(sdp, 2 * RES_DINODE + RES_LEAF, 0); in gfs2_link()
1026 if (error) in gfs2_link()
1030 error = gfs2_meta_inode_buffer(ip, &dibh); in gfs2_link()
1031 if (error) in gfs2_link()
1034 error = gfs2_dir_add(dir, &dentry->d_name, ip, &da); in gfs2_link()
1035 if (error) in gfs2_link()
1064 return error; in gfs2_link()
1081 int error; in gfs2_unlink_ok() local
1094 error = gfs2_permission(&nop_mnt_idmap, &dip->i_inode, in gfs2_unlink_ok()
1096 if (error) in gfs2_unlink_ok()
1097 return error; in gfs2_unlink_ok()
1110 * Returns: 0 on success, or an error
1118 int error; in gfs2_unlink_inode() local
1120 error = gfs2_dir_del(dip, dentry); in gfs2_unlink_inode()
1121 if (error) in gfs2_unlink_inode()
1122 return error; in gfs2_unlink_inode()
1156 int error; in gfs2_unlink() local
1158 error = gfs2_rindex_update(sdp); in gfs2_unlink()
1159 if (error) in gfs2_unlink()
1160 return error; in gfs2_unlink()
1162 error = -EROFS; in gfs2_unlink()
1174 error = gfs2_glock_nq(&d_gh); in gfs2_unlink()
1175 if (error) in gfs2_unlink()
1178 error = gfs2_glock_nq(&gh); in gfs2_unlink()
1179 if (error) in gfs2_unlink()
1182 error = -ENOENT; in gfs2_unlink()
1187 error = -ENOTEMPTY; in gfs2_unlink()
1192 error = gfs2_glock_nq(&r_gh); /* rgrp */ in gfs2_unlink()
1193 if (error) in gfs2_unlink()
1196 error = gfs2_unlink_ok(dip, &dentry->d_name, ip); in gfs2_unlink()
1197 if (error) in gfs2_unlink()
1200 error = gfs2_trans_begin(sdp, 2*RES_DINODE + 3*RES_LEAF + RES_RG_BIT, 0); in gfs2_unlink()
1201 if (error) in gfs2_unlink()
1204 error = gfs2_unlink_inode(dip, dentry); in gfs2_unlink()
1218 return error; in gfs2_unlink()
1284 * Returns: error code or 0 for success
1334 int error = 0; in gfs2_ok_to_move() local
1340 error = -EINVAL; in gfs2_ok_to_move()
1344 error = 0; in gfs2_ok_to_move()
1350 error = -ENOENT; in gfs2_ok_to_move()
1354 error = PTR_ERR(tmp); in gfs2_ok_to_move()
1364 return error; in gfs2_ok_to_move()
1412 int error; in gfs2_rename() local
1422 error = gfs2_rindex_update(sdp); in gfs2_rename()
1423 if (error) in gfs2_rename()
1424 return error; in gfs2_rename()
1426 error = gfs2_qa_get(ndip); in gfs2_rename()
1427 if (error) in gfs2_rename()
1428 return error; in gfs2_rename()
1431 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, in gfs2_rename()
1433 if (error) in gfs2_rename()
1439 error = gfs2_ok_to_move(ip, ndip); in gfs2_rename()
1440 if (error) in gfs2_rename()
1462 error = gfs2_glock_nq(ghs + x); in gfs2_rename()
1463 if (error) in gfs2_rename()
1466 error = gfs2_glock_async_wait(num_gh, ghs); in gfs2_rename()
1467 if (error) in gfs2_rename()
1477 error = -ENOENT; in gfs2_rename()
1480 error = gfs2_glock_nq_init(nrgd->rd_gl, LM_ST_EXCLUSIVE, in gfs2_rename()
1482 if (error) in gfs2_rename()
1486 error = -ENOENT; in gfs2_rename()
1492 error = gfs2_unlink_ok(odip, &odentry->d_name, ip); in gfs2_rename()
1493 if (error) in gfs2_rename()
1499 error = gfs2_unlink_ok(ndip, &ndentry->d_name, nip); in gfs2_rename()
1500 if (error) in gfs2_rename()
1504 error = -EAGAIN; in gfs2_rename()
1511 error = -EIO; in gfs2_rename()
1515 error = -ENOTEMPTY; in gfs2_rename()
1520 error = gfs2_permission(&nop_mnt_idmap, ndir, in gfs2_rename()
1522 if (error) in gfs2_rename()
1525 error = gfs2_dir_check(ndir, &ndentry->d_name, NULL); in gfs2_rename()
1526 switch (error) { in gfs2_rename()
1528 error = 0; in gfs2_rename()
1531 error = -EEXIST; in gfs2_rename()
1539 error = -ENOENT; in gfs2_rename()
1543 error = -EFBIG; in gfs2_rename()
1548 error = -EMLINK; in gfs2_rename()
1557 error = gfs2_permission(&nop_mnt_idmap, d_inode(odentry), in gfs2_rename()
1559 if (error) in gfs2_rename()
1564 error = gfs2_diradd_alloc_required(ndir, &ndentry->d_name, &da); in gfs2_rename()
1565 if (error) in gfs2_rename()
1571 error = gfs2_quota_lock_check(ndip, &ap); in gfs2_rename()
1572 if (error) in gfs2_rename()
1575 error = gfs2_inplace_reserve(ndip, &ap); in gfs2_rename()
1576 if (error) in gfs2_rename()
1579 error = gfs2_trans_begin(sdp, gfs2_trans_da_blks(ndip, &da, 4) + in gfs2_rename()
1581 if (error) in gfs2_rename()
1584 error = gfs2_trans_begin(sdp, 4 * RES_DINODE + in gfs2_rename()
1586 if (error) in gfs2_rename()
1593 error = gfs2_unlink_inode(ndip, ndentry); in gfs2_rename()
1595 error = update_moved_ino(ip, ndip, dir_rename); in gfs2_rename()
1596 if (error) in gfs2_rename()
1599 error = gfs2_dir_del(odip, odentry); in gfs2_rename()
1600 if (error) in gfs2_rename()
1603 error = gfs2_dir_add(ndir, &ndentry->d_name, ip, &da); in gfs2_rename()
1604 if (error) in gfs2_rename()
1630 return error; in gfs2_rename()
1658 int error; in gfs2_exchange() local
1661 error = gfs2_rindex_update(sdp); in gfs2_exchange()
1662 if (error) in gfs2_exchange()
1663 return error; in gfs2_exchange()
1666 error = gfs2_glock_nq_init(sdp->sd_rename_gl, LM_ST_EXCLUSIVE, in gfs2_exchange()
1668 if (error) in gfs2_exchange()
1673 error = gfs2_ok_to_move(oip, ndip); in gfs2_exchange()
1674 if (error) in gfs2_exchange()
1680 error = gfs2_ok_to_move(nip, odip); in gfs2_exchange()
1681 if (error) in gfs2_exchange()
1700 error = gfs2_glock_nq(ghs + x); in gfs2_exchange()
1701 if (error) in gfs2_exchange()
1705 error = gfs2_glock_async_wait(num_gh, ghs); in gfs2_exchange()
1706 if (error) in gfs2_exchange()
1709 error = -ENOENT; in gfs2_exchange()
1713 error = gfs2_unlink_ok(odip, &odentry->d_name, oip); in gfs2_exchange()
1714 if (error) in gfs2_exchange()
1716 error = gfs2_unlink_ok(ndip, &ndentry->d_name, nip); in gfs2_exchange()
1717 if (error) in gfs2_exchange()
1721 error = gfs2_permission(&nop_mnt_idmap, odentry->d_inode, in gfs2_exchange()
1723 if (error) in gfs2_exchange()
1727 error = gfs2_permission(&nop_mnt_idmap, ndentry->d_inode, in gfs2_exchange()
1729 if (error) in gfs2_exchange()
1732 error = gfs2_trans_begin(sdp, 4 * RES_DINODE + 4 * RES_LEAF, 0); in gfs2_exchange()
1733 if (error) in gfs2_exchange()
1736 error = update_moved_ino(oip, ndip, S_ISDIR(old_mode)); in gfs2_exchange()
1737 if (error) in gfs2_exchange()
1740 error = update_moved_ino(nip, odip, S_ISDIR(new_mode)); in gfs2_exchange()
1741 if (error) in gfs2_exchange()
1744 error = gfs2_dir_mvino(ndip, &ndentry->d_name, oip, in gfs2_exchange()
1746 if (error) in gfs2_exchange()
1749 error = gfs2_dir_mvino(odip, &odentry->d_name, nip, in gfs2_exchange()
1751 if (error) in gfs2_exchange()
1779 return error; in gfs2_exchange()
1805 * Returns: 0 on success or error code
1817 int error; in gfs2_get_link() local
1823 error = gfs2_glock_nq(&i_gh); in gfs2_get_link()
1824 if (error) { in gfs2_get_link()
1826 return ERR_PTR(error); in gfs2_get_link()
1836 error = gfs2_meta_inode_buffer(ip, &dibh); in gfs2_get_link()
1837 if (error) { in gfs2_get_link()
1838 buf = ERR_PTR(error); in gfs2_get_link()
1875 int error; in gfs2_permission() local
1888 error = gfs2_glock_nq_init(gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); in gfs2_permission()
1889 if (error) in gfs2_permission()
1890 return error; in gfs2_permission()
1894 error = -EPERM; in gfs2_permission()
1896 error = generic_permission(&nop_mnt_idmap, inode, mask); in gfs2_permission()
1900 return error; in gfs2_permission()
1912 int error; in gfs2_setattr_simple() local
1917 error = gfs2_trans_begin(GFS2_SB(inode), RES_DINODE, 0); in gfs2_setattr_simple()
1918 if (error) in gfs2_setattr_simple()
1919 return error; in gfs2_setattr_simple()
1921 error = __gfs2_setattr_simple(inode, attr); in gfs2_setattr_simple()
1923 return error; in gfs2_setattr_simple()
1932 int error; in setattr_chown() local
1944 error = gfs2_qa_get(ip); in setattr_chown()
1945 if (error) in setattr_chown()
1946 return error; in setattr_chown()
1948 error = gfs2_rindex_update(sdp); in setattr_chown()
1949 if (error) in setattr_chown()
1952 error = gfs2_quota_lock(ip, nuid, ngid); in setattr_chown()
1953 if (error) in setattr_chown()
1960 error = gfs2_quota_check(ip, nuid, ngid, &ap); in setattr_chown()
1961 if (error) in setattr_chown()
1965 error = gfs2_trans_begin(sdp, RES_DINODE + 2 * RES_QUOTA, 0); in setattr_chown()
1966 if (error) in setattr_chown()
1969 error = gfs2_setattr_simple(inode, attr); in setattr_chown()
1970 if (error) in setattr_chown()
1985 return error; in setattr_chown()
2006 int error; in gfs2_setattr() local
2008 error = gfs2_qa_get(ip); in gfs2_setattr()
2009 if (error) in gfs2_setattr()
2010 return error; in gfs2_setattr()
2012 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &i_gh); in gfs2_setattr()
2013 if (error) in gfs2_setattr()
2016 error = may_setattr(&nop_mnt_idmap, inode, attr->ia_valid); in gfs2_setattr()
2017 if (error) in gfs2_setattr()
2018 goto error; in gfs2_setattr()
2020 error = setattr_prepare(&nop_mnt_idmap, dentry, attr); in gfs2_setattr()
2021 if (error) in gfs2_setattr()
2022 goto error; in gfs2_setattr()
2025 error = gfs2_setattr_size(inode, attr->ia_size); in gfs2_setattr()
2027 error = setattr_chown(inode, attr); in gfs2_setattr()
2029 error = gfs2_setattr_simple(inode, attr); in gfs2_setattr()
2030 if (!error && attr->ia_valid & ATTR_MODE) in gfs2_setattr()
2031 error = posix_acl_chmod(&nop_mnt_idmap, dentry, in gfs2_setattr()
2035 error: in gfs2_setattr()
2036 if (!error) in gfs2_setattr()
2041 return error; in gfs2_setattr()
2069 int error; in gfs2_getattr() local
2073 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &gh); in gfs2_getattr()
2074 if (error) in gfs2_getattr()
2075 return error; in gfs2_getattr()
2163 int error; in gfs2_update_time() local
2169 error = gfs2_glock_nq(gh); in gfs2_update_time()
2170 if (error) in gfs2_update_time()
2171 return error; in gfs2_update_time()