From: Artem Bityutskiy <dedekind1@gmail.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Kernel Maling List <linux-kernel@vger.kernel.org>,
Linux FS Maling List <linux-fsdevel@vger.kernel.org>,
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Subject: [PATCH v2 2/4] fat: introduce mark_fsinfo_dirty helper
Date: Fri, 13 Apr 2012 17:19:53 +0300 [thread overview]
Message-ID: <1334326795-2446-3-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1334326795-2446-1-git-send-email-dedekind1@gmail.com>
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
This is a preparation patch which introduces a 'mark_fsinfo_dirty()'
helper function which just sets the 's_dirt' flag to 1 so far. I'll add more
code to this helper later, so I do not mark it as 'inline'.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
fs/fat/fatent.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c
index 2e81ac0..e49d274 100644
--- a/fs/fat/fatent.c
+++ b/fs/fat/fatent.c
@@ -308,6 +308,11 @@ void fat_ent_access_init(struct super_block *sb)
}
}
+static void mark_fsinfo_dirty(struct super_block *sb)
+{
+ sb->s_dirt = 1;
+}
+
static inline int fat_ent_update_ptr(struct super_block *sb,
struct fat_entry *fatent,
int offset, sector_t blocknr)
@@ -498,7 +503,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
sbi->prev_free = entry;
if (sbi->free_clusters != -1)
sbi->free_clusters--;
- sb->s_dirt = 1;
+ mark_fsinfo_dirty(sb);
cluster[idx_clus] = entry;
idx_clus++;
@@ -520,7 +525,7 @@ int fat_alloc_clusters(struct inode *inode, int *cluster, int nr_cluster)
/* Couldn't allocate the free entries */
sbi->free_clusters = 0;
sbi->free_clus_valid = 1;
- sb->s_dirt = 1;
+ mark_fsinfo_dirty(sb);
err = -ENOSPC;
out:
@@ -587,7 +592,7 @@ int fat_free_clusters(struct inode *inode, int cluster)
ops->ent_put(&fatent, FAT_ENT_FREE);
if (sbi->free_clusters != -1) {
sbi->free_clusters++;
- sb->s_dirt = 1;
+ mark_fsinfo_dirty(sb);
}
if (nr_bhs + fatent.nr_bhs > MAX_BUF_PER_PAGE) {
@@ -677,7 +682,7 @@ int fat_count_free_clusters(struct super_block *sb)
}
sbi->free_clusters = free;
sbi->free_clus_valid = 1;
- sb->s_dirt = 1;
+ mark_fsinfo_dirty(sb);
fatent_brelse(&fatent);
out:
unlock_fat(sbi);
--
1.7.7.6
next prev parent reply other threads:[~2012-04-13 14:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-13 14:19 [PATCH v2 v2 0/4] do not use s_dirt in FAT FS Artem Bityutskiy
2012-04-13 14:19 ` [PATCH v2 1/4] fat: introduce special inode for managing the FSINFO block Artem Bityutskiy
2012-04-13 14:19 ` Artem Bityutskiy [this message]
2012-04-13 14:19 ` [PATCH v2 3/4] fat: mark superblock as dirty less often Artem Bityutskiy
2012-04-14 9:17 ` OGAWA Hirofumi
2012-04-14 10:24 ` Artem Bityutskiy
2012-04-14 10:37 ` OGAWA Hirofumi
2012-04-14 11:08 ` Artem Bityutskiy
2012-04-13 14:19 ` [PATCH v2 4/4] fat: switch to fsinfo_inode Artem Bityutskiy
2012-04-14 10:19 ` OGAWA Hirofumi
2012-04-14 10:29 ` Artem Bityutskiy
2012-04-14 10:36 ` OGAWA Hirofumi
2012-04-14 11:01 ` Artem Bityutskiy
2012-04-14 11:51 ` OGAWA Hirofumi
2012-04-14 12:36 ` Artem Bityutskiy
2012-04-14 13:12 ` OGAWA Hirofumi
2012-04-14 13:54 ` Artem Bityutskiy
2012-05-04 10:13 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334326795-2446-3-git-send-email-dedekind1@gmail.com \
--to=dedekind1@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=artem.bityutskiy@linux.intel.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).