summaryrefslogtreecommitdiff
path: root/fs/aufs/super.h
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
commitd635711daa98be86d4c7fd01499c34f566b54ccb (patch)
treeaa5cc3760a27c3d57146498cb82fa549547de06c /fs/aufs/super.h
parentc91265cd0efb83778f015b4d4b1129bd2cfd075e (diff)
Linux-libre 4.6.2-gnu
Diffstat (limited to 'fs/aufs/super.h')
-rw-r--r--fs/aufs/super.h36
1 files changed, 25 insertions, 11 deletions
diff --git a/fs/aufs/super.h b/fs/aufs/super.h
index 23d03a067..b8ca14994 100644
--- a/fs/aufs/super.h
+++ b/fs/aufs/super.h
@@ -91,7 +91,7 @@ struct au_sbinfo {
* dirty approach to protect sb->sb_inodes and ->s_files (gone) from
* remount.
*/
- atomic_long_t si_ninodes, si_nfiles;
+ struct percpu_counter si_ninodes, si_nfiles;
/* branch management */
unsigned int si_generation;
@@ -99,7 +99,7 @@ struct au_sbinfo {
/* see AuSi_ flags */
unsigned char au_si_status;
- aufs_bindex_t si_bend;
+ aufs_bindex_t si_bbot;
/* dirty trick to keep br_id plus */
unsigned int si_last_br_id :
@@ -285,7 +285,7 @@ extern struct au_wbr_copyup_operations au_wbr_copyup_ops[];
extern struct au_wbr_create_operations au_wbr_create_ops[];
int au_cpdown_dirs(struct dentry *dentry, aufs_bindex_t bdst);
int au_wbr_nonopq(struct dentry *dentry, aufs_bindex_t bindex);
-int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t bstart);
+int au_wbr_do_copyup_bu(struct dentry *dentry, aufs_bindex_t btop);
/* mvdown.c */
int au_mvdown(struct dentry *dentry, struct aufs_mvdown __user *arg);
@@ -548,10 +548,10 @@ static inline void si_downgrade_lock(struct super_block *sb)
/* ---------------------------------------------------------------------- */
-static inline aufs_bindex_t au_sbend(struct super_block *sb)
+static inline aufs_bindex_t au_sbbot(struct super_block *sb)
{
SiMustAnyLock(sb);
- return au_sbi(sb)->si_bend;
+ return au_sbi(sb)->si_bbot;
}
static inline unsigned int au_mntflags(struct super_block *sb)
@@ -566,26 +566,40 @@ static inline unsigned int au_sigen(struct super_block *sb)
return au_sbi(sb)->si_generation;
}
+static inline unsigned long long au_ninodes(struct super_block *sb)
+{
+ s64 n = percpu_counter_sum(&au_sbi(sb)->si_ninodes);
+
+ BUG_ON(n < 0);
+ return n;
+}
+
static inline void au_ninodes_inc(struct super_block *sb)
{
- atomic_long_inc(&au_sbi(sb)->si_ninodes);
+ percpu_counter_inc(&au_sbi(sb)->si_ninodes);
}
static inline void au_ninodes_dec(struct super_block *sb)
{
- AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_ninodes));
- atomic_long_dec(&au_sbi(sb)->si_ninodes);
+ percpu_counter_dec(&au_sbi(sb)->si_ninodes);
+}
+
+static inline unsigned long long au_nfiles(struct super_block *sb)
+{
+ s64 n = percpu_counter_sum(&au_sbi(sb)->si_nfiles);
+
+ BUG_ON(n < 0);
+ return n;
}
static inline void au_nfiles_inc(struct super_block *sb)
{
- atomic_long_inc(&au_sbi(sb)->si_nfiles);
+ percpu_counter_inc(&au_sbi(sb)->si_nfiles);
}
static inline void au_nfiles_dec(struct super_block *sb)
{
- AuDebugOn(!atomic_long_read(&au_sbi(sb)->si_nfiles));
- atomic_long_dec(&au_sbi(sb)->si_nfiles);
+ percpu_counter_dec(&au_sbi(sb)->si_nfiles);
}
static inline struct au_branch *au_sbr(struct super_block *sb,