<commit_before>#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "buf.h"
#include "fs.h"
#include "file.h"

#define PROCFS_DEV 9
#define PROCDIR_OFF 1000
#define IMEMINFO 1
#define ICPUINFO 2

extern
struct {
  struct spinlock lock;
  struct proc proc[NPROC];
} ptable;


extern
struct cpu cpus[NCPU];

extern 
struct inode* iget(uint dev, uint inum, struct inode* parent);

struct inode_functions procfs_i_func = { procfs_ipopulate, procfs_iupdate, procfs_readi, procfs_writei };

void init_procfs(){
  struct inode *ip = namei("/proc");
  ip->i_func = &procfs_i_func; 
}  
<commit_msg>fixed initcode bad null pointer, in init_procfs<commit_after>#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "buf.h"
#include "fs.h"
#include "file.h"

#define PROCFS_DEV 9
#define PROCDIR_OFF 1000
#define IMEMINFO 1
#define ICPUINFO 2

extern
struct {
  struct spinlock lock;
  struct proc proc[NPROC];
} ptable;


extern
struct cpu cpus[NCPU];

extern 
struct inode* iget(uint dev, uint inum, struct inode* parent);

struct inode_functions procfs_i_func = { procfs_ipopulate, procfs_iupdate, procfs_readi, procfs_writei };

void init_procfs(){
  struct inode *ip = namei("/proc");
  if(ip != 0)
	  ip->i_func = &procfs_i_func; 
}  

{'fraction_non_alphanumeric': 0.12900926585887385, 'fraction_numerical': 0.010691375623663579, 'mean_word_length': 5.077922077922078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4948423', 'n_tokens_mistral': 574, 'n_tokens_neox': 545, 'n_words': 148}