aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/dir.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:25:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:57 -0400
commit2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch)
tree98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/logfs/dir.c
parentce0b16ddf18df35026164fda4a642ef10c01f442 (diff)
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/logfs/dir.c')
-rw-r--r--fs/logfs/dir.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c
index 6bdc347008f5..4cf38f118549 100644
--- a/fs/logfs/dir.c
+++ b/fs/logfs/dir.c
@@ -213,7 +213,7 @@ static void abort_transaction(struct inode *inode, struct logfs_transaction *ta)
213static int logfs_unlink(struct inode *dir, struct dentry *dentry) 213static int logfs_unlink(struct inode *dir, struct dentry *dentry)
214{ 214{
215 struct logfs_super *super = logfs_super(dir->i_sb); 215 struct logfs_super *super = logfs_super(dir->i_sb);
216 struct inode *inode = dentry->d_inode; 216 struct inode *inode = d_inode(dentry);
217 struct logfs_transaction *ta; 217 struct logfs_transaction *ta;
218 struct page *page; 218 struct page *page;
219 pgoff_t index; 219 pgoff_t index;
@@ -271,7 +271,7 @@ static inline int logfs_empty_dir(struct inode *dir)
271 271
272static int logfs_rmdir(struct inode *dir, struct dentry *dentry) 272static int logfs_rmdir(struct inode *dir, struct dentry *dentry)
273{ 273{
274 struct inode *inode = dentry->d_inode; 274 struct inode *inode = d_inode(dentry);
275 275
276 if (!logfs_empty_dir(inode)) 276 if (!logfs_empty_dir(inode))
277 return -ENOTEMPTY; 277 return -ENOTEMPTY;
@@ -537,7 +537,7 @@ static int logfs_symlink(struct inode *dir, struct dentry *dentry,
537static int logfs_link(struct dentry *old_dentry, struct inode *dir, 537static int logfs_link(struct dentry *old_dentry, struct inode *dir,
538 struct dentry *dentry) 538 struct dentry *dentry)
539{ 539{
540 struct inode *inode = old_dentry->d_inode; 540 struct inode *inode = d_inode(old_dentry);
541 541
542 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; 542 inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME;
543 ihold(inode); 543 ihold(inode);
@@ -607,7 +607,7 @@ static int logfs_rename_cross(struct inode *old_dir, struct dentry *old_dentry,
607 /* 2. write target dd */ 607 /* 2. write target dd */
608 mutex_lock(&super->s_dirop_mutex); 608 mutex_lock(&super->s_dirop_mutex);
609 logfs_add_transaction(new_dir, ta); 609 logfs_add_transaction(new_dir, ta);
610 err = logfs_write_dir(new_dir, new_dentry, old_dentry->d_inode); 610 err = logfs_write_dir(new_dir, new_dentry, d_inode(old_dentry));
611 if (!err) 611 if (!err)
612 err = write_inode(new_dir); 612 err = write_inode(new_dir);
613 613
@@ -658,8 +658,8 @@ static int logfs_rename_target(struct inode *old_dir, struct dentry *old_dentry,
658 struct inode *new_dir, struct dentry *new_dentry) 658 struct inode *new_dir, struct dentry *new_dentry)
659{ 659{
660 struct logfs_super *super = logfs_super(old_dir->i_sb); 660 struct logfs_super *super = logfs_super(old_dir->i_sb);
661 struct inode *old_inode = old_dentry->d_inode; 661 struct inode *old_inode = d_inode(old_dentry);
662 struct inode *new_inode = new_dentry->d_inode; 662 struct inode *new_inode = d_inode(new_dentry);
663 int isdir = S_ISDIR(old_inode->i_mode); 663 int isdir = S_ISDIR(old_inode->i_mode);
664 struct logfs_disk_dentry dd; 664 struct logfs_disk_dentry dd;
665 struct logfs_transaction *ta; 665 struct logfs_transaction *ta;
@@ -719,7 +719,7 @@ out:
719static int logfs_rename(struct inode *old_dir, struct dentry *old_dentry, 719static int logfs_rename(struct inode *old_dir, struct dentry *old_dentry,
720 struct inode *new_dir, struct dentry *new_dentry) 720 struct inode *new_dir, struct dentry *new_dentry)
721{ 721{
722 if (new_dentry->d_inode) 722 if (d_really_is_positive(new_dentry))
723 return logfs_rename_target(old_dir, old_dentry, 723 return logfs_rename_target(old_dir, old_dentry,
724 new_dir, new_dentry); 724 new_dir, new_dentry);
725 return logfs_rename_cross(old_dir, old_dentry, new_dir, new_dentry); 725 return logfs_rename_cross(old_dir, old_dentry, new_dir, new_dentry);