Re: [PATCH] ->i_dev switched to dev_t

From: Matthew Wilcox (willy@debian.org)
Date: Fri Jul 05 2002 - 11:46:43 EST


[apologies for the mangling; this is what happens when you have to
copy and paste from a web archive]

you wrote:
> * ->i_dev followed the example of ->s_dev - it's dev_t now. All
> remaining uses of ->i_dev either outright want dev_t (stat()) or couldn't
> care less (printing major:minor in /proc/<pid>/maps, etc.)

[...]

> diff -urN C24-0/fs/locks.c C24-current/fs/locks.c
> --- C24-0/fs/locks.c Thu Jun 20 13:37:25 2002
> +++ C24-current/fs/locks.c Wed Jul 3 04:26:31 2002
> @@ -1751,9 +1751,12 @@
> ? (fl->fl_type & F_UNLCK) ? "UNLCK" : "READ "
> : (fl->fl_type & F_WRLCK) ? "WRITE" : "READ ");
> }
> + /*
> + * NOTE: it should be inode->i_sb->s_id, not kdevname(...).
> + */
> out += sprintf(out, "%d %s:%ld ",
> fl->fl_pid,
> - inode ? kdevname(inode->i_dev) : "<none>",
> + inode ? kdevname(to_kdev_t(inode->i_dev)) : "<none>",
> inode ? inode->i_ino : 0);
> out += sprintf(out, "%Ld ", fl->fl_start);
> if (fl->fl_end == OFFSET_MAX)

why not:

> - out += sprintf(out, "%d %s:%ld ",
> + out += sprintf(out, "%d %02x:%02x:%ld ",
> fl->fl_pid,
> - inode ? kdevname(inode->i_dev) : "<none>",
> + inode ? MAJOR(inode->i_dev), MINOR(inode->i_dev) : "<none>",

you've done things like this elsewhere where you didn't want to change
the format of a file in /proc yet.

-- 
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 07 2002 - 22:00:15 EST