Commit 04aea0ca authored by Bob Peterson's avatar Bob Peterson Committed by Andreas Gruenbacher

gfs2: Rename SDF_SHUTDOWN to SDF_WITHDRAWN

Before this patch, the superblock flag indicating when a file system
is withdrawn was called SDF_SHUTDOWN. This patch simply renames it to
the more obvious SDF_WITHDRAWN.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
parent d14e1ca3
...@@ -518,7 +518,7 @@ static int __gfs2_readpage(void *file, struct page *page) ...@@ -518,7 +518,7 @@ static int __gfs2_readpage(void *file, struct page *page)
error = mpage_readpage(page, gfs2_block_map); error = mpage_readpage(page, gfs2_block_map);
} }
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
return -EIO; return -EIO;
return error; return error;
...@@ -635,7 +635,7 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping, ...@@ -635,7 +635,7 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping,
gfs2_glock_dq(&gh); gfs2_glock_dq(&gh);
out_uninit: out_uninit:
gfs2_holder_uninit(&gh); gfs2_holder_uninit(&gh);
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
ret = -EIO; ret = -EIO;
return ret; return ret;
} }
......
...@@ -1166,7 +1166,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl) ...@@ -1166,7 +1166,7 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
cmd = F_SETLK; cmd = F_SETLK;
fl->fl_type = F_UNLCK; fl->fl_type = F_UNLCK;
} }
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags))) {
if (fl->fl_type == F_UNLCK) if (fl->fl_type == F_UNLCK)
locks_lock_file_wait(file, fl); locks_lock_file_wait(file, fl);
return -EIO; return -EIO;
......
...@@ -544,7 +544,7 @@ __acquires(&gl->gl_lockref.lock) ...@@ -544,7 +544,7 @@ __acquires(&gl->gl_lockref.lock)
unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0); unsigned int lck_flags = (unsigned int)(gh ? gh->gh_flags : 0);
int ret; int ret;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) && if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) &&
target != LM_ST_UNLOCKED) target != LM_ST_UNLOCKED)
return; return;
lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP | lck_flags &= (LM_FLAG_TRY | LM_FLAG_TRY_1CB | LM_FLAG_NOEXP |
...@@ -581,7 +581,7 @@ __acquires(&gl->gl_lockref.lock) ...@@ -581,7 +581,7 @@ __acquires(&gl->gl_lockref.lock)
} }
else if (ret) { else if (ret) {
fs_err(sdp, "lm_lock ret %d\n", ret); fs_err(sdp, "lm_lock ret %d\n", ret);
GLOCK_BUG_ON(gl, !test_bit(SDF_SHUTDOWN, GLOCK_BUG_ON(gl, !test_bit(SDF_WITHDRAWN,
&sdp->sd_flags)); &sdp->sd_flags));
} }
} else { /* lock_nolock */ } else { /* lock_nolock */
...@@ -1094,7 +1094,7 @@ int gfs2_glock_nq(struct gfs2_holder *gh) ...@@ -1094,7 +1094,7 @@ int gfs2_glock_nq(struct gfs2_holder *gh)
struct gfs2_sbd *sdp = gl->gl_name.ln_sbd; struct gfs2_sbd *sdp = gl->gl_name.ln_sbd;
int error = 0; int error = 0;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
return -EIO; return -EIO;
if (test_bit(GLF_LRU, &gl->gl_flags)) if (test_bit(GLF_LRU, &gl->gl_flags))
......
...@@ -536,7 +536,7 @@ static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh) ...@@ -536,7 +536,7 @@ static int freeze_go_xmote_bh(struct gfs2_glock *gl, struct gfs2_holder *gh)
gfs2_consist(sdp); gfs2_consist(sdp);
/* Initialize some head of the log stuff */ /* Initialize some head of the log stuff */
if (!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) { if (!test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) {
sdp->sd_log_sequence = head.lh_sequence + 1; sdp->sd_log_sequence = head.lh_sequence + 1;
gfs2_log_pointers_init(sdp, head.lh_blkno); gfs2_log_pointers_init(sdp, head.lh_blkno);
} }
......
...@@ -608,7 +608,7 @@ struct gfs2_tune { ...@@ -608,7 +608,7 @@ struct gfs2_tune {
enum { enum {
SDF_JOURNAL_CHECKED = 0, SDF_JOURNAL_CHECKED = 0,
SDF_JOURNAL_LIVE = 1, SDF_JOURNAL_LIVE = 1,
SDF_SHUTDOWN = 2, SDF_WITHDRAWN = 2,
SDF_NOBARRIERS = 3, SDF_NOBARRIERS = 3,
SDF_NORECOVERY = 4, SDF_NORECOVERY = 4,
SDF_DEMOTE = 5, SDF_DEMOTE = 5,
......
...@@ -251,7 +251,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, ...@@ -251,7 +251,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
struct buffer_head *bh, *bhs[2]; struct buffer_head *bh, *bhs[2];
int num = 0; int num = 0;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) { if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags))) {
*bhp = NULL; *bhp = NULL;
return -EIO; return -EIO;
} }
...@@ -309,7 +309,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags, ...@@ -309,7 +309,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh) int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
{ {
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
return -EIO; return -EIO;
wait_on_buffer(bh); wait_on_buffer(bh);
...@@ -320,7 +320,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh) ...@@ -320,7 +320,7 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
gfs2_io_error_bh_wd(sdp, bh); gfs2_io_error_bh_wd(sdp, bh);
return -EIO; return -EIO;
} }
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
return -EIO; return -EIO;
return 0; return 0;
......
...@@ -1004,7 +1004,7 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent) ...@@ -1004,7 +1004,7 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
void gfs2_lm_unmount(struct gfs2_sbd *sdp) void gfs2_lm_unmount(struct gfs2_sbd *sdp)
{ {
const struct lm_lockops *lm = sdp->sd_lockstruct.ls_ops; const struct lm_lockops *lm = sdp->sd_lockstruct.ls_ops;
if (likely(!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) && if (likely(!test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) &&
lm->lm_unmount) lm->lm_unmount)
lm->lm_unmount(sdp); lm->lm_unmount(sdp);
} }
......
...@@ -1475,7 +1475,7 @@ static void quotad_error(struct gfs2_sbd *sdp, const char *msg, int error) ...@@ -1475,7 +1475,7 @@ static void quotad_error(struct gfs2_sbd *sdp, const char *msg, int error)
{ {
if (error == 0 || error == -EROFS) if (error == 0 || error == -EROFS)
return; return;
if (!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) { if (!test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) {
fs_err(sdp, "gfs2_quotad: %s error %d\n", msg, error); fs_err(sdp, "gfs2_quotad: %s error %d\n", msg, error);
sdp->sd_log_error = error; sdp->sd_log_error = error;
wake_up(&sdp->sd_logd_waitq); wake_up(&sdp->sd_logd_waitq);
......
...@@ -805,7 +805,7 @@ static void gfs2_dirty_inode(struct inode *inode, int flags) ...@@ -805,7 +805,7 @@ static void gfs2_dirty_inode(struct inode *inode, int flags)
if (!(flags & I_DIRTY_INODE)) if (!(flags & I_DIRTY_INODE))
return; return;
if (unlikely(test_bit(SDF_SHUTDOWN, &sdp->sd_flags))) if (unlikely(test_bit(SDF_WITHDRAWN, &sdp->sd_flags)))
return; return;
if (!gfs2_glock_is_locked_by_me(ip->i_gl)) { if (!gfs2_glock_is_locked_by_me(ip->i_gl)) {
ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh); ret = gfs2_glock_nq_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &gh);
...@@ -854,7 +854,7 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp) ...@@ -854,7 +854,7 @@ static int gfs2_make_fs_ro(struct gfs2_sbd *sdp)
error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_NOCACHE, error = gfs2_glock_nq_init(sdp->sd_freeze_gl, LM_ST_SHARED, GL_NOCACHE,
&freeze_gh); &freeze_gh);
if (error && !test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) if (error && !test_bit(SDF_WITHDRAWN, &sdp->sd_flags))
return error; return error;
flush_workqueue(gfs2_delete_workqueue); flush_workqueue(gfs2_delete_workqueue);
...@@ -1013,7 +1013,7 @@ static int gfs2_freeze(struct super_block *sb) ...@@ -1013,7 +1013,7 @@ static int gfs2_freeze(struct super_block *sb)
if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN) if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN)
goto out; goto out;
if (test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) { if (test_bit(SDF_WITHDRAWN, &sdp->sd_flags)) {
error = -EINVAL; error = -EINVAL;
goto out; goto out;
} }
......
...@@ -118,7 +118,7 @@ static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len) ...@@ -118,7 +118,7 @@ static ssize_t freeze_store(struct gfs2_sbd *sdp, const char *buf, size_t len)
static ssize_t withdraw_show(struct gfs2_sbd *sdp, char *buf) static ssize_t withdraw_show(struct gfs2_sbd *sdp, char *buf)
{ {
unsigned int b = test_bit(SDF_SHUTDOWN, &sdp->sd_flags); unsigned int b = test_bit(SDF_WITHDRAWN, &sdp->sd_flags);
return snprintf(buf, PAGE_SIZE, "%u\n", b); return snprintf(buf, PAGE_SIZE, "%u\n", b);
} }
......
...@@ -41,7 +41,7 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, const char *fmt, ...) ...@@ -41,7 +41,7 @@ int gfs2_lm_withdraw(struct gfs2_sbd *sdp, const char *fmt, ...)
struct va_format vaf; struct va_format vaf;
if (sdp->sd_args.ar_errors == GFS2_ERRORS_WITHDRAW && if (sdp->sd_args.ar_errors == GFS2_ERRORS_WITHDRAW &&
test_and_set_bit(SDF_SHUTDOWN, &sdp->sd_flags)) test_and_set_bit(SDF_WITHDRAWN, &sdp->sd_flags))
return 0; return 0;
if (fmt) { if (fmt) {
...@@ -256,7 +256,7 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh, ...@@ -256,7 +256,7 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh,
const char *function, char *file, unsigned int line, const char *function, char *file, unsigned int line,
bool withdraw) bool withdraw)
{ {
if (!test_bit(SDF_SHUTDOWN, &sdp->sd_flags)) if (!test_bit(SDF_WITHDRAWN, &sdp->sd_flags))
fs_err(sdp, fs_err(sdp,
"fatal: I/O error\n" "fatal: I/O error\n"
" block = %llu\n" " block = %llu\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment