mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.6.2: "filp->f_mode & 2..."
@ 2004-02-12 10:04 Ulrich Windl
  2004-02-12 11:13 ` viro
  2004-02-13  3:32 ` Jamie Lokier
  0 siblings, 2 replies; 3+ messages in thread
From: Ulrich Windl @ 2004-02-12 10:04 UTC (permalink / raw)
  To: linux-kernel

Hi everybody!

I think there's one thing to change in kernel sources; consider this:
filp->f_mode & 2 || permission(filp->f_dentry->d_inode,2,NULL)

It's obvious to some, likely for others that "2" there really stands for
"002", the good old UNIX write permission. I'd suggest either to write
those permission bits in three-digit-octal, or introduce (maybe just use)
symbolic constants for improved readability.

One could even consider a macro MAY_WRITE(filp):
#define MAY_WRITE(filp) ((filp)->f_mode & WRITE_PERMISSION)
#define WRITE_PERMISSION 002

Regards,
Ulrich


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-13  3:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-12 10:04 2.6.2: "filp->f_mode & 2..." Ulrich Windl
2004-02-12 11:13 ` viro
2004-02-13  3:32 ` Jamie Lokier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®