Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273198
b: refs/heads/master
c: a78ef70
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Christoph Hellwig committed Nov 2, 2011
1 parent 71edb71 commit 2d2c864
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bfe8684869601dacfcb2cd69ef8cfd9045f62170
refs/heads/master: a78ef704a8dd430225955f0709b22d4a6ba21deb
2 changes: 1 addition & 1 deletion trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode)
atomic_set(&inode->i_count, 1);
inode->i_op = &empty_iops;
inode->i_fop = &empty_fops;
inode->i_nlink = 1;
inode->__i_nlink = 1;
inode->i_opflags = 0;
inode->i_uid = 0;
inode->i_gid = 0;
Expand Down
20 changes: 15 additions & 5 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,17 @@ struct inode {

/* Stat data, not accessed from path walking */
unsigned long i_ino;
unsigned int i_nlink;
/*
* Filesystems may only read i_nlink directly. They shall use the
* following functions for modification:
*
* (set|clear|inc|drop)_nlink
* inode_(inc|dec)_link_count
*/
union {
const unsigned int i_nlink;
unsigned int __i_nlink;
};
dev_t i_rdev;
loff_t i_size;
struct timespec i_atime;
Expand Down Expand Up @@ -1764,7 +1774,7 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
*/
static inline void set_nlink(struct inode *inode, unsigned int nlink)
{
inode->i_nlink = nlink;
inode->__i_nlink = nlink;
}

/**
Expand All @@ -1777,7 +1787,7 @@ static inline void set_nlink(struct inode *inode, unsigned int nlink)
*/
static inline void inc_nlink(struct inode *inode)
{
inode->i_nlink++;
inode->__i_nlink++;
}

static inline void inode_inc_link_count(struct inode *inode)
Expand All @@ -1799,7 +1809,7 @@ static inline void inode_inc_link_count(struct inode *inode)
*/
static inline void drop_nlink(struct inode *inode)
{
inode->i_nlink--;
inode->__i_nlink--;
}

/**
Expand All @@ -1812,7 +1822,7 @@ static inline void drop_nlink(struct inode *inode)
*/
static inline void clear_nlink(struct inode *inode)
{
inode->i_nlink = 0;
inode->__i_nlink = 0;
}

static inline void inode_dec_link_count(struct inode *inode)
Expand Down

0 comments on commit 2d2c864

Please sign in to comment.