Page MenuHomeFreeBSD

Split procfs_attr into multiple functions
ClosedPublic

Authored by eadler on Apr 21 2018, 7:49 AM.
Tags
None
Referenced Files
F108441278: D15150.id41803.diff
Fri, Jan 24, 7:20 PM
F108438377: D15150.id41713.diff
Fri, Jan 24, 6:55 PM
Unknown Object (File)
Fri, Jan 3, 5:22 AM
Unknown Object (File)
Nov 30 2024, 5:10 PM
Unknown Object (File)
Nov 30 2024, 12:04 AM
Unknown Object (File)
Nov 26 2024, 9:00 PM
Unknown Object (File)
Oct 17 2024, 6:28 PM
Unknown Object (File)
Oct 1 2024, 10:50 PM

Details

Test Plan

install and reboot; test various parts of /proc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16244
Build 16194: arc lint + arc unit

Event Timeline

sys/fs/procfs/procfs.c
102

'__*' namespace not be used for regular code.

Look at the style(9) how correct function body looks like.

114

same style isue.

115

return ();
blank line before first statement.

168

Style, binary ops require space from both side of the sign. Since you changing the line, it must be fixed.

eadler marked 4 inline comments as done.

Address @kib's comments

sys/fs/procfs/procfs.c
101

'{' must be on the new line.

115

What 'global' means there ?

sys/fs/procfs/procfs.c
115

0555 instead of 0500 like the others. Any suggestions on a better name? Maybe everyone_readexec or ugo for user-group-other ?

domagoj.stolfa_gmail.com added inline comments.
sys/fs/procfs/procfs.c
123

Somewhat unrelated to this patch, but is there a good reason why this isn't something like:

return (procfs_attr(td, p, pn, vap, (RW << OWNER));

instead of magic numbers like 0600, 0555, ...?

Also look at MAINTAINERS file.

sys/fs/procfs/procfs.c
115

I.e. your 'global' is usually spelled as 'all'. I would also use 'rw', 're' etc instead of spelling out the whole words.

This revision is now accepted and ready to land.Apr 22 2018, 6:31 PM
des added inline comments.
sys/fs/procfs/procfs.c
115

Is re here supposed to mean read + execute? If so, it should be spelled rx, cf. chgrp(1), chgrp(2) etc.

123

Anyone with enough Unix experience to be reading this code will immediately know what the numbers mean. The macros take longer to read and understand and become unwieldy in more complex cases (e.g. 0755).

des requested changes to this revision.Apr 23 2018, 6:33 AM

Sorry, mislabeled. See comment about function name.

This revision now requires changes to proceed.Apr 23 2018, 6:33 AM
This revision is now accepted and ready to land.Apr 24 2018, 2:08 PM
This revision was automatically updated to reflect the committed changes.