diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fat/ff.c | 2 | ||||
-rw-r--r-- | fs/nfs.c | 4 | ||||
-rw-r--r-- | fs/omap4_usbbootfs.c | 41 | ||||
-rw-r--r-- | fs/pstore/platform.c | 29 |
4 files changed, 34 insertions, 42 deletions
diff --git a/fs/fat/ff.c b/fs/fat/ff.c index ba4adfc133..4d30433e5f 100644 --- a/fs/fat/ff.c +++ b/fs/fat/ff.c @@ -1538,7 +1538,7 @@ static enum filetype check_fs ( /* 0:The FAT BR, 1:Valid BR but not an FAT, 2:No DWORD *bootsec ) { - enum filetype ret; + DRESULT ret; /* Load boot record */ ret = disk_read(fs, fs->win, sect, 1); @@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target = xzalloc(len + 1); diff --git a/fs/omap4_usbbootfs.c b/fs/omap4_usbbootfs.c index 169cde7ddb..4f159210d1 100644 --- a/fs/omap4_usbbootfs.c +++ b/fs/omap4_usbbootfs.c @@ -29,39 +29,6 @@ struct file_priv { s32 id; u32 size; }; -/* -static int omap4_usbbootfs_create( - struct device_d *dev, const char *pathname, mode_t mode) -{ - return -ENOSYS; -} - -static int omap4_usbbootfs_unlink(struct device_d *dev, const char *pathname) -{ - return -ENOSYS; -} - -static int omap4_usbbootfs_mkdir(struct device_d *dev, const char *pathname) -{ - return -ENOSYS; -} - -static int omap4_usbbootfs_rmdir(struct device_d *dev, const char *pathname) -{ - return -ENOSYS; -} - -static int omap4_usbbootfs_write( - struct device_d *_dev, FILE *f, const void *inbuf, size_t size) -{ - return -ENOSYS; -} - -static int omap4_usbbootfs_truncate(struct device_d *dev, FILE *f, loff_t size) -{ - return -ENOSYS; -} -*/ static struct file_priv *omap4_usbbootfs_do_open( struct device_d *dev, int accmode, const char *filename) @@ -187,14 +154,6 @@ static struct fs_driver_d omap4_usbbootfs_driver = { .read = omap4_usbbootfs_read, .opendir = omap4_usbbootfs_opendir, .stat = omap4_usbbootfs_stat, -/* - .create = omap4_usbbootfs_create, - .unlink = omap4_usbbootfs_unlink, - .mkdir = omap4_usbbootfs_mkdir, - .rmdir = omap4_usbbootfs_rmdir, - .write = omap4_usbbootfs_write, - .truncate= omap4_usbbootfs_truncate, -*/ .flags = 0, .drv = { .probe = omap4_usbbootfs_probe, diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 0a6fa38edc..15c0174b1f 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -46,6 +46,35 @@ void pstore_set_kmsg_bytes(int bytes) static int pstore_ready; +static void pstore_console_write(const char *s, unsigned c) +{ + const char *e = s + c; + + while (s < e) { + struct pstore_record record = { + .type = PSTORE_TYPE_CONSOLE, + .psi = psinfo, + }; + + if (c > psinfo->bufsize) + c = psinfo->bufsize; + + record.buf = (char *)s; + record.size = c; + psinfo->write_buf(PSTORE_TYPE_CONSOLE, 0, &record.id, 0, + record.buf, 0, record.size, psinfo); + s += c; + c = e - s; + } +} + +static int pstore_console_puts(struct console_device *cdev, const char *s, + size_t nbytes) +{ + pstore_console_write(s, nbytes); + return nbytes; +} + void pstore_log(const char *str) { uint64_t id; |