Message ID | 20230809105006.1198165-1-j.granados@samsung.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
On Wed, Aug 09, 2023 at 12:49:52PM +0200, Joel Granados wrote: > What? > These commits set things up so we can start removing the sentinel elements. > They modify sysctl and net_sysctl internals so that registering a ctl_table > that contains a sentinel gives the same result as passing a table_size > calculated from the ctl_table array without a sentinel. We accomplish this by > introducing a table_size argument in the same place where procname is checked > for NULL. The idea is for it to keep stopping when it hits ->procname == NULL, > while the sentinel is still present. And when the sentinel is removed, it will > stop on the table_size (thx to jani.nikula@linux.intel.com for the discussion > that led to this). This allows us to remove sentinels from one (or several) > files at a time. > > These commits are part of a bigger set containing the removal of ctl_table sentinel > (https://github.com/Joelgranados/linux/tree/tag/sysctl_remove_empty_elem_V3). > The idea is to make the review process easier by chunking the 65+ commits into > manageable pieces. Thanks, I've dropped the old set and merged this updated one onto sysctl-next. Luis
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 5f413bfd6271..9aa8374c0ef1 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -975,6 +975,7 @@ static struct ctl_dir *new_dir(struct ctl_table_set *set, table[0].procname = new_name; table[0].mode = S_IFDIR|S_IRUGO|S_IXUGO; init_header(&new->header, set->dir.header.root, set, node, table, 1); + printk("%ld sysctl saved mem kzalloc \n", sizeof(struct ctl_table)); return new; } @@ -1202,6 +1203,7 @@ static struct ctl_table_header *new_links(struct ctl_dir *dir, struct ctl_table_ head->ctl_table_size); links->nreg = head->ctl_table_size; + printk("%ld sysctl saved mem kzalloc \n", sizeof(struct ctl_table)); return links; }