1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

BREAKING(fs): remove Deno.funlock[Sync]() (#25442)

Towards #22079

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Asher Gomez 2024-09-05 21:23:37 +10:00 committed by GitHub
parent c73b4a0877
commit 7d95c5c062
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 0 additions and 69 deletions

View file

@ -323,7 +323,6 @@ pub const OP_DETAILS: phf::Map<&'static str, [&'static str; 2]> = phf_map! {
"op_fs_flock_async" => ["lock a file", "awaiting the result of a `Deno.FsFile.lock` call"], "op_fs_flock_async" => ["lock a file", "awaiting the result of a `Deno.FsFile.lock` call"],
"op_fs_fsync_async" => ["flush pending data operations for a file to disk", "awaiting the result of a `Deno.fsync` or `Deno.FsFile.sync` call"], "op_fs_fsync_async" => ["flush pending data operations for a file to disk", "awaiting the result of a `Deno.fsync` or `Deno.FsFile.sync` call"],
"op_fs_file_truncate_async" => ["truncate a file", "awaiting the result of a `Deno.FsFile.prototype.truncate` call"], "op_fs_file_truncate_async" => ["truncate a file", "awaiting the result of a `Deno.FsFile.prototype.truncate` call"],
"op_fs_funlock_async_unstable" => ["unlock a file", "awaiting the result of a `Deno.funlock` call"],
"op_fs_funlock_async" => ["unlock a file", "awaiting the result of a `Deno.FsFile.unlock` call"], "op_fs_funlock_async" => ["unlock a file", "awaiting the result of a `Deno.FsFile.unlock` call"],
"op_fs_link_async" => ["create a hard link", "awaiting the result of a `Deno.link` call"], "op_fs_link_async" => ["create a hard link", "awaiting the result of a `Deno.link` call"],
"op_fs_lstat_async" => ["get file metadata", "awaiting the result of a `Deno.lstat` call"], "op_fs_lstat_async" => ["get file metadata", "awaiting the result of a `Deno.lstat` call"],

View file

@ -46,8 +46,6 @@ delete Object.prototype.__proto__;
"UnixListenOptions", "UnixListenOptions",
"createHttpClient", "createHttpClient",
"dlopen", "dlopen",
"funlock",
"funlockSync",
"listen", "listen",
"listenDatagram", "listenDatagram",
"openKv", "openKv",

View file

@ -1130,24 +1130,6 @@ declare namespace Deno {
options: UnixListenOptions & { transport: "unixpacket" }, options: UnixListenOptions & { transport: "unixpacket" },
): DatagramConn; ): DatagramConn;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Release an advisory file-system lock for the provided file.
*
* @category File System
* @experimental
*/
export function funlock(rid: number): Promise<void>;
/** **UNSTABLE**: New API, yet to be vetted.
*
* Release an advisory file-system lock for the provided file synchronously.
*
* @category File System
* @experimental
*/
export function funlockSync(rid: number): void;
/** **UNSTABLE**: New API, yet to be vetted. /** **UNSTABLE**: New API, yet to be vetted.
* *
* Open a new {@linkcode Deno.Kv} connection to persist data. * Open a new {@linkcode Deno.Kv} connection to persist data.

View file

@ -26,9 +26,7 @@ import {
op_fs_fsync_sync, op_fs_fsync_sync,
op_fs_ftruncate_sync, op_fs_ftruncate_sync,
op_fs_funlock_async, op_fs_funlock_async,
op_fs_funlock_async_unstable,
op_fs_funlock_sync, op_fs_funlock_sync,
op_fs_funlock_sync_unstable,
op_fs_futime_async, op_fs_futime_async,
op_fs_futime_sync, op_fs_futime_sync,
op_fs_link_async, op_fs_link_async,
@ -535,14 +533,6 @@ async function fsync(rid) {
await op_fs_fsync_async(rid); await op_fs_fsync_async(rid);
} }
function funlockSync(rid) {
op_fs_funlock_sync_unstable(rid);
}
async function funlock(rid) {
await op_fs_funlock_async_unstable(rid);
}
function openSync( function openSync(
path, path,
options, options,
@ -935,8 +925,6 @@ export {
FsFile, FsFile,
fsync, fsync,
fsyncSync, fsyncSync,
funlock,
funlockSync,
link, link,
linkSync, linkSync,
lstat, lstat,

View file

@ -235,8 +235,6 @@ deno_core::extension!(deno_fs,
op_fs_fsync_async, op_fs_fsync_async,
op_fs_file_stat_sync, op_fs_file_stat_sync,
op_fs_file_stat_async, op_fs_file_stat_async,
op_fs_funlock_sync_unstable,
op_fs_funlock_async_unstable,
op_fs_flock_async, op_fs_flock_async,
op_fs_flock_sync, op_fs_flock_sync,
op_fs_funlock_async, op_fs_funlock_async,

View file

@ -1493,28 +1493,6 @@ pub async fn op_fs_file_stat_async(
Ok(stat.into()) Ok(stat.into())
} }
#[op2(fast)]
pub fn op_fs_funlock_sync_unstable(
state: &mut OpState,
#[smi] rid: ResourceId,
) -> Result<(), AnyError> {
check_unstable(state, "Deno.funlockSync");
let file = FileResource::get_file(state, rid)?;
file.unlock_sync()?;
Ok(())
}
#[op2(async)]
pub async fn op_fs_funlock_async_unstable(
state: Rc<RefCell<OpState>>,
#[smi] rid: ResourceId,
) -> Result<(), AnyError> {
check_unstable(&state.borrow(), "Deno.funlock");
let file = FileResource::get_file(&state.borrow(), rid)?;
file.unlock_async().await?;
Ok(())
}
#[op2(fast)] #[op2(fast)]
pub fn op_fs_flock_sync( pub fn op_fs_flock_sync(
state: &mut OpState, state: &mut OpState,

View file

@ -169,8 +169,6 @@ denoNsUnstableById[unstableIds.ffi] = {
}; };
denoNsUnstableById[unstableIds.fs] = { denoNsUnstableById[unstableIds.fs] = {
funlock: fs.funlock,
funlockSync: fs.funlockSync,
umask: fs.umask, umask: fs.umask,
}; };
@ -217,8 +215,6 @@ const denoNsUnstable = {
UnsafePointerView: ffi.UnsafePointerView, UnsafePointerView: ffi.UnsafePointerView,
UnsafeFnPointer: ffi.UnsafeFnPointer, UnsafeFnPointer: ffi.UnsafeFnPointer,
UnsafeWindowSurface: webgpuSurface.UnsafeWindowSurface, UnsafeWindowSurface: webgpuSurface.UnsafeWindowSurface,
funlock: fs.funlock,
funlockSync: fs.funlockSync,
openKv: kv.openKv, openKv: kv.openKv,
AtomicOperation: kv.AtomicOperation, AtomicOperation: kv.AtomicOperation,
Kv: kv.Kv, Kv: kv.Kv,

View file

@ -802,8 +802,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) {
delete globalThis.window; delete globalThis.window;
delete Deno.Buffer; delete Deno.Buffer;
delete Deno.FsFile.prototype.rid; delete Deno.FsFile.prototype.rid;
delete Deno.funlock;
delete Deno.funlockSync;
} }
} else { } else {
// Warmup // Warmup
@ -963,8 +961,6 @@ function bootstrapWorkerRuntime(
if (internals.future) { if (internals.future) {
delete Deno.Buffer; delete Deno.Buffer;
delete Deno.FsFile.prototype.rid; delete Deno.FsFile.prototype.rid;
delete Deno.funlock;
delete Deno.funlockSync;
} }
} else { } else {
// Warmup // Warmup

View file

@ -4,8 +4,6 @@ console.log(
"Deno.FsFile.prototype.rid is", "Deno.FsFile.prototype.rid is",
Deno.openSync(import.meta.filename).rid, Deno.openSync(import.meta.filename).rid,
); );
console.log("Deno.funlock is", Deno.funlock);
console.log("Deno.funlockSync is", Deno.funlockSync);
// TCP // TCP
// Since these tests may run in parallel, ensure this port is unique to this file // Since these tests may run in parallel, ensure this port is unique to this file

View file

@ -1,8 +1,6 @@
window is undefined window is undefined
Deno.Buffer is undefined Deno.Buffer is undefined
Deno.FsFile.prototype.rid is undefined Deno.FsFile.prototype.rid is undefined
Deno.funlock is undefined
Deno.funlockSync is undefined
Deno.Listener.prototype.rid is undefined Deno.Listener.prototype.rid is undefined
Deno.Conn.prototype.rid is undefined Deno.Conn.prototype.rid is undefined
Deno.UnixConn.prototype.rid is undefined Deno.UnixConn.prototype.rid is undefined