]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] v9fs: Support to force umount
authorEric Van Hensbergen <ericvh@gmail.com>
Fri, 9 Sep 2005 20:04:23 +0000 (13:04 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 20:57:57 +0000 (13:57 -0700)
Support for force umount

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/9p/mux.c
fs/9p/mux.h
fs/9p/v9fs.c
fs/9p/v9fs.h
fs/9p/vfs_super.c

index 8ebc1af2c245fef0f9b89644ee3a3dab099d28dd..0854bef58c166edce9da5d946cd8eb5acd8f3970 100644 (file)
@@ -323,6 +323,26 @@ v9fs_mux_rpc(struct v9fs_session_info *v9ses, struct v9fs_fcall *tcall,
        return ret;
 }
 
+/**
+ * v9fs_mux_cancel_requests - cancels all pending requests
+ *
+ * @v9ses: session info structure
+ * @err: error code to return to the requests
+ */
+void v9fs_mux_cancel_requests(struct v9fs_session_info *v9ses, int err)
+{
+       struct v9fs_rpcreq *rptr;
+       struct v9fs_rpcreq *rreq;
+
+       dprintk(DEBUG_MUX, " %d\n", err);
+       spin_lock(&v9ses->muxlock);
+       list_for_each_entry_safe(rreq, rptr, &v9ses->mux_fcalls, next) {
+               rreq->err = err;
+       }
+       spin_unlock(&v9ses->muxlock);
+       wake_up_all(&v9ses->read_wait);
+}
+
 /**
  * v9fs_recvproc - kproc to handle demultiplexing responses
  * @data: session info structure
index d7d8fa1c15291eec062507fad5d9a9ce6ec29c63..82ce793af1b57402cff569415c454eb404e6367b 100644 (file)
@@ -37,3 +37,4 @@ struct v9fs_rpcreq {
 int v9fs_mux_init(struct v9fs_session_info *v9ses, const char *dev_name);
 long v9fs_mux_rpc(struct v9fs_session_info *v9ses,
                  struct v9fs_fcall *tcall, struct v9fs_fcall **rcall);
+void v9fs_mux_cancel_requests(struct v9fs_session_info *v9ses, int err);
index a573b751dd9a6a8088fce4aa73456649bb9080dc..13bdbbab4387a38809b512efb9241a2d71fd05df 100644 (file)
@@ -409,6 +409,15 @@ void v9fs_session_close(struct v9fs_session_info *v9ses)
        putname(v9ses->remotename);
 }
 
+/**
+ * v9fs_session_cancel - mark transport as disconnected
+ *     and cancel all pending requests.
+ */
+void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
+       v9ses->transport->status = Disconnected;
+       v9fs_mux_cancel_requests(v9ses, -EIO);
+}
+
 extern int v9fs_error_init(void);
 
 /**
index 52203027b1586db62a61ca3df8004a4426e7d7e1..45dcef42bdd63b7de3c74a46577f616a27d006f6 100644 (file)
@@ -89,9 +89,7 @@ struct v9fs_session_info *v9fs_inode2v9ses(struct inode *);
 void v9fs_session_close(struct v9fs_session_info *v9ses);
 int v9fs_get_idpool(struct v9fs_idpool *p);
 void v9fs_put_idpool(int id, struct v9fs_idpool *p);
-int v9fs_get_option(char *opts, char *name, char *buf, int buflen);
-long long v9fs_get_int_option(char *opts, char *name, long long dflt);
-int v9fs_parse_tcp_devname(const char *devname, char **addr, char **remotename);
+void v9fs_session_cancel(struct v9fs_session_info *v9ses);
 
 #define V9FS_MAGIC 0x01021997
 
index ce0778acc90abc1bde1e290c5eb659c6195b788e..868f350b2c5fa7e5666a42e69973349bcea5a6b8 100644 (file)
@@ -257,10 +257,19 @@ static int v9fs_show_options(struct seq_file *m, struct vfsmount *mnt)
        return 0;
 }
 
+static void
+v9fs_umount_begin(struct super_block *sb)
+{
+       struct v9fs_session_info *v9ses = sb->s_fs_info;
+
+       v9fs_session_cancel(v9ses);
+}
+
 static struct super_operations v9fs_super_ops = {
        .statfs = simple_statfs,
        .clear_inode = v9fs_clear_inode,
        .show_options = v9fs_show_options,
+       .umount_begin = v9fs_umount_begin,
 };
 
 struct file_system_type v9fs_fs_type = {