Skip to content

Commit

Permalink
Migrate goo.gl links to TinyURL.
Browse files Browse the repository at this point in the history
Because Google can't ever commit to anything, they are
[shutting down](https://developers.googleblog.com/en/google-url-shortener-links-will-no-longer-be-available/)
`goo.gl` short link redirects after
[previously announcing](https://developers.googleblog.com/en/transitioning-google-url-shortener-to-firebase-dynamic-links/)
that they'll continue to work.

They also previously announced that you could export your links from "the
`goo.gl` console", but I can't find that anywhere (the site is now just a
redirect to their stupid blog post), so I had to do this by hand. There may be
some errors.
  • Loading branch information
jacobsa committed Jul 21, 2024
1 parent 8a36813 commit 5559e12
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 201 deletions.
24 changes: 13 additions & 11 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ var contextKey interface{} = contextKeyType(0)
//
// As of 2015-03-26, the behavior in the kernel is:
//
// - (http://goo.gl/bQ1f1i, http://goo.gl/HwBrR6) Set the local variable
// ra_pages to be init_response->max_readahead divided by the page size.
// - (https://tinyurl.com/2eakn5e9, https://tinyurl.com/mry9e33d) Set the
// local variable ra_pages to be init_response->max_readahead divided by
// the page size.
//
// - (http://goo.gl/gcIsSh, http://goo.gl/LKV2vA) Set
// backing_dev_info::ra_pages to the min of that value and what was sent
// in the request's max_readahead field.
// - (https://tinyurl.com/2eakn5e9, https://tinyurl.com/mbpshk8h) Set
// backing_dev_info::ra_pages to the min of that value and what was sent in
// the request's max_readahead field.
//
// - (http://goo.gl/u2SqzH) Use backing_dev_info::ra_pages when deciding
// how much to read ahead.
// - (https://tinyurl.com/57hpfu4x) Use backing_dev_info::ra_pages when
// deciding how much to read ahead.
//
// - (http://goo.gl/JnhbdL) Don't read ahead at all if that field is zero.
// - (https://tinyurl.com/ywhfcfte) Don't read ahead at all if that field is
// zero.
//
// Reading a page at a time is a drag. Ask for a larger size.
const maxReadahead = 1 << 20
Expand Down Expand Up @@ -313,13 +315,13 @@ func (c *Connection) handleInterrupt(fuseID uint64) {
defer c.mu.Unlock()

// NOTE(jacobsa): fuse.txt in the Linux kernel documentation
// (https://goo.gl/H55Dnr) defines the kernel <-> userspace protocol for
// interrupts.
// (https://tinyurl.com/2r4ajuwd) defines the kernel <-> userspace protocol
// for interrupts.
//
// In particular, my reading of it is that an interrupt request cannot be
// delivered to userspace before the original request. The part about the
// race and EAGAIN appears to be aimed at userspace programs that
// concurrently process requests (cf. http://goo.gl/BES2rs).
// concurrently process requests (https://tinyurl.com/3euehwfb).
//
// So in this method if we can't find the ID to be interrupted, it means that
// the request has already been replied to.
Expand Down
21 changes: 11 additions & 10 deletions conversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ func convertInMessage(
Name: string(name),

// On Linux, vfs_mkdir calls through to the inode with at most
// permissions and sticky bits set (cf. https://goo.gl/WxgQXk), and fuse
// passes that on directly (cf. https://goo.gl/f31aMo). In other words,
// the fact that this is a directory is implicit in the fact that the
// opcode is mkdir. But we want the correct mode to go through, so ensure
// that os.ModeDir is set.
// permissions and sticky bits set (https://tinyurl.com/3djx8498), and
// fuse passes that on directly (https://tinyurl.com/exezw647). In other
// words, the fact that this is a directory is implicit in the fact that
// the opcode is mkdir. But we want the correct mode to go through, so
// ensure that os.ModeDir is set.
Mode: ConvertFileMode(in.Mode) | os.ModeDir,
OpContext: fuseops.OpContext{
FuseID: inMsg.Header().Unique,
Expand Down Expand Up @@ -915,7 +915,7 @@ func (c *Connection) kernelResponseForOp(
out.St.Ffree = o.InodesFree
out.St.Namelen = 255

// The posix spec for sys/statvfs.h (http://goo.gl/LktgrF) defines the
// The posix spec for sys/statvfs.h (https://tinyurl.com/2juj6ah6) defines the
// following fields of statvfs, among others:
//
// f_bsize File system block size.
Expand All @@ -925,7 +925,7 @@ func (c *Connection) kernelResponseForOp(
// It appears as though f_bsize was the only thing supported by most unixes
// originally, but then f_frsize was added when new sorts of file systems
// came about. Quoth The Linux Programming Interface by Michael Kerrisk
// (https://goo.gl/5LZMxQ):
// (https://tinyurl.com/5n8mjtws):
//
// For most Linux file systems, the values of f_bsize and f_frsize are
// the same. However, some file systems support the notion of block
Expand Down Expand Up @@ -1029,9 +1029,10 @@ func convertAttributes(
// consumption by the fuse kernel module.
func convertExpirationTime(t time.Time) (secs uint64, nsecs uint32) {
// Fuse represents durations as unsigned 64-bit counts of seconds and 32-bit
// counts of nanoseconds (cf. http://goo.gl/EJupJV). So negative durations
// are right out. There is no need to cap the positive magnitude, because
// 2^64 seconds is well longer than the 2^63 ns range of time.Duration.
// counts of nanoseconds (https://tinyurl.com/4muvkr6k). So negative
// durations are right out. There is no need to cap the positive magnitude,
// because 2^64 seconds is well longer than the 2^63 ns range of
// time.Duration.
d := t.Sub(time.Now())
if d > 0 {
secs = uint64(d / time.Second)
Expand Down
Loading

0 comments on commit 5559e12

Please sign in to comment.