aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-03-07 16:47:30 -0500
committerSteve French <sfrench@us.ibm.com>2006-03-07 16:47:30 -0500
commitf6e77c94796edad172602234826a022d463d910e (patch)
treef5cb0848c9e848499b0f0676fafe7ff207538ae8 /fs
parentbeb84dc8186662b17d5ea510fabb85cb7e266d33 (diff)
parentd0b004840bd3b5ff2f2a0ad14fa0bd43349f5175 (diff)
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cramfs/inode.c60
-rw-r--r--fs/fifo.c7
-rw-r--r--fs/proc/task_mmu.c11
-rw-r--r--fs/ramfs/inode.c1
-rw-r--r--fs/reiserfs/namei.c8
5 files changed, 40 insertions, 47 deletions
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 7fe85415ae7c..8ad52f5bf255 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -36,7 +36,7 @@ static DECLARE_MUTEX(read_mutex);
36 36
37/* These two macros may change in future, to provide better st_ino 37/* These two macros may change in future, to provide better st_ino
38 semantics. */ 38 semantics. */
39#define CRAMINO(x) ((x)->offset?(x)->offset<<2:1) 39#define CRAMINO(x) (((x)->offset && (x)->size)?(x)->offset<<2:1)
40#define OFFSET(x) ((x)->i_ino) 40#define OFFSET(x) ((x)->i_ino)
41 41
42 42
@@ -66,8 +66,36 @@ static int cramfs_iget5_test(struct inode *inode, void *opaque)
66 66
67static int cramfs_iget5_set(struct inode *inode, void *opaque) 67static int cramfs_iget5_set(struct inode *inode, void *opaque)
68{ 68{
69 static struct timespec zerotime;
69 struct cramfs_inode *cramfs_inode = opaque; 70 struct cramfs_inode *cramfs_inode = opaque;
71 inode->i_mode = cramfs_inode->mode;
72 inode->i_uid = cramfs_inode->uid;
73 inode->i_size = cramfs_inode->size;
74 inode->i_blocks = (cramfs_inode->size - 1) / 512 + 1;
75 inode->i_blksize = PAGE_CACHE_SIZE;
76 inode->i_gid = cramfs_inode->gid;
77 /* Struct copy intentional */
78 inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime;
70 inode->i_ino = CRAMINO(cramfs_inode); 79 inode->i_ino = CRAMINO(cramfs_inode);
80 /* inode->i_nlink is left 1 - arguably wrong for directories,
81 but it's the best we can do without reading the directory
82 contents. 1 yields the right result in GNU find, even
83 without -noleaf option. */
84 if (S_ISREG(inode->i_mode)) {
85 inode->i_fop = &generic_ro_fops;
86 inode->i_data.a_ops = &cramfs_aops;
87 } else if (S_ISDIR(inode->i_mode)) {
88 inode->i_op = &cramfs_dir_inode_operations;
89 inode->i_fop = &cramfs_directory_operations;
90 } else if (S_ISLNK(inode->i_mode)) {
91 inode->i_op = &page_symlink_inode_operations;
92 inode->i_data.a_ops = &cramfs_aops;
93 } else {
94 inode->i_size = 0;
95 inode->i_blocks = 0;
96 init_special_inode(inode, inode->i_mode,
97 old_decode_dev(cramfs_inode->size));
98 }
71 return 0; 99 return 0;
72} 100}
73 101
@@ -77,37 +105,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb,
77 struct inode *inode = iget5_locked(sb, CRAMINO(cramfs_inode), 105 struct inode *inode = iget5_locked(sb, CRAMINO(cramfs_inode),
78 cramfs_iget5_test, cramfs_iget5_set, 106 cramfs_iget5_test, cramfs_iget5_set,
79 cramfs_inode); 107 cramfs_inode);
80 static struct timespec zerotime;
81
82 if (inode && (inode->i_state & I_NEW)) { 108 if (inode && (inode->i_state & I_NEW)) {
83 inode->i_mode = cramfs_inode->mode;
84 inode->i_uid = cramfs_inode->uid;
85 inode->i_size = cramfs_inode->size;
86 inode->i_blocks = (cramfs_inode->size - 1) / 512 + 1;
87 inode->i_blksize = PAGE_CACHE_SIZE;
88 inode->i_gid = cramfs_inode->gid;
89 /* Struct copy intentional */
90 inode->i_mtime = inode->i_atime = inode->i_ctime = zerotime;
91 inode->i_ino = CRAMINO(cramfs_inode);
92 /* inode->i_nlink is left 1 - arguably wrong for directories,
93 but it's the best we can do without reading the directory
94 contents. 1 yields the right result in GNU find, even
95 without -noleaf option. */
96 if (S_ISREG(inode->i_mode)) {
97 inode->i_fop = &generic_ro_fops;
98 inode->i_data.a_ops = &cramfs_aops;
99 } else if (S_ISDIR(inode->i_mode)) {
100 inode->i_op = &cramfs_dir_inode_operations;
101 inode->i_fop = &cramfs_directory_operations;
102 } else if (S_ISLNK(inode->i_mode)) {
103 inode->i_op = &page_symlink_inode_operations;
104 inode->i_data.a_ops = &cramfs_aops;
105 } else {
106 inode->i_size = 0;
107 inode->i_blocks = 0;
108 init_special_inode(inode, inode->i_mode,
109 old_decode_dev(cramfs_inode->size));
110 }
111 unlock_new_inode(inode); 109 unlock_new_inode(inode);
112 } 110 }
113 return inode; 111 return inode;
diff --git a/fs/fifo.c b/fs/fifo.c
index 923371b753ab..d13fcd3ec803 100644
--- a/fs/fifo.c
+++ b/fs/fifo.c
@@ -34,10 +34,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
34{ 34{
35 int ret; 35 int ret;
36 36
37 ret = -ERESTARTSYS; 37 mutex_lock(PIPE_MUTEX(*inode));
38 if (mutex_lock_interruptible(PIPE_MUTEX(*inode)))
39 goto err_nolock_nocleanup;
40
41 if (!inode->i_pipe) { 38 if (!inode->i_pipe) {
42 ret = -ENOMEM; 39 ret = -ENOMEM;
43 if(!pipe_new(inode)) 40 if(!pipe_new(inode))
@@ -140,8 +137,6 @@ err:
140 137
141err_nocleanup: 138err_nocleanup:
142 mutex_unlock(PIPE_MUTEX(*inode)); 139 mutex_unlock(PIPE_MUTEX(*inode));
143
144err_nolock_nocleanup:
145 return ret; 140 return ret;
146} 141}
147 142
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 0eaad41f4658..91b7c15ab373 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -204,7 +204,6 @@ static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
204{ 204{
205 pte_t *pte, ptent; 205 pte_t *pte, ptent;
206 spinlock_t *ptl; 206 spinlock_t *ptl;
207 unsigned long pfn;
208 struct page *page; 207 struct page *page;
209 208
210 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); 209 pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl);
@@ -214,12 +213,12 @@ static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
214 continue; 213 continue;
215 214
216 mss->resident += PAGE_SIZE; 215 mss->resident += PAGE_SIZE;
217 pfn = pte_pfn(ptent); 216
218 if (!pfn_valid(pfn)) 217 page = vm_normal_page(vma, addr, ptent);
218 if (!page)
219 continue; 219 continue;
220 220
221 page = pfn_to_page(pfn); 221 if (page_mapcount(page) >= 2) {
222 if (page_count(page) >= 2) {
223 if (pte_dirty(ptent)) 222 if (pte_dirty(ptent))
224 mss->shared_dirty += PAGE_SIZE; 223 mss->shared_dirty += PAGE_SIZE;
225 else 224 else
@@ -289,7 +288,7 @@ static int show_smap(struct seq_file *m, void *v)
289 struct mem_size_stats mss; 288 struct mem_size_stats mss;
290 289
291 memset(&mss, 0, sizeof mss); 290 memset(&mss, 0, sizeof mss);
292 if (vma->vm_mm) 291 if (vma->vm_mm && !is_vm_hugetlb_page(vma))
293 smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss); 292 smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss);
294 return show_map_internal(m, v, &mss); 293 return show_map_internal(m, v, &mss);
295} 294}
diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c
index cde5d48994ae..14bd2246fb6d 100644
--- a/fs/ramfs/inode.c
+++ b/fs/ramfs/inode.c
@@ -137,6 +137,7 @@ static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char *
137 inode->i_gid = dir->i_gid; 137 inode->i_gid = dir->i_gid;
138 d_instantiate(dentry, inode); 138 d_instantiate(dentry, inode);
139 dget(dentry); 139 dget(dentry);
140 dir->i_mtime = dir->i_ctime = CURRENT_TIME;
140 } else 141 } else
141 iput(inode); 142 iput(inode);
142 } 143 }
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index c8123308e060..284f7852de8b 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -247,7 +247,7 @@ static int linear_search_in_dir_item(struct cpu_key *key,
247 /* mark, that this generation number is used */ 247 /* mark, that this generation number is used */
248 if (de->de_gen_number_bit_string) 248 if (de->de_gen_number_bit_string)
249 set_bit(GET_GENERATION_NUMBER(deh_offset(deh)), 249 set_bit(GET_GENERATION_NUMBER(deh_offset(deh)),
250 (unsigned long *)de->de_gen_number_bit_string); 250 de->de_gen_number_bit_string);
251 251
252 // calculate pointer to name and namelen 252 // calculate pointer to name and namelen
253 de->de_entry_num = i; 253 de->de_entry_num = i;
@@ -431,7 +431,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
431 struct reiserfs_de_head *deh; 431 struct reiserfs_de_head *deh;
432 INITIALIZE_PATH(path); 432 INITIALIZE_PATH(path);
433 struct reiserfs_dir_entry de; 433 struct reiserfs_dir_entry de;
434 int bit_string[MAX_GENERATION_NUMBER / (sizeof(int) * 8) + 1]; 434 DECLARE_BITMAP(bit_string, MAX_GENERATION_NUMBER + 1);
435 int gen_number; 435 int gen_number;
436 char small_buf[32 + DEH_SIZE]; /* 48 bytes now and we avoid kmalloc 436 char small_buf[32 + DEH_SIZE]; /* 48 bytes now and we avoid kmalloc
437 if we create file with short name */ 437 if we create file with short name */
@@ -486,7 +486,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
486 486
487 /* find the proper place for the new entry */ 487 /* find the proper place for the new entry */
488 memset(bit_string, 0, sizeof(bit_string)); 488 memset(bit_string, 0, sizeof(bit_string));
489 de.de_gen_number_bit_string = (char *)bit_string; 489 de.de_gen_number_bit_string = bit_string;
490 retval = reiserfs_find_entry(dir, name, namelen, &path, &de); 490 retval = reiserfs_find_entry(dir, name, namelen, &path, &de);
491 if (retval != NAME_NOT_FOUND) { 491 if (retval != NAME_NOT_FOUND) {
492 if (buffer != small_buf) 492 if (buffer != small_buf)
@@ -508,7 +508,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
508 } 508 }
509 509
510 gen_number = 510 gen_number =
511 find_first_zero_bit((unsigned long *)bit_string, 511 find_first_zero_bit(bit_string,
512 MAX_GENERATION_NUMBER + 1); 512 MAX_GENERATION_NUMBER + 1);
513 if (gen_number > MAX_GENERATION_NUMBER) { 513 if (gen_number > MAX_GENERATION_NUMBER) {
514 /* there is no free generation number */ 514 /* there is no free generation number */