Page MenuHomeFreeBSD

Split procfs_attr into multiple functions
ClosedPublic

Authored by eadler on Apr 21 2018, 7:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 30, 5:10 PM
Unknown Object (File)
Sat, Nov 30, 12:04 AM
Unknown Object (File)
Tue, Nov 26, 9:00 PM
Unknown Object (File)
Oct 17 2024, 6:28 PM
Unknown Object (File)
Oct 1 2024, 10:50 PM
Unknown Object (File)
Oct 1 2024, 10:50 PM
Unknown Object (File)
Oct 1 2024, 10:50 PM
Unknown Object (File)
Sep 14 2024, 2:39 PM

Details

Test Plan

install and reboot; test various parts of /proc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/procfs/procfs.c
102 ↗(On Diff #41707)

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

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

114 ↗(On Diff #41707)

same style isue.

115 ↗(On Diff #41707)

return ();
blank line before first statement.

168 ↗(On Diff #41707)

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
102 ↗(On Diff #41713)

'{' must be on the new line.

116 ↗(On Diff #41713)

What 'global' means there ?

sys/fs/procfs/procfs.c
116 ↗(On Diff #41713)

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
124 ↗(On Diff #41713)

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
116 ↗(On Diff #41713)

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
116 ↗(On Diff #41730)

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

124 ↗(On Diff #41713)

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.