static int local_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)

{

    char buffer[PATH_MAX];

    char *path = fs_path->data;



    if (fs_ctx->fs_sm == SM_MAPPED) {

        return local_set_xattr(rpath(fs_ctx, path, buffer), credp);

    } else if ((fs_ctx->fs_sm == SM_PASSTHROUGH) ||

               (fs_ctx->fs_sm == SM_NONE)) {

        return chmod(rpath(fs_ctx, path, buffer), credp->fc_mode);

    }

    return -1;

}

static int local_chmod(FsContext *fs_ctx, V9fsPath *fs_path, FsCred *credp)

{

    char buffer[PATH_MAX];

    char *path = fs_path->data;



    if (fs_ctx->fs_sm == SM_MAPPED) {

        return local_set_xattr(rpath(fs_ctx, path, buffer), credp);

    } else if ((fs_ctx->fs_sm == SM_PASSTHROUGH) ||

               (fs_ctx->fs_sm == SM_NONE)) {

        return chmod(rpath(fs_ctx, path, buffer), credp->fc_mode);

    }

    return -1;

}

static int FUNC_0(FsContext *VAR_0, V9fsPath *VAR_1, FsCred *VAR_2)

{

    char VAR_3[PATH_MAX];

    char *VAR_4 = VAR_1->data;



    if (VAR_0->fs_sm == SM_MAPPED) {

        return local_set_xattr(rpath(VAR_0, VAR_4, VAR_3), VAR_2);

    } else if ((VAR_0->fs_sm == SM_PASSTHROUGH) ||

               (VAR_0->fs_sm == SM_NONE)) {

        return chmod(rpath(VAR_0, VAR_4, VAR_3), VAR_2->fc_mode);

    }

    return -1;

}

static int FUNC_0(FsContext *VAR_0, V9fsPath *VAR_1, FsCred *VAR_2)
{ char VAR_3[PATH_MAX]; char *VAR_4 = VAR_1->data; if (VAR_0->fs_sm == SM_MAPPED) { return local_set_xattr(rpath(VAR_0, VAR_4, VAR_3), VAR_2); } else if ((VAR_0->fs_sm == SM_PASSTHROUGH) || (VAR_0->fs_sm == SM_NONE)) { return chmod(rpath(VAR_0, VAR_4, VAR_3), VAR_2->fc_mode); } return -1; }