Skip to content

Commit abfa034

Browse files
kvaneeshericvh
authored andcommitted
fs/9p: Update zero-copy implementation in 9p
* remove lot of update to different data structure * add a seperate callback for zero copy request. * above makes non zero copy code path simpler * remove conditionalizing TREAD/TREADDIR/TWRITE in the zero copy path * Fix the dotu p9_check_errors with zero copy. Add sufficient doc around * Add support for both in and output buffers in zero copy callback * pin and unpin pages in the same context * use helpers instead of defining page offset and rest of page ourself * Fix mem leak in p9_check_errors * Remove 'E' and 'F' in p9pdu_vwritef Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
1 parent c3b92c8 commit abfa034

9 files changed

Lines changed: 506 additions & 348 deletions

File tree

‎fs/9p/vfs_dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
231231
while (err == 0) {
232232
if (rdir->tail == rdir->head) {
233233
err = p9_client_readdir(fid, rdir->buf, buflen,
234-
filp->f_pos);
234+
filp->f_pos);
235235
if (err <= 0)
236236
goto unlock_and_exit;
237237

‎include/net/9p/9p.h‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ enum p9_qid_t {
359359
/* Room for readdir header */
360360
#define P9_READDIRHDRSZ 24
361361

362+
/* size of header for zero copy read/write */
363+
#define P9_ZC_HDR_SZ 4096
364+
362365
/**
363366
* struct p9_qid - file system entity information
364367
* @type: 8-bit type &p9_qid_t
@@ -555,10 +558,6 @@ struct p9_rstatfs {
555558
* @tag: transaction id of the request
556559
* @offset: used by marshalling routines to track current position in buffer
557560
* @capacity: used by marshalling routines to track total malloc'd capacity
558-
* @pubuf: Payload user buffer given by the caller
559-
* @pkbuf: Payload kernel buffer given by the caller
560-
* @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write.
561-
* @private: For transport layer's use.
562561
* @sdata: payload
563562
*
564563
* &p9_fcall represents the structure for all 9P RPC
@@ -575,10 +574,6 @@ struct p9_fcall {
575574

576575
size_t offset;
577576
size_t capacity;
578-
char __user *pubuf;
579-
char *pkbuf;
580-
size_t pbuf_size;
581-
void *private;
582577

583578
u8 *sdata;
584579
};

‎include/net/9p/transport.h‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@
2626
#ifndef NET_9P_TRANSPORT_H
2727
#define NET_9P_TRANSPORT_H
2828

29-
#define P9_TRANS_PREF_PAYLOAD_MASK 0x1
30-
31-
/* Default. Add Payload to PDU before sending it down to transport layer */
32-
#define P9_TRANS_PREF_PAYLOAD_DEF 0x0
33-
/* Send pay load separately to transport layer along with PDU.*/
34-
#define P9_TRANS_PREF_PAYLOAD_SEP 0x1
35-
3629
/**
3730
* struct p9_trans_module - transport module interface
3831
* @list: used to maintain a list of currently available transports
@@ -56,13 +49,14 @@ struct p9_trans_module {
5649
struct list_head list;
5750
char *name; /* name of transport */
5851
int maxsize; /* max message size of transport */
59-
int pref; /* Preferences of this transport */
6052
int def; /* this transport should be default */
6153
struct module *owner;
6254
int (*create)(struct p9_client *, const char *, char *);
6355
void (*close) (struct p9_client *);
6456
int (*request) (struct p9_client *, struct p9_req_t *req);
6557
int (*cancel) (struct p9_client *, struct p9_req_t *req);
58+
int (*zc_request)(struct p9_client *, struct p9_req_t *,
59+
char *, char *, int , int, int, int);
6660
};
6761

6862
void v9fs_register_trans(struct p9_trans_module *m);

0 commit comments

Comments
 (0)