• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/ntfs-3g-2009.3.8/libfuse-lite/

Lines Matching defs:dh

1713     struct fuse_dh *dh = (struct fuse_dh *) (uintptr_t) llfi->fh;
1715 fi->fh = dh->fh;
1716 fi->fh_old = dh->fh;
1717 return dh;
1725 struct fuse_dh *dh;
1730 dh = (struct fuse_dh *) malloc(sizeof(struct fuse_dh));
1731 if (dh == NULL) {
1735 memset(dh, 0, sizeof(struct fuse_dh));
1736 dh->fuse = f;
1737 dh->contents = NULL;
1738 dh->len = 0;
1739 dh->filled = 0;
1740 dh->nodeid = ino;
1741 fuse_mutex_init(&dh->lock);
1743 llfi->fh = (uintptr_t) dh;
1755 dh->fh = fi.fh;
1763 pthread_mutex_destroy(&dh->lock);
1764 free(dh);
1768 pthread_mutex_destroy(&dh->lock);
1769 free(dh);
1775 static int extend_contents(struct fuse_dh *dh, unsigned minsize)
1777 if (minsize > dh->size) {
1779 unsigned newsize = dh->size;
1789 newptr = (char *) realloc(dh->contents, newsize);
1791 dh->error = -ENOMEM;
1794 dh->contents = newptr;
1795 dh->size = newsize;
1803 struct fuse_dh *dh = (struct fuse_dh *) dh_;
1814 if (!dh->fuse->conf.use_ino) {
1816 if (dh->fuse->conf.readdir_ino) {
1818 pthread_mutex_lock(&dh->fuse->lock);
1819 node = lookup_node(dh->fuse, dh->nodeid, name);
1822 pthread_mutex_unlock(&dh->fuse->lock);
1827 if (extend_contents(dh, dh->needlen) == -1)
1830 dh->filled = 0;
1831 newlen = dh->len + fuse_add_direntry(dh->req, dh->contents + dh->len,
1832 dh->needlen - dh->len, name,
1834 if (newlen > dh->needlen)
1837 newlen = dh->len + fuse_add_direntry(dh->req, NULL, 0, name, NULL, 0);
1838 if (extend_contents(dh, newlen) == -1)
1841 fuse_add_direntry(dh->req, dh->contents + dh->len, dh->size - dh->len,
1844 dh->len = newlen;
1849 size_t size, off_t off, struct fuse_dh *dh,
1859 dh->len = 0;
1860 dh->error = 0;
1861 dh->needlen = size;
1862 dh->filled = 1;
1863 dh->req = req;
1865 err = fuse_fs_readdir(f->fs, path, dh, fill_dir, off, fi);
1867 dh->req = NULL;
1869 err = dh->error;
1871 dh->filled = 0;
1883 struct fuse_dh *dh = get_dirhandle(llfi, &fi);
1885 pthread_mutex_lock(&dh->lock);
1889 dh->filled = 0;
1891 if (!dh->filled) {
1892 int err = readdir_fill(f, req, ino, size, off, dh, &fi);
1898 if (dh->filled) {
1899 if (off < dh->len) {
1900 if (off + size > dh->len)
1901 size = dh->len - off;
1905 size = dh->len;
1908 fuse_reply_buf(req, dh->contents + off, size);
1910 pthread_mutex_unlock(&dh->lock);
1919 struct fuse_dh *dh = get_dirhandle(llfi, &fi);
1930 pthread_mutex_lock(&dh->lock);
1931 pthread_mutex_unlock(&dh->lock);
1932 pthread_mutex_destroy(&dh->lock);
1933 free(dh->contents);
1934 free(dh);