Lines Matching defs:err

131 	int err;
138 err = -EINVAL;
139 return ERR_PTR(err);
143 err = -ENOMEM;
144 return ERR_PTR(err);
164 int err;
167 err = kern_path(root_name, 0, &root_path);
168 if (err) {
169 hmdfs_info("kern_path failed: %d", err);
170 return ERR_PTR(err);
253 hmdfs_err("kern_path failed err = %d", ret);
293 int err;
311 err = kern_path(node->sbi->local_dst, LOOKUP_DIRECTORY, &root_path);
312 if (err) {
314 ret = err;
318 err = vfs_path_lookup(root_path.dentry, root_path.mnt, file_name, 0,
320 if (err) {
322 ret = err;
326 err = vfs_getxattr(&nop_mnt_idmap, file_path.dentry, DATA_SEC_LEVEL_LABEL, value,
328 if (err <= 0 && node->devsl >= DATA_SEC_LEVEL3)
330 if (err > 0 && node->devsl >= parse_data_sec_level(value, err))
348 int err = 0;
362 err = hmdfs_check_share_access_permission(con->sbi,
364 if (err)
365 return ERR_PTR(err);
381 hmdfs_err("file_id alloc failed! err=%d", id);
520 hmdfs_err("call vfs_getattr failed, err %d", ret);
576 hmdfs_err("sending msg response failed, file_id %d, err %d",
601 int err = 0;
606 err = vfs_create(&nop_mnt_idmap, d_inode(path_parent->dentry), dentry, mode,
608 if (err)
609 hmdfs_err("create failed, err %d", err);
612 err = -EEXIST;
615 err = -EINVAL;
617 err = -EISDIR;
620 return err;
626 int err = 0;
634 err = kern_path(con->sbi->local_dst, LOOKUP_DIRECTORY, &path_root);
635 if (err) {
636 hmdfs_err("no path for %s, err %d", con->sbi->local_dst, err);
637 return err;
640 err = vfs_path_lookup(path_root.dentry, path_root.mnt, path,
642 if (err) {
643 hmdfs_info("no dir in %s, err %d", con->sbi->local_dst, err);
650 err = PTR_ERR(dentry);
656 err = hmdfs_check_and_create(&path_parent, dentry, con->device_id,
660 if (err) {
671 return err;
678 int err = 0;
682 err = PTR_ERR(info->file);
683 hmdfs_err("open file failed, err %d", err);
684 return err;
690 err = info->file_id;
691 hmdfs_err("file_id alloc failed! err %d", err);
694 return err;
708 int err = 0;
710 err = hmdfs_lookup_create(con, recv, &child_path, &truncate);
711 if (err)
712 return err;
714 err = hmdfs_dentry_open(con, &child_path, info);
715 if (err)
718 err = hmdfs_get_open_info(con, HM_REG, NULL, info);
719 if (err)
723 err = vfs_truncate(&child_path, 0);
724 if (err) {
725 hmdfs_err("truncate failed, err %d", err);
733 if (err) {
740 return err;
746 int err;
754 err = -EINVAL;
758 err = -EINVAL;
765 err = -ENOMEM;
769 err = hmdfs_server_do_atomic_open(con, cmd, recv, info, resp);
772 if (err) {
773 hmdfs_send_err_response(con, cmd, err);
775 err = hmdfs_sendmessage_response(con, cmd, sizeof(*resp), resp,
777 if (err) {
778 hmdfs_err("sending msg response failed, file_id %d, err %d",
779 info->file_id, err);
949 hmdfs_err("read file failed, err:%zd", bytes);
1046 int err = 0;
1048 err = kern_path(peer->sbi->local_dst, 0, &root_path);
1049 if (err)
1052 err = vfs_path_lookup(root_path.dentry, root_path.mnt, req_path,
1056 return err;
1072 int err = 0;
1074 err = server_lookup(peer, req_path, &up_p);
1075 if (err)
1083 err = PTR_ERR(lo_p_name);
1087 return err ? ERR_PTR(err) : lo_p_name;
1096 int err = 0;
1103 err = -EINVAL;
1109 err = PTR_ERR(lo_p_name);
1110 hmdfs_info("Failed to get lower path: %d", err);
1124 err = PTR_ERR(filp);
1130 err = hmdfs_readfile_response(con, cmd, filp);
1131 if (!err)
1141 if (err)
1142 hmdfs_send_err_response(con, cmd, err);
1148 int err = 0;
1160 err = -ENOMEM;
1167 err = -EINVAL;
1171 err = -EINVAL;
1179 err = PTR_ERR(dent);
1180 hmdfs_err("hmdfs_root_mkdir failed err = %d", err);
1191 hmdfs_sendmessage_response(con, cmd, respsize, mkdir_resp, err);
1198 int err = 0;
1210 err = -ENOMEM;
1217 err = -EINVAL;
1221 err = -EINVAL;
1230 err = PTR_ERR(dent);
1231 hmdfs_err("hmdfs_root_create failed err = %d", err);
1248 hmdfs_sendmessage_response(con, cmd, respsize, create_resp, err);
1255 int err = 0;
1264 err = -EINVAL;
1268 err = -EINVAL;
1272 err = kern_path(con->sbi->local_dst, 0, &root_path);
1273 if (!err) {
1274 err = hmdfs_root_rmdir(con->device_id, &root_path, path, name);
1279 hmdfs_send_err_response(con, cmd, err);
1285 int err = 0;
1294 err = -EINVAL;
1298 err = -EINVAL;
1302 err = kern_path(con->sbi->local_dst, 0, &root_path);
1303 if (!err) {
1304 err = hmdfs_root_unlink(con->device_id, &root_path, path, name);
1309 hmdfs_send_err_response(con, cmd, err);
1315 int err = 0;
1339 err = -EINVAL;
1343 err = -EINVAL;
1347 err = -EINVAL;
1351 err = -EINVAL;
1355 err = hmdfs_root_rename(con->sbi, con->device_id, path_old, name_old,
1359 hmdfs_send_err_response(con, cmd, err);
1383 hmdfs_err("kern_path failed err = %d", ret);
1491 int err = 0;
1505 hmdfs_err("file create failed err=%ld", PTR_ERR(dentry_file));
1511 err = PTR_ERR(file);
1521 err = iterate_dir(file, &(gc.ctx));
1522 if (err) {
1532 err = write_header(dentry_file, &header);
1537 if (err) {
1539 dentry_file = ERR_PTR(err);
1542 trace_hmdfs_server_rebuild_dents(&header, err);
1557 int err = 0;
1567 err = PTR_ERR(file);
1575 err = -EIO;
1579 hmdfs_send_err_response(con, cmd, err);
1582 if (!err && hswb->dirty_writeback_control)
1590 int err;
1592 err = hmdfs_lookup_symlink(&link_path, "%s/%s", sbi->local_dst,
1594 if (err)
1595 return err;
1648 int err = 0;
1657 err = -EINVAL;
1661 err = kern_path(con->sbi->local_dst, 0, &root_path);
1662 if (err) {
1663 hmdfs_err("kern_path failed err = %d", err);
1667 err = vfs_path_lookup(root_path.dentry, root_path.mnt, recv->buf, 0,
1669 if (err)
1674 err = -ENOENT;
1679 err = hmdfs_lookup_linkpath(con->sbi, recv->buf, &dst_path);
1680 if(err == -ENOENT)
1681 err = 0;
1682 else if (err)
1697 err = hmdfs_notify_change(dst_path.mnt, dentry, &attr, NULL);
1705 hmdfs_send_err_response(con, cmd, err);
1739 int err = 0;
1750 err = -EINVAL;
1751 goto err;
1754 err = hmdfs_convert_lookup_flags(recv_flags, &lookup_flags);
1755 if (err)
1756 goto err;
1760 err = -ENOMEM;
1761 goto err;
1763 err = kern_path(con->sbi->local_dst, 0, &root_path);
1764 if (err) {
1765 hmdfs_err("kern_path failed err = %d", err);
1769 err = vfs_path_lookup(root_path.dentry, root_path.mnt, recv->buf,
1771 if (err)
1776 err = -ENOENT;
1781 err = hmdfs_lookup_linkpath(con->sbi, recv->buf, &dst_path);
1782 if(err && err != -ENOENT)
1786 err = vfs_getattr(&dst_path, &ks, STATX_BASIC_STATS | STATX_BTIME, 0);
1787 if (err)
1798 if (err)
1801 hmdfs_sendmessage_response(con, cmd, size_read, resp, err);
1810 err:
1811 hmdfs_send_err_response(con, cmd, err);
1843 int err = 0;
1846 err = -EINVAL;
1852 err = -ENOMEM;
1858 err = -ENOMEM;
1862 err = kern_path(con->sbi->local_src, 0, &root_path);
1863 if (err) {
1864 hmdfs_info("kern_path failed err = %d", err);
1868 err = vfs_path_lookup(root_path.dentry, root_path.mnt, recv->path, 0,
1870 if (err) {
1871 hmdfs_info("recv->path found failed err = %d", err);
1875 err = vfs_statfs(&path, st);
1876 if (err)
1877 hmdfs_info("statfs local dentry failed, err = %d", err);
1886 if (err)
1887 hmdfs_send_err_response(con, cmd, err);
1920 int err = -ENOMEM;
1923 err = -EINVAL;
1924 goto err;
1927 err = -EINVAL;
1928 goto err;
1933 err = -ENOMEM;
1934 goto err;
1937 err = kern_path(con->sbi->local_dst, LOOKUP_DIRECTORY, &root_path);
1938 if (err) {
1939 hmdfs_info("kern_path failed err = %d", err);
1943 err = vfs_path_lookup(root_path.dentry, root_path.mnt,
1945 if (err) {
1946 hmdfs_info("path found failed err = %d", err);
1951 err = vfs_getxattr(&nop_mnt_idmap, path.dentry, name, NULL, size);
1953 err = vfs_getxattr(&nop_mnt_idmap, path.dentry, name, resp->value, size);
1954 if (err < 0) {
1955 hmdfs_info("getxattr failed err %d", err);
1959 resp->size = cpu_to_le32(err);
1972 err:
1973 hmdfs_send_err_response(con, cmd, err);
1988 int err;
1991 err = -EINVAL;
1992 goto err;
1995 err = -EINVAL;
1996 goto err;
1999 err = kern_path(con->sbi->local_dst, LOOKUP_DIRECTORY, &root_path);
2000 if (err) {
2001 hmdfs_info("kern_path failed err = %d", err);
2002 goto err;
2004 err = vfs_path_lookup(root_path.dentry, root_path.mnt,
2006 if (err) {
2007 hmdfs_info("path found failed err = %d", err);
2013 err = vfs_removexattr(&nop_mnt_idmap, path.dentry, name);
2015 err = vfs_setxattr(&nop_mnt_idmap, path.dentry, name, value, size, flags);
2021 err:
2022 hmdfs_send_err_response(con, cmd, err);
2035 int err = 0;
2038 err = -EINVAL;
2039 goto err;
2044 err = -ENOMEM;
2045 goto err;
2048 err = kern_path(con->sbi->local_dst, LOOKUP_DIRECTORY, &root_path);
2049 if (err) {
2050 hmdfs_info("kern_path failed err = %d", err);
2053 err = vfs_path_lookup(root_path.dentry, root_path.mnt,
2055 if (err) {
2056 hmdfs_info("path found failed err = %d", err);
2061 err = vfs_listxattr(path.dentry, NULL, size);
2063 err = vfs_listxattr(path.dentry, resp->list, size);
2064 if (err < 0) {
2065 hmdfs_info("listxattr failed err = %d", err);
2069 resp->size = cpu_to_le32(err);
2082 err:
2083 hmdfs_send_err_response(con, cmd, err);
2091 int err;
2095 err = -EINVAL;
2099 err = kern_path(con->sbi->real_dst, 0, &root_path);
2100 if (err) {
2101 hmdfs_err("kern_path failed err = %d", err);
2110 err = vfs_path_lookup(root_path.dentry, root_path.mnt, tmp_path, 0,
2112 if (err) {
2113 hmdfs_info("path found failed err = %d", err);