summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nilfs2/cpfile.c2
-rw-r--r--fs/nilfs2/dir.c2
-rw-r--r--fs/nilfs2/ifile.h1
-rw-r--r--fs/nilfs2/inode.c1
-rw-r--r--fs/nilfs2/namei.c1
-rw-r--r--fs/nilfs2/recovery.c1
-rw-r--r--fs/nilfs2/segment.c1
-rw-r--r--fs/nilfs2/sufile.c2
-rw-r--r--fs/nilfs2/super.c1
-rw-r--r--fs/nilfs2/the_nilfs.h2
10 files changed, 14 insertions, 0 deletions
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c
index d192b48df9fb..16f884bd857c 100644
--- a/fs/nilfs2/cpfile.c
+++ b/fs/nilfs2/cpfile.c
@@ -37,6 +37,7 @@ static unsigned long
37nilfs_cpfile_get_blkoff(const struct inode *cpfile, __u64 cno) 37nilfs_cpfile_get_blkoff(const struct inode *cpfile, __u64 cno)
38{ 38{
39 __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1; 39 __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1;
40
40 do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile)); 41 do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile));
41 return (unsigned long)tcno; 42 return (unsigned long)tcno;
42} 43}
@@ -46,6 +47,7 @@ static unsigned long
46nilfs_cpfile_get_offset(const struct inode *cpfile, __u64 cno) 47nilfs_cpfile_get_offset(const struct inode *cpfile, __u64 cno)
47{ 48{
48 __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1; 49 __u64 tcno = cno + NILFS_MDT(cpfile)->mi_first_entry_offset - 1;
50
49 return do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile)); 51 return do_div(tcno, nilfs_cpfile_checkpoints_per_block(cpfile));
50} 52}
51 53
diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c
index 5756dda3083f..9ca3174f8196 100644
--- a/fs/nilfs2/dir.c
+++ b/fs/nilfs2/dir.c
@@ -74,6 +74,7 @@ static unsigned nilfs_last_byte(struct inode *inode, unsigned long page_nr)
74static int nilfs_prepare_chunk(struct page *page, unsigned from, unsigned to) 74static int nilfs_prepare_chunk(struct page *page, unsigned from, unsigned to)
75{ 75{
76 loff_t pos = page_offset(page) + from; 76 loff_t pos = page_offset(page) + from;
77
77 return __block_write_begin(page, pos, to - from, nilfs_get_block); 78 return __block_write_begin(page, pos, to - from, nilfs_get_block);
78} 79}
79 80
@@ -336,6 +337,7 @@ nilfs_find_entry(struct inode *dir, const struct qstr *qstr,
336 n = start; 337 n = start;
337 do { 338 do {
338 char *kaddr; 339 char *kaddr;
340
339 page = nilfs_get_page(dir, n); 341 page = nilfs_get_page(dir, n);
340 if (!IS_ERR(page)) { 342 if (!IS_ERR(page)) {
341 kaddr = page_address(page); 343 kaddr = page_address(page);
diff --git a/fs/nilfs2/ifile.h b/fs/nilfs2/ifile.h
index 1b7d7afcb35e..23ad2f091e76 100644
--- a/fs/nilfs2/ifile.h
+++ b/fs/nilfs2/ifile.h
@@ -32,6 +32,7 @@ static inline struct nilfs_inode *
32nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh) 32nilfs_ifile_map_inode(struct inode *ifile, ino_t ino, struct buffer_head *ibh)
33{ 33{
34 void *kaddr = kmap(ibh->b_page); 34 void *kaddr = kmap(ibh->b_page);
35
35 return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr); 36 return nilfs_palloc_block_get_entry(ifile, ino, ibh, kaddr);
36} 37}
37 38
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index bbebd5ece026..aaa129398eab 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -851,6 +851,7 @@ out_err:
851int nilfs_permission(struct inode *inode, int mask) 851int nilfs_permission(struct inode *inode, int mask)
852{ 852{
853 struct nilfs_root *root = NILFS_I(inode)->i_root; 853 struct nilfs_root *root = NILFS_I(inode)->i_root;
854
854 if ((mask & MAY_WRITE) && root && 855 if ((mask & MAY_WRITE) && root &&
855 root->cno != NILFS_CPTREE_CURRENT_CNO) 856 root->cno != NILFS_CPTREE_CURRENT_CNO)
856 return -EROFS; /* snapshot is not writable */ 857 return -EROFS; /* snapshot is not writable */
diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 8234af99d7d7..47bd989d88ed 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -44,6 +44,7 @@
44static inline int nilfs_add_nondir(struct dentry *dentry, struct inode *inode) 44static inline int nilfs_add_nondir(struct dentry *dentry, struct inode *inode)
45{ 45{
46 int err = nilfs_add_link(dentry, inode); 46 int err = nilfs_add_link(dentry, inode);
47
47 if (!err) { 48 if (!err) {
48 d_instantiate(dentry, inode); 49 d_instantiate(dentry, inode);
49 unlock_new_inode(inode); 50 unlock_new_inode(inode);
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c
index 402a45c2550d..685fa73cecd0 100644
--- a/fs/nilfs2/recovery.c
+++ b/fs/nilfs2/recovery.c
@@ -522,6 +522,7 @@ static int nilfs_recover_dsync_blocks(struct the_nilfs *nilfs,
522 0, &page, nilfs_get_block); 522 0, &page, nilfs_get_block);
523 if (unlikely(err)) { 523 if (unlikely(err)) {
524 loff_t isize = inode->i_size; 524 loff_t isize = inode->i_size;
525
525 if (pos + blocksize > isize) 526 if (pos + blocksize > isize)
526 nilfs_write_failed(inode->i_mapping, 527 nilfs_write_failed(inode->i_mapping,
527 pos + blocksize); 528 pos + blocksize);
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index ddbfb09527cd..69e9ea8d53c7 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -2391,6 +2391,7 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, int mode)
2391static void nilfs_construction_timeout(unsigned long data) 2391static void nilfs_construction_timeout(unsigned long data)
2392{ 2392{
2393 struct task_struct *p = (struct task_struct *)data; 2393 struct task_struct *p = (struct task_struct *)data;
2394
2394 wake_up_process(p); 2395 wake_up_process(p);
2395} 2396}
2396 2397
diff --git a/fs/nilfs2/sufile.c b/fs/nilfs2/sufile.c
index df439da883bc..1963595a1580 100644
--- a/fs/nilfs2/sufile.c
+++ b/fs/nilfs2/sufile.c
@@ -57,6 +57,7 @@ static unsigned long
57nilfs_sufile_get_blkoff(const struct inode *sufile, __u64 segnum) 57nilfs_sufile_get_blkoff(const struct inode *sufile, __u64 segnum)
58{ 58{
59 __u64 t = segnum + NILFS_MDT(sufile)->mi_first_entry_offset; 59 __u64 t = segnum + NILFS_MDT(sufile)->mi_first_entry_offset;
60
60 do_div(t, nilfs_sufile_segment_usages_per_block(sufile)); 61 do_div(t, nilfs_sufile_segment_usages_per_block(sufile));
61 return (unsigned long)t; 62 return (unsigned long)t;
62} 63}
@@ -65,6 +66,7 @@ static unsigned long
65nilfs_sufile_get_offset(const struct inode *sufile, __u64 segnum) 66nilfs_sufile_get_offset(const struct inode *sufile, __u64 segnum)
66{ 67{
67 __u64 t = segnum + NILFS_MDT(sufile)->mi_first_entry_offset; 68 __u64 t = segnum + NILFS_MDT(sufile)->mi_first_entry_offset;
69
68 return do_div(t, nilfs_sufile_segment_usages_per_block(sufile)); 70 return do_div(t, nilfs_sufile_segment_usages_per_block(sufile));
69} 71}
70 72
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 2cb78b857df6..92acb005b78f 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -743,6 +743,7 @@ static int parse_options(char *options, struct super_block *sb, int is_remount)
743 743
744 while ((p = strsep(&options, ",")) != NULL) { 744 while ((p = strsep(&options, ",")) != NULL) {
745 int token; 745 int token;
746
746 if (!*p) 747 if (!*p)
747 continue; 748 continue;
748 749
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index 6a262933fed9..62bd7b10fe43 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -269,6 +269,7 @@ struct nilfs_root {
269static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) 269static inline int nilfs_sb_need_update(struct the_nilfs *nilfs)
270{ 270{
271 u64 t = get_seconds(); 271 u64 t = get_seconds();
272
272 return t < nilfs->ns_sbwtime || 273 return t < nilfs->ns_sbwtime ||
273 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq; 274 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq;
274} 275}
@@ -276,6 +277,7 @@ static inline int nilfs_sb_need_update(struct the_nilfs *nilfs)
276static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) 277static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs)
277{ 278{
278 int flip_bits = nilfs->ns_sbwcount & 0x0FL; 279 int flip_bits = nilfs->ns_sbwcount & 0x0FL;
280
279 return (flip_bits != 0x08 && flip_bits != 0x0F); 281 return (flip_bits != 0x08 && flip_bits != 0x0F);
280} 282}
281 283