[1/5] Extract inode_inc_count(), inode_dec_count()
diff mbox series

Message ID 20060118003453.GB24835@mipter.zuzino.mipt.ru
State New, archived
Headers show
Series
  • [1/5] Extract inode_inc_count(), inode_dec_count()
Related show

Commit Message

Alexey Dobriyan Jan. 18, 2006, 12:34 a.m. UTC
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/linux/fs.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Andrew Morton Jan. 18, 2006, 1:18 a.m. UTC | #1
Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
> +static inline void inode_inc_count(struct inode *inode)
> +{
> +	inode->i_nlink++;
> +	mark_inode_dirty(inode);
> +}

hm, OK.  I think I'll switch these all to inode_inc_link_count(), to
clearly distinguish them from the various functions which diddle ->i_count.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1112,6 +1112,18 @@  static inline void mark_inode_dirty_sync
 	__mark_inode_dirty(inode, I_DIRTY_SYNC);
 }
 
+static inline void inode_inc_count(struct inode *inode)
+{
+	inode->i_nlink++;
+	mark_inode_dirty(inode);
+}
+
+static inline void inode_dec_count(struct inode *inode)
+{
+	inode->i_nlink--;
+	mark_inode_dirty(inode);
+}
+
 extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry);
 static inline void file_accessed(struct file *file)
 {