diff options
Diffstat (limited to 'fs/logfs/inode.c')
-rw-r--r-- | fs/logfs/inode.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/logfs/inode.c b/fs/logfs/inode.c index 14ed27274da2..f602e230e162 100644 --- a/fs/logfs/inode.c +++ b/fs/logfs/inode.c | |||
@@ -193,6 +193,7 @@ static void logfs_init_inode(struct super_block *sb, struct inode *inode) | |||
193 | inode->i_ctime = CURRENT_TIME; | 193 | inode->i_ctime = CURRENT_TIME; |
194 | inode->i_mtime = CURRENT_TIME; | 194 | inode->i_mtime = CURRENT_TIME; |
195 | inode->i_nlink = 1; | 195 | inode->i_nlink = 1; |
196 | li->li_refcount = 1; | ||
196 | INIT_LIST_HEAD(&li->li_freeing_list); | 197 | INIT_LIST_HEAD(&li->li_freeing_list); |
197 | 198 | ||
198 | for (i = 0; i < LOGFS_EMBEDDED_FIELDS; i++) | 199 | for (i = 0; i < LOGFS_EMBEDDED_FIELDS; i++) |
@@ -326,7 +327,7 @@ static void logfs_set_ino_generation(struct super_block *sb, | |||
326 | u64 ino; | 327 | u64 ino; |
327 | 328 | ||
328 | mutex_lock(&super->s_journal_mutex); | 329 | mutex_lock(&super->s_journal_mutex); |
329 | ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino); | 330 | ino = logfs_seek_hole(super->s_master_inode, super->s_last_ino + 1); |
330 | super->s_last_ino = ino; | 331 | super->s_last_ino = ino; |
331 | super->s_inos_till_wrap--; | 332 | super->s_inos_till_wrap--; |
332 | if (super->s_inos_till_wrap < 0) { | 333 | if (super->s_inos_till_wrap < 0) { |
@@ -357,14 +358,7 @@ struct inode *logfs_new_inode(struct inode *dir, int mode) | |||
357 | inode->i_mode = mode; | 358 | inode->i_mode = mode; |
358 | logfs_set_ino_generation(sb, inode); | 359 | logfs_set_ino_generation(sb, inode); |
359 | 360 | ||
360 | inode->i_uid = current_fsuid(); | 361 | inode_init_owner(inode, dir, mode); |
361 | inode->i_gid = current_fsgid(); | ||
362 | if (dir->i_mode & S_ISGID) { | ||
363 | inode->i_gid = dir->i_gid; | ||
364 | if (S_ISDIR(mode)) | ||
365 | inode->i_mode |= S_ISGID; | ||
366 | } | ||
367 | |||
368 | logfs_inode_setops(inode); | 362 | logfs_inode_setops(inode); |
369 | insert_inode_hash(inode); | 363 | insert_inode_hash(inode); |
370 | 364 | ||
@@ -386,8 +380,7 @@ static void logfs_init_once(void *_li) | |||
386 | 380 | ||
387 | static int logfs_sync_fs(struct super_block *sb, int wait) | 381 | static int logfs_sync_fs(struct super_block *sb, int wait) |
388 | { | 382 | { |
389 | /* FIXME: write anchor */ | 383 | logfs_write_anchor(sb); |
390 | logfs_super(sb)->s_devops->sync(sb); | ||
391 | return 0; | 384 | return 0; |
392 | } | 385 | } |
393 | 386 | ||