From 2e1a97df179fbf3955278428940205db1bca0b7d Mon Sep 17 00:00:00 2001 From: pv9jfohxb <1907694477@qq.com> Date: Thu, 8 Jul 2021 22:26:00 +0800 Subject: [PATCH] Update namei.c --- linux-0.11-lab/0/linux/fs/namei.c | 54 ------------------------------- 1 file changed, 54 deletions(-) diff --git a/linux-0.11-lab/0/linux/fs/namei.c b/linux-0.11-lab/0/linux/fs/namei.c index b390ded..2b4d554 100644 --- a/linux-0.11-lab/0/linux/fs/namei.c +++ b/linux-0.11-lab/0/linux/fs/namei.c @@ -782,60 +782,6 @@ int sys_link(const char * oldname, const char * newname) return 0; } -// char* sys_getcwd(char * buf, size_t size){ -// char *dir [20]; -// char * rd; -// struct buffer_head *bh; -// struct dir_entry *dr; -// struct m_inode *node; -// int i=0; -// int j,k1,k2; -// int the_last_node; -// char word; -// bh=bread(current->root->i_dev,current->pwd->i_zone[0]); -// dr=(struct dir_entry *)(bh->b_data); -// node=current->pwd; -// while(i>=0){ -// the_last_node=dr->inode; -// node=iget(current->root->i_dev,(dr+1)->inode); -// bh=bread(current->root->i_dev,node->i_zone[0]); -// dr=(struct dir_entry *)(bh->b_data); -// j=2; -// while(dr->name[0]!='\0'){ -// if((dr+j)->inode==the_last_node) break; -// j++; -// } -// if((dr+j)->name[0]=='\0') break; -// dir[i]=(dr+j)->name; -// i++; -// } -// dir[i]=NULL; -// i--; -// j=0; -// rd[0]='/'; -// k1=1; -// while (i>=0) -// { -// k2=0; -// while(dir[i][k2]!='\0'){ -// rd[k1]=dir[i][k2]; -// k1++; -// k2++; -// } -// if(i==0) break; -// rd[k1]='/'; -// k1++; -// i--; -// } -// i=0; -// while(i<=k1) -// { -// word=rd[i]; -// put_fs_byte(word,(char*)(buf+i)); -// i++; -// } -// return rd; -// } char *sys_getcwd(char *buf, size_t size) { char *dir[20];